Loading translation (.mo) file directly

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.
Post Reply
delt
Earned a small fee
Earned a small fee
Posts: 24
Joined: Mon Dec 26, 2016 11:17 pm

Loading translation (.mo) file directly

Post by delt » Sun Dec 27, 2020 9:25 pm

Hello everyone,

Is it possible to load a translation index by referencing the file directly, or (even better) passing pointer/length of the data? For a few small projects i'd like to have my translations directly embedded into the executable, and not have to rely on system configuration / OS directory layout.

This is possible to do with the standard libintl, but i haven't found any documentation on how to do this with wxLocale & co.

PB
Part Of The Furniture
Part Of The Furniture
Posts: 2928
Joined: Sun Jan 03, 2010 5:45 pm

Re: Loading translation (.mo) file directly

Post by PB » Sun Dec 27, 2020 9:44 pm

What about creating a custom wxTranslationsLoader
https://docs.wxwidgets.org/trunk/classw ... oader.html

Post Reply