[Project-ideas] Translation editor for DTD resources

nitesh surtani nitesh.surtani0606 at gmail.com
Sun Mar 25 05:35:50 PDT 2012


This is my understanding of the idea as of now.

Mozilla uses dtd and properties files for storing translations for
localizations.

1) Mozilla stores separate .dtd files for each locale (Attr->Val pair),
unlike .po files.
2) The keyboard shortcuts are also defined in the same in the same file (in
Attr->Val pair)

*Idea*: We can write a engine which reads from the dtd file, extract
strings, writes them in po file and then run a localization tool for the
translator for editing the translations.

We write a script (say convert-dtd_po.*) which does the following tasks:

Checks whether the dtd files for both the locales (say en.dtd and bn.dtd)
are available. // We want to convert to en_bn.po (or bn_IN.po)
If Yes:     // Create en_bn.po with corresponding strings.
- Read both the dtd files and use regular expressions to extract the
corresponding strings.
- Open file en_bn.po to write.
- Write these strings to en_bn.po file with msgid as english string and
msgstr as corresponding bengali string.
- Close the files en.dtdm bn.dtd and en_bn.dtd

If No:
- Read the english dtd file and use regular expressions to extract the
strings.
- Write these strings in a .po file, with msgid as the english string and
msgstr as ""
- Now we have source_target.po language file, but the strings are not yet
translated.
- Start a localization tool with argument as source_target.po filename.
- Edit the translations in the localization tool and save the file.

Finally we get a en_bn.po (or bn_IN.po) translated file.

*Modular and Flexible*:
One always wants to use the tool of his choice. We can allow the translator
to choose the localization tool which suits him by taking input from him,
by making necessary changes in the script.

*Extendible*:
The script can be made extendible to other file types. Most of the steps
will be followed described above remain same for all the file types.
Reading the source file and regular expression declaration can be done in
separate files. So, for extending it to new file type, only these two files
will be changed.

Platform Independency will be taken care of.

*Doubt*: What has to be done with the accesskey and the commandkey
(shortcut keys).
I have tried it with Lokalize, using php for writing script.

Please correct/add something if I am wrong. I will be happy to modify it
depending on your suggestions and feedback.

Thanks,
Nitesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ankur.org.in/pipermail/project-ideas-ankur.org.in/attachments/20120325/d08bce92/attachment-0002.htm>


More information about the Project-ideas mailing list