← Back to team overview

kicad-developers team mailing list archive

Re: Translations

 

Le 22/04/2015 19:23, Nick Østergaard a écrit :
> If I have not misunderstood something, then
> wxT("text")    is non translateable text
> _("text")      is translateable text

Yes, this is right.
wxT() and _() are macros to handle strings.

wxT() is used to declare unicode strings, and is widely used inside
Kicad  code.
(It is no more needed, since wxWidgets 3.0, but it is still used).

_() is a macro equivalent to wxGetTranslation(), which returns the
translated string, but this macro is more esay to use than wxGetTranslation

But there is a second reason to use _() for translated texts:
This is also a marker to extract from code the strings to translate, by
translation tools (for instance by PoEdit).

_() is also a marker (for PoEdit and other tools).

It works for strings built on the fly, but not for static strings (i.e.
when the dictionaries are not yet loaded).

Static strings which have to be translated is a more tricky case.

> 
> You can read some more about translating in:
> https://github.com/KiCad/kicad-source-mirror/blob/master/Documentation/GUI_Translation_HOWTO.pdf
> 
> (I think Marco is in the process of converting this document to
> asciidoc for our new documentation.) Thanks!
> 
> 2015-04-22 18:15 GMT+02:00 Jonatas <jonatas.eletrica@xxxxxxxxx>:
>> Hello,
>>
>> What is the difference between using wxT("text") and _("text") on the source
>> code for translation.
>>
>> What is the recommended for translation text?
>>
>> Jonatas


-- 
Jean-Pierre CHARRAS


References