Skip to content

Cleaning up locale files and enforcing consistency#1522

Merged
dwradcliffe merged 1 commit into
rubygems:masterfrom
GBH:fix/i18n_cleanup
Jan 8, 2017
Merged

Cleaning up locale files and enforcing consistency#1522
dwradcliffe merged 1 commit into
rubygems:masterfrom
GBH:fix/i18n_cleanup

Conversation

@GBH
Copy link
Copy Markdown
Contributor

@GBH GBH commented Dec 23, 2016

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.

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

@dwradcliffe
Copy link
Copy Markdown
Member

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?

@GBH
Copy link
Copy Markdown
Contributor Author

GBH commented Dec 24, 2016

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.

@homu
Copy link
Copy Markdown
Contributor

homu commented Dec 28, 2016

☔ The latest upstream changes (presumably #945) made this pull request unmergeable. Please resolve the merge conflicts.

@GBH GBH force-pushed the fix/i18n_cleanup branch 2 times, most recently from 95ecc37 to 2e22b0e Compare December 31, 2016 16:38
@GBH
Copy link
Copy Markdown
Contributor Author

GBH commented Dec 31, 2016

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.

@dwradcliffe
Copy link
Copy Markdown
Member

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?

@GBH
Copy link
Copy Markdown
Contributor Author

GBH commented Jan 1, 2017

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.

@dwradcliffe
Copy link
Copy Markdown
Member

👍 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.

@GBH GBH force-pushed the fix/i18n_cleanup branch 3 times, most recently from 20a8441 to 1adbad5 Compare January 2, 2017 06:04
@GBH
Copy link
Copy Markdown
Contributor Author

GBH commented Jan 2, 2017

Done and done. Of course now you gotta reference en.yml to do the translating, but no more duplication of en strings anywhere.

@simi
Copy link
Copy Markdown
Contributor

simi commented Jan 2, 2017

❤️

@homu
Copy link
Copy Markdown
Contributor

homu commented Jan 5, 2017

☔ The latest upstream changes (presumably #1531) made this pull request unmergeable. Please resolve the merge conflicts.

@dwradcliffe
Copy link
Copy Markdown
Member

@GBH Sorry for the delay here, one more fixup and then I'll try to get this merged asap.

@GBH GBH force-pushed the fix/i18n_cleanup branch from 1adbad5 to 2d79c1c Compare January 8, 2017 19:26
@GBH
Copy link
Copy Markdown
Contributor Author

GBH commented Jan 8, 2017

Ok, good to go. Let's merge this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants