On Thu, May 14, 2009 at 11:25 PM, Sabina und Simon Heimberg
<[email protected]> wrote:
> What is wrong with the current behaviour?
>
> Your change is probably not a good idea. Where does the translator know
> from that he has to translate _modified, _commit ...? gettext can not
> extract this information, so it is not in the po file.
>
> Greetings,
> Simon
>
> Am Donnerstag, den 14.05.2009, 21:01 +0900 schrieb Yuki KODAMA:
>> # HG changeset patch
>> # User Yuki KODAMA <[email protected]>
>> # Date 1242302123 -32400
>> # Node ID d6f1b029244fb412328199de5ba01618f1918d2a
>> # Parent  681187e3b1a5b5b361bb565d0ad4baa30c8189e7
>> status: fix i18n wrappers of checkbox labels for non-English language
>>
>> diff --git a/hggtk/status.py b/hggtk/status.py
>> --- a/hggtk/status.py
>> +++ b/hggtk/status.py
>> @@ -447,12 +447,12 @@
>>
>>         self._show_checks = {}
>>         row, col = 0, 0
>> -        checks = (_('modified'), _('added'), _('removed'))
>> +        checks = ('modified', 'added', 'removed')
>>         if self.count_revs() <= 1:
>> -            checks += (_('deleted'), _('unknown'), _('clean'), _('ignored'))
>> +            checks += ('deleted', 'unknown', 'clean', 'ignored')
>>
>>         for ctype in checks:
>> -            check = gtk.CheckButton('_' + ctype)
>> +            check = gtk.CheckButton(_('_' + ctype))
>>             check.connect('toggled', self._show_toggle, ctype)
>>             table.attach(check, col, col+1, row, row+1)
>>             self._show_checks[ctype] = check
>>
>> ------------------------------------------------------------------------------
>> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
>> production scanning environment may not be a perfect world - but thanks to
>> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
>> Series Scanner you'll get full speed at 300 dpi even with all image
>> processing features enabled. http://p.sf.net/sfu/kodak-com
>

Thanks for response, Simon.
There are 2 wrong behaviors.

First one, Commit dialog failed to apply default checkbox state.
When I opened Commit dialog, the checkbox state is cleared in all checkboxes.
Second, All accelerator keys of checkbox was disabled.

These issue cause by early translation.
The translation string should be ONLY applied checkbox labels.

For example, let's following the transition of one checkbox label "modified":

   checks = (_('modified'), _('added'), _('removed'))

by this statement, variable 'check' contains translated string of "modified".
In Japanese, it is "変更".
Next, in for-loop by variable 'check', variable 'ctype' hold
**translated string**.
So it produces wrong acceleration key.

   check = gtk.CheckButton('_' + ctype)

In English, "_" + "modified" = "_modified" is OK.
But in Japanese (and others), "_" + "変更" = "_変更" is wrong.

And more, following 2 statements will bring wrong behavior:

   check.connect('toggled', self._show_toggle, ctype)
   self._show_checks[ctype] = check

Because 'ctype' is translated string.

Regards,
Yuki

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to