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.
Hi. I am having some trouble setting up the translation for my application. I am trying, for now, to create a translation to Romanian for my application, which goes by the name synodia. Here is what I have done:
I've extracted the _("") strings with xgettext into a po file.
I've translated them using PoEdit and compiled them into a mo file.
I've placed the mo file in the same directory with the executable file of my application, in synodia/ro/ro.mo
Surprising as it might seem, I did. Yet the sample does not provide any example of working with wxTranslations or wxTranslationsLoader. Anyway, after reading the sample again a few times, my current approach is:
if (!locale.Init(wxLANGUAGE_ROMANIAN))
std::cout << "Could not init"; // doesnt show up so should be fine, in theory
locale.AddCatalog("synodia"); // false
std::cout << wxLocale::IsAvailable(wxLANGUAGE_ROMANIAN); // true
std::cout << locale.IsLoaded("synodia"); // false
The synodia.mo file is placed in /usr/share/locale/ro/LC_MESSAGES
Still no clue how this actually works.
Last edited by Petru on Wed Jun 20, 2018 7:42 am, edited 1 time in total.
Petru Dimitriu, Romanian. wxWidgets 3.1 on Windows 7 & Ubuntu with MinGW/GCC + CLion
I forgot to mention that AddCatalog() also returns false. In fact, it returns false no matter what I try to load, even with names of files which are indeed located in /usr/share/locale/ro/LC_MESSAGES
As for the exact place where it fails, I'll have to compile wx with debug symbols for that, I'll work on it later.
Petru Dimitriu, Romanian. wxWidgets 3.1 on Windows 7 & Ubuntu with MinGW/GCC + CLion