Home » Community » Newbie corner » Translations in header file
Translations in header file [message #46453] |
Thu, 12 May 2016 10:30 |
Giorgio
Messages: 218 Registered: August 2015
|
Experienced Member |
|
|
Hi there,
I am "internationalizating" my application and found a problem
I have this .h file containing an enum class and a static array:
enum class Reason_idx : int {
PRICE = 0,
DELIVERY = 1,
COMPLIANCE = 2,
CERTIFICATES = 3,
NumReason = 4
};
static const char* const REASON[] = {
t_("Price"),
t_("Delivery"),
t_("Technical compliance"),
t_("Certificates")
};
Whenever I need them (e.g. to fill in a droplist) I use something like that:
for (int i = 0; i < (int)Reason_idx::NumReason; i++)
OpReason.Add(Reason[i]);
I put those in a header file because they are related to a database (they are the possible values of a table) and so I use the same file across a number of applications that connect to that database. The problem is that those string are never translated. Other parts of the applications (labels, messages) are properly translated. Those strings have a translation in the .t file of the application.
Someone has hints?
Regards,
Gio
|
|
|
Goto Forum:
Current Time: Thu Oct 31 23:59:38 CET 2024
Total time taken to generate the page: 0.01866 seconds
|