Cleaning up locale files and enforcing consistency#1522
Conversation
|
Thanks for the effort here! I like the idea of keeping things cleaned up, but this does duplicate the defaults into each file and doesn't make use of the default locale fallback. I wonder if it's better to leave out any items that are not yet translated? |
|
If you leave out items not yet translated, how do you know they are not yet translated? It's way better to have untranslated duplicates present right there in the file. That way it's crystal clear that there's a string that needs to be dealt with. As you can see, even better maintained locale file is only about 80% complete. Couldn't have known that before. |
|
☔ The latest upstream changes (presumably #945) made this pull request unmergeable. Please resolve the merge conflicts. |
95ecc37 to
2e22b0e
Compare
|
Any interest in this PR? It's a lot of work to resolve conflicts every time locale file is getting changed on master. Once again, this method of keeping locale files clean is extracted from a few of my projects that have quite a few more i18n strings and it works wonderfully keeping everything in order. |
|
Is it possible to set the not yet translated items to nil or something like that? So we have them in the locale file but it's obvious that they are not translated yet? |
|
Yes, it seems if you have a fallback defined it will use that for keys that have blank values. Does it make sense to blow away english strings from other locales? Easy enough to do, but not really much of a point imo. |
|
👍 awesome! It's fine to leave any that were there prior to this PR, but I don't want to add new english strings to other locales. |
20a8441 to
1adbad5
Compare
|
Done and done. Of course now you gotta reference en.yml to do the translating, but no more duplication of en strings anywhere. |
|
❤️ |
|
☔ The latest upstream changes (presumably #1531) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@GBH Sorry for the delay here, one more fixup and then I'll try to get this merged asap. |
|
Ok, good to go. Let's merge this. |
Currently locale files are a mess. None of them structurally match :en locale so it's hard to tell what is translated and what is not. This PR is an effort to clean everything up and make it very hard to screw it up in the future.
it will complain if you have missing/extra keys in other locales compared to :en
This is only a cleanup. There might be unused keys in :en, but you'll need something like i18n-tasks gem to deal with this. This PR is a foundation for a more manageable locales.
Cheers