Home » U++ Library support » U++ Libraries and TheIDE: i18n, Unicode and Internationalization » Translation in static members
Translation in static members [message #31111] |
Sat, 05 February 2011 14:58 |
|
Is it possible to translate test in static member of a class?
Consider this simplified code:
#include <Core/Core.h>
using namespace Upp;
#define TFILE <test/test.t>
#include <Core/t.h>
struct test{
static const char* str;
const char* str2;
test():str(t_("translation")){};
};
const char* test::str=t_("translation");
CONSOLE_APP_MAIN{
SetLanguage(GetSystemLNG());
test t;
DUMP(t.str); // doesn't translate
DUMP(t.str2); // works fine
DUMP(t_("translation")); // works fine
}
I believe the problem is that the static member is initialized earlier than the translations. Is there some reasonable workaround? Or is the only solution to make the member non-static?
Thanks,
Honza
|
|
|
Goto Forum:
Current Time: Fri Sep 20 15:15:35 CEST 2024
Total time taken to generate the page: 0.02321 seconds
|