Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: What you didn't know about theide..
Next Topic: There are too short lines after synchronization. t files.
Goto Forum:
  


Current Time: Sun Apr 28 07:44:46 CEST 2024

Total time taken to generate the page: 0.03868 seconds