Katello/katello — pull request #1364 by lzap (2013-01-07 14:00:06+00:00)
Title: Locale update from upstream

Hey,

today I have been trying to run our unit tests under JRuby and many of them fails because there is one outdated rails-i18n file in config/locale. Instead of quick-fixing this, I have investigated what is going on here.

So if you open git log for this directory, you will see we have been adding files from upstream into our repo. Several files were created by our (Red Hat) localization team. So I have created simple script that pulls all updates from upstream rails-i18n repo skipping those which are not there. Here is how to use it:

'''
[lzap@lzapx locales]$ ./update.sh
Updating bn-IN.yml ... skipped
Updating cs.yml ... ok
Updating de.yml ... ok
Updating en.yml ... ok
Updating es.yml ... ok
Updating fr.yml ... ok
Updating gu.yml ... skipped
Updating hi.yml ... ok
Updating it.yml ... ok
Updating ja.yml ... ok
Updating kn.yml ... ok
Updating ko.yml ... ok
Updating mr.yml ... skipped
Updating or.yml ... skipped
Updating pa.yml ... skipped
Updating pt-BR.yml ... ok
Updating pt-PT.yml ... skipped
Updating ru.yml ... ok
Updating ta.yml ... skipped
Updating te.yml ... skipped
Updating zh-CN.yml ... ok
Updating zh-TW.yml ... ok
'''

I have several comments to do:

Updating bn-IN.yml ... skipped
Updating pt-PT.yml ... skipped

These two files were renamed upstream (bn.yml and pt.yml), therefore I have renamed those and did the update again to get latest versions.

'''
Updating gu.yml ... skipped
Updating mr.yml ... skipped
Updating or.yml ... skipped
Updating pa.yml ... skipped
Updating ta.yml ... skipped
Updating te.yml ... skipped
'''

The above languages are translated in Katello but missing upstream, I would like to push them upstream if there are no objectsions.

Now, I wanted to be absolutely sure I am not throwing out some work of our localization team, so I have created another script (check_upstream.sh) which checks out rails-i18n upstream git and compares everything against our files. Here is the result:

'''
[lzap@lzapx locales]$ ./compare_upstream.sh
Comparing bn-IN.yml ... missing upstream
Comparing cs.yml ... missing strings: upstream:0 katello:25
Comparing de.yml ... missing strings: upstream:0 katello:48
Comparing en.yml ... missing strings: upstream:0 katello:29
Comparing es.yml ... missing strings: upstream:0 katello:48
Comparing fr.yml ... rake aborted!
Comparing gu.yml ... missing upstream
Comparing hi.yml ... missing strings: upstream:0 katello:48
Comparing it.yml ... missing strings: upstream:0 katello:48
Comparing ja.yml ... missing strings: upstream:0 katello:0
Comparing kn.yml ... missing strings: upstream:0 katello:48
Comparing ko.yml ... missing strings: upstream:0 katello:29
Comparing mr.yml ... missing upstream
Comparing or.yml ... missing upstream
Comparing pa.yml ... missing upstream
Comparing pt-BR.yml ... rake aborted!
Comparing pt-PT.yml ... missing upstream
Comparing ru.yml ... missing strings: upstream:0 katello:48
Comparing ta.yml ... missing upstream
Comparing te.yml ... missing upstream
Comparing zh-CN.yml ... rake aborted!
Comparing zh-TW.yml ... rake aborted!
'''

Message rake aborted means there was an issue with YAML parsing. So we can see in ALL cases upstream files are in better condition than our files, we are not losting any translations.

After my update is applied, you can see all strings are fully translated, except bn which misses 16 translations:

'''
Comparing bn.yml ... missing strings: upstream:16 katello:16
Comparing cs.yml ... missing strings: upstream:0 katello:0
Comparing de.yml ... missing strings: upstream:0 katello:0
Comparing en.yml ... missing strings: upstream:0 katello:0
Comparing es.yml ... missing strings: upstream:0 katello:0
Comparing fr.yml ... missing strings: upstream:0 katello:0
Comparing gu.yml ... missing upstream
Comparing hi.yml ... missing strings: upstream:0 katello:0
Comparing it.yml ... missing strings: upstream:0 katello:0
Comparing ja.yml ... missing strings: upstream:0 katello:0
Comparing kn.yml ... missing strings: upstream:0 katello:0
Comparing ko.yml ... missing strings: upstream:0 katello:0
Comparing mr.yml ... missing upstream
Comparing or.yml ... missing upstream
Comparing pa.yml ... missing upstream
Comparing pt-BR.yml ... missing strings: upstream:0 katello:0
Comparing pt.yml ... missing strings: upstream:0 katello:0
Comparing ru.yml ... missing strings: upstream:0 katello:0
Comparing ta.yml ... missing upstream
Comparing te.yml ... missing upstream
Comparing zh-CN.yml ... missing strings: upstream:0 katello:0
Comparing zh-TW.yml ... missing strings: upstream:0 katello:0
'''

There is also a new README file in the locales directory with some instructions how to NOT merge updates to prevent this situation:

'''
cat README
Do not commit into this directory directly!

Prepare pull request for the upstream:

https://github.com/svenfuchs/rails-i18n

Make sure the requests gets into proper branches (rails-3-x, rails-4-x...)
and use ./update.sh script to pull new translations into Katello.

Translations are licensed under MIT license.
'''