← Back to team overview

kicad-developers team mailing list archive

Re: Bug 2086382 Patch - Translation of Hotkey

 

--000e0cd25578b3a0080463129b8a Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

2009/2/16 Manveru <manveru@...>:
> 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

> 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".

Thanks for the information Manveru, I had a look around and I think I
saw what you were referring to which is to use the wxTRANSLATE macro.
However, I managed to do a new patch as Jean-Pierre suggested.

Jean-Pierre, please find a second attempt at the patch attached. This
patch results in the hotkey list being translated when being
displayed. *.key files remain compatible, and as you suggested I have
added the translation as a comment after the text description.

Hopefully then this patch is closer to what is required. I do think it
would be nice from a user point of view to be able to have the
shortcut key list in the users native language.

Again, built and tested on Windows XP only as linux is still not up
and running here. I have attached two .key files which are the english
output (no translation comments) and the french output, which
currently has three entries translated.

Best Regards,

Brian.
 --000e0cd25578b3a0080463129b8a Content-Type: application/octet-stream; 
name="kicad_hotkeylist_translation.patch"
Content-Disposition: attachment; 
filename="kicad_hotkeylist_translation.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_fr9ulwdq0

[Attachment content not displayed.] --000e0cd25578b3a0080463129b8a Content-Type: application/octet-stream; name="pcbnew.new.en.key"
Content-Disposition: attachment; filename="pcbnew.new.en.key"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_fr9umojj1

[Attachment content not displayed.] --000e0cd25578b3a0080463129b8a Content-Type: application/octet-stream; name="pcbnew.new.fr.key"
Content-Disposition: attachment; filename="pcbnew.new.fr.key"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_fr9unwq72

[Attachment content not displayed.] --000e0cd25578b3a0080463129b8a-- 




References