-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add missing i18n keys #2092
Add missing i18n keys #2092
Conversation
0b76715
to
e6be726
Compare
Sort language keys alphabetically for easier comparison when missing keys are added.
`i18n-tasks add-missing -v` used to generate missing foreign keys that are present in the base locale (en). Some parsing was needed after which removed any inserted whitespace characters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@@ -1,8 +1,21 @@ | |||
--- | |||
ar: | |||
common: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Some parsing was needed after which removed any inserted whitespace characters."
What parsing was that? (just out of interest, as I always found it quite odd that i18n-tasks adds spaces to the keys it creates).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I found it strange too. I had to do two extra bits of parsing during this work for the keys added by the add-missing
command.
The first was to delete all key values assigned by i18n-tasks add-missing -v <some-value>
. I couldn't get the command to input blank values and so had to pass it an arbitrary value and then do a global delete.
The command below achieved this:
LC_ALL=C find <path-to-locales> -type f -exec sed -i '' -e ’s/<some-value>//g’ {} \;
Running add-missing
also inserted lots of whitespace, annoyingly. Similarly to before I then did a global delete using perl:
find <path-to-locales> -type f -print0 | xargs -0 perl -pi -e 's/ +$//'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice bit of bash hackery there 👍 I think it's nice that you've removed the spaces, though not a deal-breaker if we'd have left them in.
Missing keys autogenerated in the last commit didn't have appropriate pluralization keys for each language as they were simply copied from the base locale (en) - `one` & `other`. This commit adds or removes keys specific to the locale. Work to define each language's pluralization keys was done prior [1] [2] and so we could just copy the rules per set added. [1]: 2a81e71 [2]: 16fd6f6
Adds missing locales.
More info in the commits ->
Trello: https://trello.com/c/kYXvexWo/2455-add-missing-keys-to-locale-files-3