Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: import from & export to multiple files per locale. #110

Open
lime opened this issue May 4, 2015 · 3 comments
Open

Feature: import from & export to multiple files per locale. #110

lime opened this issue May 4, 2015 · 3 comments

Comments

@lime
Copy link
Contributor

lime commented May 4, 2015

When importing keys for a secondary locale, I would like Tolk to be able to read from multiple YAML files. Currently it's limited to one plain #{locale}.yml, and leaves out keys from files such as lists.sv.yml, products.sv.yml and so on.

For the primary locale, we are already calling I18n.backend.send(:translations) to get all keys, even when split over multiple files. I would assume that we could do the same for secondary locales?


Likewise, it would ease my translation management a lot if Tolk was able to output translations to multiple paths, following the naming used in the primary locale. I see two alternative ways to achieve this:

  1. Store the original file path for each Tolk::Phrase in the db.
  2. Traverse the keys of each primary locale file when dumping to see which translation goes where.

I looked through the import / export / sync files, and got the feeling that there's quite a bit of work ahead if I want to get this working. Therefore I thought I'd reach out first to see if others consider this a feature worth pursuing.

@mib32
Copy link

mib32 commented Aug 7, 2015

+1 👍

@thomasdarde
Copy link
Member

In version 1.8 (if i remember correctly) we did something close. We use a regex to filter wich yml files are loaded. Improving this feature could help with your concern I think.

This commit is maybe a start point:
a6fc7d6

The feature you describe would be greatly appreciated !

@lime
Copy link
Contributor Author

lime commented Aug 7, 2015

Thanks for the reply, I'm happy to hear this feature would be considered useful.

At the moment I am using a commercial SaaS for translation management, meaning it is not too likely I will start working on this feature for Tolk in the near future. It's up for grabs if anyone wants to give it a shot. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants