How to write programs that support internationalization using cmake?

7

I am writing a small software in C ++ and would like to be able to translate it into other languages. Looking quickly through the internet, the most accepted tool in linux environments is GNU gettext .

In the official project documentation Gnome has this link giving some steps to boot the tool.

A part of the explanation is very good and quite obvious, but I had some doubts along the way.

  • How do I initialize intl / gettext with cmake? Generally I just add the libraries I need in my CMakeLists.txt , but in the link above they use a shell script.
  • What is the purpose of the command intltoolize ?
  • I was a bit confused with the POTFILES.in file. If the translation is done at run-time, what is the purpose of listing the files that have something to be translated? When I compile these references will be lost anyway, so why should I mark them?
  • What is the purpose of the other intl files ( intltool-extract.in , intltool-merge.in and intltool-update.in ?
  • I do not know if this helps, but some details of the project:

    • I'm using g ++
    • The target language is c ++ 17
    • The gtkmm library is already included in my project, so I do not know if I need to add more dependencies to use gettext .
    asked by anonymous 30.10.2017 / 13:53

    0 answers