<div class="gmail_quote"><div>This is my understanding of the idea as of now.</div><div><br></div><div>Mozilla uses dtd and properties files for storing translations for localizations.</div><div><br></div><div>1) Mozilla stores separate .dtd files for each locale (Attr->Val pair), unlike .po files.</div>

<div>2) The keyboard shortcuts are also defined in the same in the same file (in Attr->Val pair)</div><div><br></div><div><b>Idea</b>: 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.</div>

<div><br></div><div>We write a script (say convert-dtd_po.*) which does the following tasks:</div><div><br></div><div>Checks whether the dtd files for both the locales (say en.dtd and bn.dtd) are available.<span style="white-space:pre-wrap"> </span>// We want to convert to en_bn.po (or bn_IN.po)</div>

<div>If Yes:     // Create en_bn.po with corresponding strings.</div><div>- Read both the dtd files and use regular expressions to extract the corresponding strings.</div><div>- Open file en_bn.po to write.</div><div>- Write these strings to en_bn.po file with msgid as english string and msgstr as corresponding bengali string.</div>

<div>- Close the files en.dtdm bn.dtd and en_bn.dtd</div><div>  </div><div>If No: </div><div>- Read the english dtd file and use regular expressions to extract the strings.</div><div>- Write these strings in a .po file, with msgid as the english string and msgstr as ""</div>

<div>- Now we have source_target.po language file, but the strings are not yet translated.</div><div>- Start a localization tool with argument as source_target.po filename.</div><div>- Edit the translations in the localization tool and save the file.</div>

<div><br></div><div>Finally we get a en_bn.po (or bn_IN.po) translated file.</div><div><br></div><div><b>Modular and Flexible</b>:</div><div>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.</div>

<div><br></div><div><b>Extendible</b>: </div><div>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.</div>

<div><br></div><div>Platform Independency will be taken care of.</div><div><br></div><div><b>Doubt</b>: What has to be done with the accesskey and the commandkey (shortcut keys).</div><div>I have tried it with Lokalize, using php for writing script.</div>

<div>  </div><div>Please correct/add something if I am wrong. I will be happy to modify it depending on your suggestions and feedback.</div><div><br></div><div>Thanks,</div><div>Nitesh</div>
</div><br>