On 15 October 2013 19:27, Olemis Lang <[email protected]> wrote:
>>>   1. Detect all strings selectable for translation , especially
>>> _('string')
>>
>> In here I did not mention that sometimes the string included in Genshi
>> templates and/or _('source code') is exactly the same one you'll see
>> in Trac . IMO in that case available translations **should** be reused
>> (rather than creating a carbon copy in bh domain(s) ) ... and thereby
>> maybe more tricks and edits will be required .
>>
>>>   2. Create translation domain for Bloodhound plugins
>>>       * or maybe one domain per plugin ?
>>>   3. Define i18n:domain in Genshi templates
>>>   4. Run Trac extraction commands
>>>   5. Prepare and compile the catalog
>>>   6. Ensure that translations will be actually loaded (e.g. domain match)
>>>   7. Upload files onto Transifex
>>>   8. Translate to <language>
>>>   9. Ensure that translations will be actually loaded for <language>
>>>
>>> Maybe there are a few more gory details involved which will be clarified
>>> in
>>>
>>> http://trac-hacks.org/wiki/TracPluginTranslation
>>> http://trac.edgewall.org/wiki/CookBook/PluginL10N
>>> http://trac.edgewall.org/wiki/TracL10N
>>>
>
> jftr , this ticket may be used to track the progress made on this
> feature , submitting patches , etc ...
>
> https://issues.apache.org/bloodhound/ticket/694
>

Hello,

I managed to understand a little how it works and managed to get
translation of python files and templates.
I still have some issues and would appreciate some guidance on these points:

A) Do you want one domain per plugin or one global 'bloodhound' domain
? The way it works, the translation files live in the plugin
directory, so I guess it doesn't really matter. Except if I didn't
understand how it works and we can have one global translation file
for all bloodhound plugin ?

B) For javascript message translation, I followed the instructions here:
http://trac.edgewall.org/wiki/CookBook/PluginL10N#MaketheJavascriptcodetranslation-aware
But I haven't managed to make it work because I don't understand
exactly what I am doing.
For bloodhound_theme, I put the "add_script" in the process_request
method of class QuickCreateTicketDialog in
bloodhound_theme/bhtheme/theme.py. But I don't see the javascript file
in the source code of the web page.
How can I see in the source code the list of the javascript files to
be embedded ?
Can I just make a "print req" in process_request ?

C) As you said for 1), we would like to avoid duplicates translation
string with Trac. How can we do that in practice ?
How can the translation mechanism know in which translation file to
look for the translation ?
Should I mark the duplicated Trac strings for translation (with _("")) or not ?

You can then expect a big patch to come. I don't know if testing is
possible with these kind of changes ?
In addition, I may have some questions as well on how to submit the
patch. Maybe someone can guide me on IRC ?

Regards,

Reply via email to