-
-
Notifications
You must be signed in to change notification settings - Fork 7k
UI text internationalization #44
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
Conversation
Wow, very impressive! I'd like to wait until after the final Arduino 1.0 release comes out before merging this - but it would be great to include after that. One question / concern: what happens when we change the English version of a particular string? Do we then need to manually update the msgid in all of the language files? Would it be better to use shorter strings as keys and provide an English property file to map those to the appropriate messages? |
I am sorry that I pushed unnecessary commits 957999c and 30891e8 as an accident. However, the code is still complete for the purpose of this pull request. Thank you for considering to merge this pull request. I don't have an opinion for the schedule of merge. I can continue to release my privately built Japanese version binary packages until the official merge.
"msgid" will be automatically updated by running "i18n_update.sh". However, the translated "msgstr" string will be discarded from the ".po" file. We have to provide the new "msgstr" string either by translating the new "msgid" or by picking up the old "msgstr" from the old ".po" file. Running "git diff -- *.po" helps to pick up the old string.
This should be the widely discussed issue in the opensource software communities. It may be "perfect" to manage the all messages as short IDs. We don't lose any translated string by updating English messages. The message catalog should not clash by short words with double meanings (like "home", "back" etc). However, it costs a lot to maintain. Programmers have to see the catalog file in addition to the source code to understand the code. Translators have to see both English catalog file and their native language catalog file. At this point, I think it should be better to use English string as msgid as we do currently. |
I cleaned up the unnecessary commits and merges. |
Wrapped the every string literals with _(...) function. The _() function resides in "app/src/processing/app/I18n.java", which translates the UI texts using "Resources_XX.properties" file where XX is the locale code. I provided the properties file for the ja (Japanese) locale. I created this file using "xgettext" and "msgcat" commands. "i18n_update.{py,sh}" files are the tool I used to do that. Change in "app/build.xml" is to include the properties files in jar file.
Imported from Processing development r6687 on http://code.google.com/p/processing Close #1
How do you actually specify which language to use / which properties file to load? Does the pull request need any updates for the latest code? If not, I'll go ahead and merge it. |
See https://github.com/sgk/ArduinoIntl/commit/bfb57073334391d1536f4f3530a7517e047dac75#L7R19. I set baseName as "processing.app.Resources"
No. Although I followed and updated to your commits after I created this pull request, the pull request can be applied to any versions of your commits after I first made the pull request. |
Thanks! I merged this pull request. It was great to see the Arduino IDE come up in Japanese. If I add you to the Arduino wiki on Google Code, can you write some instructions about how to create and update a translation file? Feel free to email me at [email protected] to coordinate. Thanks again! |
Thank you! All Japanese users will love the UI in native language. Of course, I can write instructions about creating a new language catalog file. |
fix a possible parent repeater loop
Internationalization for the user interface (menus, dialogs etc). The UI automatically switches according to the locale. I provided the text catalog for Japanese. You can easily add other languages.
Arduino is not only used for arts, but it is also widely used for education. When used for education, it is a little bit difficult to force students to also learn English in addition to Arduino itself. It is important to let world wide users to be able to use Arduino without learning English. This modification is exactly for this purpose.
The heart of modification is to just add files "I18n.java", "Resources.java", "i18n_update.py" and "i18n_update.sh", for the total of only 155 lines. Other modifications are just to wrap string literals with
_(...)
function. Concatenations of string and variable are converted to the call toI18n.format()
function.If you want to add a language locale "XX", you have to do as follows:
% cd app/src/processing/app
% touch Resources_XX.po
% ./i18n_update.sh
--- You can ignore a warning for "CHARSET" at this time.% ./i18n_update.sh
--- again% git add Resources_XX.*