How to export translated messages from Launchpad? (Re: i18n test environment on Lauchpad staging.

Alexander Belchenko bialix at ukr.net
Fri May 20 07:39:45 UTC 2011


Martin Pool пишет:
> On 16 May 2011 13:29, INADA Naoki <songofacandy at gmail.com> wrote:
>>> Launchpad can export into a bzr branch, which seems like a good fit. I
>>> think we should let it commit the .po files into a branch that gets
>>> merged into bzr trunk, and then compile them into .mo files at
>>> distribution / package build time.
>>>
>>> https://help.launchpad.net/Translations/YourProject/Exports
>> On that URL,
>>
>>> Directory layout
>>> In the branch, each translation file will have a normalised name (de.po for a German translation, zh_CN.po > for Simplified Chinese, eo.po for Esperanto, and so on). Each translation sits in the same directory where > its template was located on import.
>> That's what I wanted to know. It's very nice.
>>
>>>> If build_mo command is needed, I'll copy it from bzr-explorer.
>> I've sent merge request adding build_mo command.
>> https://code.launchpad.net/~songofacandy/bzr/i18n-msgfmt/+merge/61082
> 
> Thanks for that.
> 
> Can you explain for me a bit about why the build_mo command is needed,
> rather than using externally available i18n tools?  Is it just that
> they are hard to install or get running on Windows?

If this question is still valid, I may explain why I've implemented that 
for QBzr and Explorer.

1) There is no problem with Windows, but you definitely want it to be in 
some sort of Makefile. And because setup.py is also kind of Makefile it 
was a very easy to implement that. Also with setup.py build_mo you have 
ability to implement several options to customize its execution. Maybe 
in the end it's not used actually.

2) Using setup.py it's easy to hook build_mo into general setup.py 
build/install process, and therefore make sure translations will be 
compiled/updated on build/install.

3) Using build_mo as python script is easy to implement auto-generation 
of en.mo (pseudo translation for English-to-English language). That was 
proved to be useful on some machines with mixed language settings, e.g. 
on Japanese Windows XP with English user language we have LANG=en:ja, 
but if we don't have en.mo then user will see all messages in Japanese.

So, for me the item 2 is most useful, and item 3 is nice to have. Item 1 
was just in the vein of other i18n-related commands, like build_po (to 
collect messages for translations).

HTH

-- 
All the dude wanted was his rug back



More information about the bazaar mailing list