Our script to generate ja/ja-JP-mac locale files

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Our script to generate ja/ja-JP-mac locale files

This is mainly for Axel but FYI cc to newsgroup.

To automate routine work and to generate ja/ja-JP-mac from one set of
files, we are using scripts (called 'Localization Tools' or in short
just 'lot'):
http://www.mozilla-japan.org/jp/l10n/lot/  (sorry, in Japanese only)
# this zip contains locale files used for Fx/Tb 1.5 (not including
latest files for 2.0)

In the lot-1.0.zip:
  build.xml     main ant build script containing main targets definitions
  build.*.xml   ant build script files loaded from build.xml
  config/*       config files to control how the script works
                     # selected according to properties 'mode',
'package', 'locale' etc.
                     # config/*.conf and config/mozilla1.8/* are for 1.5.0.x
  filters/*        filters files, that define replacement of variables
in the src locale files
                     # as you can expect, ja.filters is for ja and
ja-JP-mac.filters is for ja-JP-mac
                     # common.filters etc are used to make maintenance easy
  src/*            src locale files (both dtd and properties are in utf-8)
                     # src/mozilla1.8/ja/* are for 1.5.0.x ja/ja-JP-mac

I use this script for all localization works (get diff of CVS, get
locale files from CVS, make langpack, compare-locales, re-package win
installer, generate diff html table, etc...) and the script is a
little complicated. But the flow to generate (split) ja and ja-JP-mac
is simple.
The script will replace variables like '@@varname@@' to platform
dependent strings according to defined in the filters files and output
ja/ja-JP-mac files under 'loose' directory.
# In this time, properties files are converted from UTF-8 to Unicode escape.

That is, we maintain one set of files and in case we have to split
translation (words, expression, window size, setting...), we'll define
variables in the filters and use that variables in the src locale
# Files commited into L10N CVS are the files generated under 'loose' directory.

To know usage of Localization Tools, exec:
  ant help -Dlang=English
To generage ja/ja-JP-mac files and lang pack, exec:
  ant -Dlang=English
And you can see other command line examples with:
  ant examples

In case of Japanese, we have two translation for the same English word
(or sentence, etc...) according to each platform's custom/guideline.
It sometimes depends on the context and it cannot be automatically
generated from one to the another.
In case of Serbian, they need not two translation. They just needs two
same translation written in different scripts (alphabet) and it can be
automatically generated from one (cyrillic) to the another (laten).
For difference like window size, Serbian also be able to do same thing
(or just our tool with a little customization to exec their sed

If the build script on mozilla.org support variable to split
translation, we don't need to generate locally and other locales will
be able to do same or similer things.

Our translation flow is:

1. get en-US files from cvs
2. generate diff of en-US
3. define variables to split ja/ja-JP-mac if needed
4. translate/update locale files
5. patch diff of ja src file made by peer
6. generate lang pack
7. generate diff table like:
8. test with lang pack (we mainly test with langpack except near the release)
9. sometimes check into L10N CVS


Mozilla Japan     : http://www.mozilla-japan.org/
 L10N Center     : http://www.mozilla-japan.org/jp/l10n/
 Translation Div : http://www.mozilla-japan.org/jp/td/
dev-l10n mailing list
[hidden email]