Wednesday, March 4, 2009

How to: Use LocaleManager

(For Part I, Introduction of LocaleManager, click here.)

It is very easy to use the locale manager. It is a standalone application that runs on window.
The executable and some test input files can be downloaded from
Github
To use it, just follow the screen captures.

1. Start the program. Then select base locale directory, e.g. en_us.
































2. After clicking ok, the base locale name will be shown in red color on the dialog. Also the sibling sub-directories will be displayed in the list box on the left as existing locale. For anybody using subversion, the svn directory also showed up and that shouldn't be selected as a target locale.































3. After selecting locales to work on, click Load and the worksheet will show as follows. My test input files only have 3 lines so it doesn't look impressive. This window is resizable. This worksheet form shows the resource name, its value in base locale and values in selected locales. It is very easy to see which ones are not translated yet.

The target locale file will be reorganized to use the same resource entries as in base. Any entries that exist in base but not in target will be added to the target locale with a blank value. Any entries that exist in target but not in base will be taken out and save to a Mismatch_timestamp.log located in the same folder as the .exe file.

Click Save Changes before close the window and changes made will be saved to target file. Base file will not be touched.










A new feature I just added is the Translate function. You can simply double click on an item under a target locale column, that item will be translated. A message box will pop up to ask you if you want to use that translation to replace the existing one.

The default translator is Microsoft Translator. Not all languages are supported by Microsoft right now. So you can use the menu to select Google Translator to see if your language is supported. I checked a few languages to make sure that the request will get some good response. Such as for Chinese, the parameter I pass to Microsoft Translator is "zh-CHS", but for Google, I need to use "zh_cn". So if you don't get any result from either of the translator, you can try to tweak the request by simply rename your locale folder, whose name is used by LocaleManager to send request to Microsoft or Google.

When you want all items to be translated, click on Translate All on the menu bar, the software will try to send a translate request to Microsoft or Google to translate "Hello World". So take a look at the returned result first. If the result is good, that means all the parameters and your internet connection is working well. If the result is not good or some errors returned, click "No" on the MessageBox to cancel the translation. Click "Yes" will only be a waste of time.

When you have many items to translate, the UI may appear to be frozen. But just leave it like that. It is going to come back when it is done. When I get some time, I can try to add more codes to make the UI more responsive.


No comments:

Post a Comment