Localization/proposal Transifex
From Wiki.ooo4kids.org
DRAFT
Please do not translate the page yet
Back to Localization
Contents |
Introduction
The Idea
The translated NEW strings (new is extremely important) are mostly used for User Interface (aka UI) features, and in the helpcontent. Our concern, is mostly UI, and we find 99% of the strings either in :
- .src files containing the "view" description of the control, or a given window. Only English strings should be inside them.
- .ulf files containing MS Windows installer strings
- .xml files (e.g. like .xcu ) : all localized strings have to be put inside
The main idea is to create, at buildtime, an variable environment for localization purpose. For instance, we'll use ${application} (and probably ${application_name} too).
Thus, we'll modify the file names adding ${application} to them. For example, ${application} will contain -OOo4Kids. In our case, the old localize.sdf will become localize-OOo4Kids.sdf in the makefile (see below for all modified files).
localize.sdf files case
For a given locale (say ${a_locale}) , we'd like to create localize${application}.sdf, used in parallel with OpenOffice.org files, to allow backports,
- we'll just have to add localize${application}.sdf file in l10n/source/${a_locale}/ beside the existing l10n/source/${a_locale}/localize.sdf
Last, but essential, the first field for a given locale, and for a given translated string, is the path. If we don't change the filename, but simply add our strings, there will be no interference with existing localize.sdf, which is extremely important (and great :-), means our new strings will simply be concatened with the existing OOo one. Said differently, the localize-${application}.sdf will simply complete the localize.sdf file one.
Important: maintain an localize-OOo.sdf file will allow/help to backport the translations into OOo, just concatenating the file to localize.sdf for every concerned locale !!
.src files case
No changes, l10n does everything.
Current status :
Solution tested, and works very well, solving the MSI overlaping on Windows
Applied to normal .src, the solution works now : the strings included in the localize${application}.sdf are now correctly used to build the reference localize.sdf in l10n, thus, in the concerned module, the .res never integrates the strings as expected.
Complete new localization process for sl, zh-CN, zh-TW, fi .
Remove the first try in svx, sfx2 and framework, to make it consistent with the new localization process tested in sd.
Current status : ar, de, es, fr, it, nb, nl, pt and en-US done.
- Tools to be used :
- gsicheck (inside OOo sources);
- transex3 (extract the strings from localize.sdf created in l10n, and add them in the .res all concerned modules);
- use Transifex;
- oo2po ( *.sdf to produce .po ) : creates a tree containing filename.po, where filename is the name of the real .src file,
- poedit is a tool who can be used by the translators, but other tools are possible;
- po2oo (po + template to create .sdf ), and other tools from Other tools.
Proposed process
1) Create the localize-OOo4Kids-${a_locale}.sdf
As example :
- create a template, containing the essential : type, RESID, RESNAME, associated constant. See the model below
output=full_path-filename-APPLI_XX.src module=modulename #path separator=\\"\\" path=path1\\"\\"path2\\"\\"path3 filename=aName string_name=" \ CONTROL_NAME1 RID_NAME1 STRING_NAME1 CONSTANT_VALUE The_string1NULL\ CONTROL_NAME2 RID_NAME2 STRING_NAME2 CONSTANT_VALUE The_string2NULL\ CONTROL_NAME3 RID_NAME3 STRING_NAME3 CONSTANT_VALUE The_string3NULL\ CONTROL_NAME4 RID_NAME4 STRING_NAME4 CONSTANT_VALUE The_string4NULL"
* create a valid localize_strings-${application}.sdf containing the same information, including the same TAB numbers and so on than official .sdf
=> using a bash shell script. [Improve : use Perl or Python ?]
* using oo2po, create .po files, and commit them
Example of shell script doing that :
Pre-requisite:
- translate tools (oo2po for instance) must be installed and working on your machine.
- create po/$all_locales and have a freshly checkout of sdf files ( svn co svn://svn.adullact.net/svnroot/ooo4kids1/sdf )
#!/bin/bash
locales="ar de es en-US fi fr it nb nl pt sl zh-CN zh-TW"
for aLocale in $locales ; do
for appli in OOo4Kids OOoLight ; do
oo2po -l $aLocale \
-i sdf/$aLocale/localize_strings-${appli}.sdf \
-o po/$appli/$aLocale
done
done
* use poedit (or any other similar tool) to translate the strings
- either the translators provide their own .sdf or their .po
- collect all .po / .sdf to create the final .sdf including the msi strings
- commit the new final .sdf files
First tests done for French. To be continued.
2) create the po tree on the repo (admin with commit rights role):
The result could be something like:
- OOo4Kids/sdf
- OOo4Kids/trunk
- OOo4Kids/branches
- OOo4Kids/po/OOo4Kids
- OOo4Kids/po/OOoLight
-> the two last directory contains all the new localized strings for OOo4Kids
3) Inside OOo4Kids (this is same distribution inside OOoLight)
First level : the locale
Current existing locales are :
- po/OOo4Kids/ar
- po/OOo4Kids/de
- po/OOo4Kids/es
- po/OOo4Kids/en-US <= the US English reference from which all new locale files will eventually retrieve empty and modified strings
- po/OOo4Kids/fi
- po/OOo4Kids/fr
- po/OOo4Kids/it
- po/OOo4Kids/nb
- po/OOo4Kids/nl
- po/OOo4Kids/pt
- po/OOo4Kids/si
- po/OOo4Kids/sl
- po/OOo4Kids/zh-CN
- po/OOo4Kids/zh-TW
(same for OOoLight )
Comments :
- US English is default, and will just be there to provide a tree of the modifications made directly in the code.
- Estimation of file storage space: X per locale, nX files at the end. Less than 10% of existing files are concerned, 95% of OOo4Kids is already translated. And .po files are atomic, but verbose, so 0,5 GB max per locale (rough estimation), say around 50 GB of hard disk space is needed for 100 locales.
- A mail could be sent to a given mailing list, every time a new file is added. Thus, all the subscribed translators could be informed.
4) Process to add a new file :
create one en-US model
a translator will :
- clone it for a particular locale
- completely translate the file
- add the file back in the tree
- commit the file
- optional : update the file and commit the changes
5) Complete the localize-OOo4Kids-${a_locale}.sdf including the new strings
Once translations will be considered as OK, the localize-${application}-${a_locale}.sdf will be generated with existing tools.
FIXME : define this part of the process better
Result: one localize-${application}-${a_locale}.sdf per locale, to be either added in the l10n/source/${a_locale} directory, or concatened to the existing localize.sdf for a given locale
Rules
- For a given locale, every file will match the name of the ones in the application tree (e.g. OOo4Kids).
For example (using full path) :
po/OOo4Kids/ar/basic/source/app/basic${application}.src
po/OOo4Kids/de/basic/source/app/basic${application}.src
Will result in the creation of :
po/OOo4Kids/ar/basic/source/app/basic${application}.po
po/OOo4Kids/de/basic/source/app/basic${application}.po
- A list of given files to be translated will validate the version
- Missing (not translated) files will not allow to release the matching version
- All locales will have their own tree (and thus, their own level of localization)
- Only translated files will be committed to the to-be-built tree, *for every locale*,
- every time a new file will use new strings, all locales are invited to update their tree
Other rules to be defined/improved :
- create a new translation team
- define rules to provide writing access to the repository
- verification for new strings (at least 2 translators ?)
- updating strings
- define rules to accept a locale at a given version level
Tips
As example, the Slideshow contextual menu, does propose the menu entry "Go to slide" + the subentry "First slide". The description of the strings to be translated can be summarized this way :
The main entry : Go to slide
RID_SLIDESHOW_CONTEXTMENU CM_GOTO 37003 en-US ~Go to Slide
A sub entry (can be several of them) :
RID_SLIDESHOW_CONTEXTMENU.CM_GOTO CM_FIRST_SLIDE 37003 en-US ~First Slide
Eric Bachard 10:21, 20 July 2010 (UTC)
Downloading the .po files
You are translator and want to Checkout the .po files (current status) for $your_locale
IMPORTANT: assuming $your_locale can be found in the following list : ar de es en-US fi fr it nb nl pt sl zh-CN zh-TW
=> please contact us to add a new locale
- Contributing to the OOo4Kids project:
svn co svn://svn.adullact.net/svnroot/ooo4kids1/po/OOo4Kids/$your_locale
Example (we assume that a Subversion client is already installed) :
svn co svn://svn.adullact.net/svnroot/ooo4kids1/po/OOo4Kids/fr my_fr
Will download the following tree :
A my_fr/svx A my_fr/svx/source A my_fr/svx/source/cui.po A my_fr/sfx2 A my_fr/sfx2/source A my_fr/sfx2/source/dialog.po A my_fr/sd A my_fr/sd/source A my_fr/sd/source/ui A my_fr/sd/source/ui/slideshow.po A my_fr/framework A my_fr/framework/source A my_fr/framework/source/services.po Checked out revision 712. and everything will be located in my_fr. If you forgot my_fr, everything will be in fr instead (it means that the locale name is the default).
- Contributing to the OOoLight project:
svn co svn://svn.adullact.net/svnroot/ooo4kids1/po/OOoLight/$your_locale
Downloading the .sdf files
If you are a developer, and want to analyse the content of our localize_strings-${application}.sdf files
svn co svn://svn.adullact.net/svnroot/ooo4kids1/sdf/$your_locale my_locale
will download the required content. Files matching with the locale you are interested in (my_locale) will be located in the matching folder my_sdf/$your_locale.
To dowload all (all locales and all ${application} .sdf files, do :
svn co svn://svn.adullact.net/svnroot/ooo4kids1/sdf my_sdf
Agenda
The new localization process, will only concern the 2.x version and above, and the work is already started, but will probably need the summer before to be convergent. Below a (not exhaustive, please help us) list. An array, say Gantt diagram like, will be created soon.
Tasks / Time.
- create the transifex Teams
- create the new tree
- create the .po's
- extract the translated strings, and create the new localize-${application}-${a_locale}.sdf file
- add the changes to the ${application} sources
- verify and validate
- improve
Useful links (where find tools ... )
- translate.sourceforge.net
- OOo4Kids project on Transifex
- Merge existing .po's with templates (.pot) created from a .sdf : Skolelinux mergetemplate script