← Back to team overview

kicad-developers team mailing list archive

Re: Bug 2086382 Patch - Translation of Hotkey descriptions

 

Brian Sidebotham a écrit :
>
> Hi Guys,
>
> Attached is a patch which allows the Hotkey descriptions to be
> translated by the translators. This includes changes to Pcbnew,
> EESchema and Gerbview to move the hotkey information message from
> being initialised statically and makes them initialised via a call to
> a new initialisation function dynamically.
>
> This changes the hotkey information from wxT( "" ) to _( "" ) so that
> poedit can extract the text for translation.
>
> Changes are made to kicad-source/ pcbnew/hotkeys. cpp,
> kicad-source/ eeschema/ hotkeys.cpp, and
> kicad-source/ gerbview/ hotkeys.cpp. Each one introduces a new
> initialisation function for the hot key descriptions. A call to the
> hot key init function is added to pcbnew.cpp, eeschema.cpp, and
> gerbview.cpp.
>
> Please review the patch and let me know if there are any changes
> required or preferred methods to achieving this bug fix. It would be
> nice for the translators to be able to translate this information as
> it is probably one of the most used pieces of "help"
>
> Built and tested on Windows XP. I am still setting up my linux box so
> it is not yet tested on linux, but I don't foresee any problems.
>
> Best Regards,
>
> Brian.
>

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

Maître de conférences
Directeur d'études 2ieme année.
Génie Electrique et Informatique Industrielle 2
Institut Universitaire de Technologie 1 de Grenoble
BP 67, 38402 St Martin d'Heres Cedex

Recherche :
GIPSA-LIS - INPG
Rue de la Houille Blanche
38400 Saint Martin d'Heres

--------------020703080303090607030506 Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Brian Sidebotham a &eacute;crit&nbsp;:
<blockquote
cite="mid:b845d95d0902141046t66448ba7l80a2e75e7c6be61e@..."
type="cite">
<meta http-equiv="Context-Type"
content="text/html; charset=ISO-8859-1">
<div>
<div>
<div>
<p>Hi Guys,<br>
<br>
Attached is a patch which allows the Hotkey descriptions to be<br>
translated by the translators. This includes changes to Pcbnew,<br>
EESchema and Gerbview to move the hotkey information message from<br>
being initialised statically and makes them initialised via a call to<br>
a new initialisation function dynamically.<br>
<br>
This changes the hotkey information from wxT( "" ) to _( "" ) so that<br>
poedit can extract the text for translation.<br>
<br>
Changes are made to kicad-source/ pcbnew/hotkeys. cpp,<br>
kicad-source/ eeschema/ hotkeys.cpp, and<br>
kicad-source/ gerbview/ hotkeys.cpp. Each one introduces a new<br>
initialisation function for the hot key descriptions. A call to the<br>
hot key init function is added to pcbnew.cpp, eeschema.cpp, and<br>
gerbview.cpp.<br>
<br>
Please review the patch and let me know if there are any changes<br>
required or preferred methods to achieving this bug fix. It would be<br>
nice for the translators to be able to translate this information as<br>
it is probably one of the most used pieces of "help"<br>
<br>
Built and tested on Windows XP. I am still setting up my linux box so<br>
it is not yet tested on linux, but I don't foresee any problems.<br>
<br>
Best Regards,<br>
<br>
Brian.<br>
</p>
</div>
</div>
</div>
</blockquote>
<br>
Sorry, Brian, by your code in patch has some drawbacks.<br>
<br>
- Removing keyworks from Ki_HotkeyInfo declarations make code unclear.<br>
- For *.key files, translation will break compatibility between
previous files, and make debugging more difficult.<br>
- Code in more complex.<br>
<br>
If you want to see keywords translated, this can be only when
displaying hot key list.<br>
Ki_HotkeyInfo static declarations can be made with _("xxx") instead of
wxT("xxx").<br>
Of course, keywords will not be translated&nbsp; by the wxString
constructor, because dictionary is not loaded at this time, but
keywords will appear in Poedit list.<br>
Generally speaking, keywords and internal error messages must *not* be
translated.<br>
<br>
When displaying keyword list, call wxGetTranslation() explicitly.<br>
<br>
*.key files&nbsp; must not be changed, but keyword translation can be added
as a comment, after the current data:<br>
shortcut&nbsp;&nbsp; "?":&nbsp;&nbsp;&nbsp; "Help: this message"<br>
could be contains the translated data (for reader info)<br>
<pre class="moz-signature" cols="72">-- 
Jean-Pierre CHARRAS

Ma&icirc;tre de conf&eacute;rences
Directeur d'&eacute;tudes 2ieme ann&eacute;e.
G&eacute;nie Electrique et Informatique Industrielle 2
Institut Universitaire de Technologie 1 de Grenoble
BP 67, 38402 St Martin d'Heres Cedex

Recherche :
GIPSA-LIS - INPG
Rue de la Houille Blanche
38400 Saint Martin d'Heres
</pre>
</body>
</html>
 --------------020703080303090607030506-- 




Follow ups

References