Skip to content

Keys with only 1 level are not added to yaml export #69

@jgoetze

Description

@jgoetze

Hi everyone,
I got issues exporting db translations to yml file.

In my translations I got this object:

#<TranslationCenter::TranslationKey id: 15, name: "empire", category_id: 5, last_accessed: "2015-06-04 15:02:19", en_status: "untranslated", de_status: "translated", created_at: "2015-06-04 14:56:32", updated_at: "2015-06-04 15:02:19">

I tried to export db2yaml for german. It exported everything except translations keys having no "." in their name.

It tried to reproduce this in console and here are my results:

For each key add_to_hash is called and the result hash is passed. In that method add_to_hash_rec(all_translations, levels, lang) is called and current levels are only ["empire"]. That means, level.count == 1. Returned by the method is {"empire"=>"Imperium"} as it should be, but it never gets added to the passed all_translations hash. So with that, it is not part of the export file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions