But please provide us a simple testcase (example code (packed preferably with zip)) that isolates the problem, so that we can examime it on our machines.
]But it only works when I have my language set to czech and that is not what I want to achieve.
As you know, U++ *.t files are meant be used for localization. But you don't really need use the English versions of the strings as default (or at all).
if in the *.cpp file you can simpyl write:
app.Title(t_("přihláška"));
This will make it the default string (the string to be localized, if needed.).
Also you don't need to call:
SetDefaultCharset(CHARSET_UTF8);
UTF8 is/should be enabled by default. This function is to support legacy applications.
rafiwui Messages: 105 Registered: June 2017 Location: Stuttgart, Germany
Experienced Member
Oblivion wrote on Fri, 21 July 2017 14:44
As you know, U++ *.t files are meant be used for localization. But you don't really need use the English versions of the strings as default (or at all).
if in the *.cpp file you can simpyl write:
app.Title(t_("přihláška"));
This will make it the default string (the string to be localized, if needed.).
Two points on this:
1. I learned that it is no good programming style to put non-ASCII letters in pure source code
2. But I want a multinational application, so I need different language support and I don't know how to achieve this in this way.
Oblivion wrote on Fri, 21 July 2017 14:44
Also you don't need to call:
SetDefaultCharset(CHARSET_UTF8);
UTF8 is/should be enabled by default. This function is to support legacy applications.
It is even more curious that the string got "destroyed" then.
By the way: If I do it the way you showed me (put the czech string in the code) and don't uncomment the SetDefaultChar it works.
But why? Why doesn't it take the string correctly from the .t file but from the source code?
1. I learned that it is no good programming style to put non-ASCII letters in pure source code.
Fair point. But not necessarily true. But that's another story...
Quote:
2. But I want a multinational application, so I need different language support and I don't know how to achieve this in this way.
I've attached a simple example which changes the app title, and static text to English, Czech, and Turkish, using a droplist. Maybe it'll give you an idea.
Quote:
But why? Why doesn't it take the string correctly from the .t file but from the source code?
It does. But *.t files are AFAIK component/application-wide, and applied on initialization (not sure about the latter though). It'll pick up the Czech version of the strings only when the language is set to Czech (or the default strings are in Czech).