On Fri, May 9, 2008 at 6:42 PM, Richard Liao <[EMAIL PROTECTED]> wrote:
>
> On Fri, May 9, 2008 at 3:37 PM, Christian Boos <[EMAIL PROTECTED]> wrote:
>>
>> Hello Richard,
>>
>> Thanks for pointing out the problematic places left.
>>
>> Richard Liao wrote:
>>> Hi,
>>>
>>> I'm trying to make a fully translated trac 0.12 based on the trunk(r7002).
>>>
>>> What I have done:
>>> 1. Fully translated the messages.po file.
>>> 2. Fully translated the default wiki pages into our local language: zh_CN.
>>>  (I have noticed new help branch in sandbox, but currently, I have to
>>> translate these wiki pages.)
>>>
>>> The problem is: the UI elements are not fully i18n-ed.
>>> 1. Some string is not i18n-ed in py files.
>>> e.g.
>>> trac/ticket/web_ui.py: line 308:309
>>>             return tag('Ticket ', tag.em('#', ticket.id, title=title),
>>>                        ' (', shorten_line(summary), ') ', verb)
>>> those should be:
>>>             return tag(_('Ticket '), tag.em('#', ticket.id, title=title),
>>>                        ' (', shorten_line(summary), ') ', _(verb))
>>> How do I submit a patch?
>>>
>>
>> _(verb) won't work. We rather have to spot the original string
>> definitions that can end up in this variable.
>>
>> The above will be rewritten differently:
>>
>> M_('Ticket %(ticketref)s (%(summary)s) %(verb)s'),
>>   ticketref=tag.em('#', ticket.id, title=title),
>>   summary=shorten_line(summary), verb=verb))
>>
>>
>> with M_ a new keyword for indicating Markup strings.
>> I'll try to find some time later today to prototype it.
>>
> the new M_ will make all strings i18n automatically, thus we don't
> need to add _(...) anymore, right?
>
the point is, when we can enjoy this feature?

>>> 2. Some strings never appear not in genshi template or py files:
>>> e.g.
>>>  trac/ticket/template/ticket.html: line 150
>>>                   <py:if test="field">${field.label or field.name}:</py:if>
>>>
>>>  and in  trac/ticket/web_ui.py: line 552:560
>>>  the string of ticket.fields['label'] or ticket.fields['edit_label']
>>> or ticket.fields['name'] is not i18n-ed.
>>>
>>>  Those strings in ticket fields never appears in either py file or in
>>> genshi template files.
>>>  Which make those string can not be gathered into pot file, thus can
>>> not be i18n-ed.
>>>  e.g. priority, severitiy, status, and so on.
>>>
>>
>> For the default values, we can find where there are defined
>> (trac/db_default.py?) and mark them to be translated there.
>> But we also need a more general mechanism for getting the correct i18n
>> value for locally defined ones (additional names for standard fields,
> Agree.
>
>>  labels for custom fields). Maybe this can be done by using localized
>> .ini files (trac.ini.fr_FR).
>>
>>>  My suggestion is to maintain a tracterms.py file, including all
>>> frequently used trac terms, to enable we i18n variables in genshi
>>> template files as below:
>>>                   <py:if test="field">${_(field.label) or
>>> _(field.name)}:</py:if>
>>>
>>> 3. Since some template strings in pot file can't be displayed
>>> correctly by current Genshi ticket #129.
>>> And I want to make all template work for now. Can we make all template
>>> strings i18n-ed by hand?
>>> e.g.
>>>  trac/ticket/template/ticket.html: line 139
>>>               <th id="h_reporter">Reported by:</th>
>>>               <th id="h_reporter">${_('Reported by:')}</th>
>>>
>>
>> What's the problem here? A text node inside a  <th>, why is that not
>> extracted?
>>
>>> If we agree with it, I can make a patch of all template files.
>>>
>>
>> Please no. Looks like this has to be fixed at the Genshi/Babel level.
>> One of the main goal of switching to Genshi was to be able to write nice
>> templates,
>> and having to encapsulate every text within ${_('...')} isn't exactly my
>> idea of a nice template. Note that the same can be said for the
>> attributes, and though that's a "lesser evil", I'd appreciate if this
>> could be fixed at the Genshi/Babel level as well - maybe
>> http://genshi.edgewall.org/ticket/223 ?.
>>
> As for the third problem, I'm going to make that 'evil' version for
> our own purpose until Genshi/Babel finally resolve it:)
> Maybe I should keep it in trac-hacks.org if other people need it.
>
> Thanks for your advices.
>

because uor team need Chinese view now,
so for others urgency Chinese people, we will release "uglily i18N"
Trac0.12zh version at:
http://trac-hacks.org/wiki/TracChineseTranslation

of course focus GENSHI upgrade,
waiting grace i18N relaese ;)

-- 
'''过程改进乃是开始催生可促生靠谱的人的组织!
PI keeps evolving organizations which promoting people be good!
'''http://zoomquiet.org
Pls. usage OOo to replace M$ Office. http://zh.openoffice.org
Pls. usage 7-zip to replace WinRAR/WinZip. http://7-zip.org
You can get the truely Freedom 4 software.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to