
On 4/14/2011 5:14 PM, Artyom wrote:
Because the sources are in UTF-8 ;-) and it is "Hello World" in Hebrew
It can be UTF-16 as wel. It's just other encoding can't represents hebrew characters.
(with vowel marks)
:-)
The best is just to use UTF-8 (source code) anywhere - MSVC handles it just fine... I agree with that part.
But the point is string literal with no encoding prefix is evil. if i write
char s[] = "あいうえお" ;
MSVC use shift-jis encoding.
Japanese will sure to write something like translate("日本語").
The point is that in the source you should write:
MessageBoxW(wgettext("Language").c_str(),wgettext("Japanese language").c_str(),MB_OK)
// (ASCII source)
And it would be translated by the dictionaries to
MessageBoxW(L"言語",L"日本語",MB_OK); // In real calls, not the source code
The point if you use Japanese - inline then you don't need to translate strings, and if you do translate then write source code with ASCII strings that would work with any encoding and would be understandable for any software)
This is how all translation systems I know work.
Having original text strings in Japanese and translating them to French or Hebrew is very-very-bad idea as it is much simpler to find somebody to be able to translate the text from English to Hebrew then from Japanese to Hebrew.
This is just plain silly. Telling someone who uses language X that in order to translate their code to language Y they need to first translate their code to English and then translate English to language Y, and that this is somehow superior, is just inane reasoning. Supporting such reasoning by saying that "everyone" does it that way is equally inane for many obvious reasons. It is much better to admit that the "translate" part of a locale library may be flawed, or limited, than to have to justify such illogical nonsense. I am not saying that your following the way that gnu Gettext does translation is not understandable, in that you chose to follow a popular way ot doing something. But I am saying that trying to justify it in the illogical way that you do, given a perfectly reasonable objection, is completely wrong.