← Back to team overview

kicad-developers team mailing list archive

Fwd: Re: [PATCH] Adjust Menubar of 3D Viewer to common style

 

-------- Message transféré --------
Sujet : Re: [Kicad-developers] Fwd: Re: [PATCH] Adjust Menubar of 3D Viewer to common style
Date : Thu, 3 May 2018 20:14:21 +0100
De : Ruth Ivimey-Cook <ruth@xxxxxxxxxx>
Pour : jp charras <jp.charras@xxxxxxxxxx>

JP

On 03/05/2018 18:45, jp charras wrote:
> No.
> Because only ASCII7 chars are allowed in strings to translate, because, AFAIK, I18N tools only
> accept ASCII7 chars, not unicode char set.
>

I'm not quite sure if I've missed something, but it seems from:

http://docs.wxwidgets.org/3.0.4/overview_unicode.html#overview_unicode_support_default

that the ASCII7 limitation refers only to the compiled text file when using standard strings; and it
seems the use of character escapes or L"" (wide) strings is supported.

They give the examples:

wxMessageBox(L"Salut \u00E0 toi!"); // U+00E0 is "Latin Small Letter a with Grave"

wxMessageBox(wxString::FromUTF8("Salut \xC3\xA0 toi!"));
// in UTF8 the character U+00E0 is encoded as 0xC3A0

I cannot see any indication that a wxString passed to wxTranslations::GetTranslatedString() is
limited further than this.

HTH

Ruth


The limitation is not in wxWidgets.
It is in tools used to manage translations, that expect for input texts a ASCII7 string (poedit,
gettext ...).
Of course the output manage unicode strings.

One can create strings with unicode chars, but there is no good way to do that:
for instance
use wxString::Format( _("Salut %c toi!"), 0x00E0)
 (the string to translate is "Salut %c toi!")
or
wxString msg; msg << (_"Salut ") << wxChar(0x00E0) << _( " toi!");
 (2 strings to translate _"Salut " and " toi!")

the first is translatable, but not very readable in code

the second is very bad because it is not really translatable, and not very readable in code.
it is not really translatable because the order of words is fixed, and cannot be acceptable is other
languages.
Unfortunately it is sometimes used (even in Kicad code)

-- 
Jean-Pierre CHARRAS




Follow ups