kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #02231
Re: Bug 2086382 Patch - Translation of Hotkey
-
To:
kicad-devel@xxxxxxxxxxxxxxx
-
From:
Manveru <manveru@...>
-
Date:
Mon, 16 Feb 2009 12:35:40 +0100
-
In-reply-to:
<b845d95d0902150937k5fc06527jf321678fdc9e684f@...>
2009/2/15 Brian Sidebotham <brian.sidebotham@...>:
> 2009/2/15 jean-pierre.charras@... <jean-pierre.charras@...>:
>
>> Sorry, Brian, by your code in patch has some drawbacks.
>>
>> - Removing keyworks from Ki_HotkeyInfo declarations make code unclear.
>> - For *.key files, translation will break compatibility between previous
>> files, and make debugging more difficult.
>> - Code in more complex.
>>
>> If you want to see keywords translated, this can be only when displaying
>> hot
>> key list.
>> Ki_HotkeyInfo static declarations can be made with _("xxx") instead of
>> wxT("xxx").
>> Of course, keywords will not be translated by the wxString constructor,
>> because dictionary is not loaded at this time, but keywords will appear in
>> Poedit list.
>> Generally speaking, keywords and internal error messages must *not* be
>> translated.
>>
>> When displaying keyword list, call wxGetTranslation() explicitly.
>>
>> *.key files must not be changed, but keyword translation can be added as a
>> comment, after the current data:
>> shortcut "?": "Help: this message"
>> could be contains the translated data (for reader info)
>>
>> --
>> Jean-Pierre CHARRAS
>
> Hi Jean-Pierre,
>
> Thank-you for taking the time to review my patch and point out the
> problems with it. I fully understand now why it would cause problems,
> and understand your suggestions. I will go away and come up with
> another patch, this is useful for me to understand the code better.
>
> Thanks,
>
> Brian.
There is a pattern used in such cases, which allows to scan
translations from source code without calling translation process in
working code (dummy translation) and then translating functionality is
called directly before displaying. Please Google for more details,
often called "translation of arrays".
--
Manveru
jabber: manveru@...
gg: 1624001
http://www.manveru.pl
Follow ups
References