Search code examples
c++c++11gettextpo

Gettext PO file format


I have some localization going on in the PO format. Is it possible to get the contents of this file within your C++ application? Instead of calling gettext("id here") I want to read the complete file within C++ (on linux and windows)


Solution

  • Yes, definitely you can do this. PO file format is described in gettext's documentation: https://www.gnu.org/software/gettext/manual/gettext.html#PO-Files . You can use it to write your own parser for these files.

    Gettext has also Windows version, you can use it if you are looking any gettext implementtaion for Windows: http://gnuwin32.sourceforge.net/packages/gettext.htm

    Is there any other reason why you want to do this? Please give us more details.