If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
The problem is "Item 1" and "Item 2" are shown when I use the string array somewhere in my program. The corresponding translation is never shown. What could be the problem? ( Other texts are correctly translated and shown in my application)
zhouhao wrote:The problem is "Item 1" and "Item 2" are shown when I use the string array somewhere in my program. The corresponding translation is never shown. What could be the problem? ( Other texts are correctly translated and shown in my application)
Since you use static wxString constants the compiler generates initialization code that is executed before your program gets the chance to load the po message catalogs. Therefore no translation is available and the strings remain untranslated.
You have to mark such strings using wxTRANSLATE() instead of _(), so that poEdit collects them, and use the function ::wxGetTranslation() to translate the strings at the places in your program where you use them.
zhouhao wrote:The problem is "Item 1" and "Item 2" are shown when I use the string array somewhere in my program. The corresponding translation is never shown. What could be the problem? ( Other texts are correctly translated and shown in my application)
Since you use static wxString constants the compiler generates initialization code that is executed before your program gets the chance to load the po message catalogs. Therefore no translation is available and the strings remain untranslated.
You have to mark such strings using wxTRANSLATE() instead of _(), so that poEdit collects them, and use the function ::wxGetTranslation() to translate the strings at the places in your program where you use them.