How to write programs that support internationalization using cmake?

Asked

Viewed 192 times

12

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

In the official documentation of the Gnome project this link taking a few steps to initialize the tool.

A part of the explanation is very good and quite obvious but I was left with some doubts along the way.

  1. How do I start the Intl/gettext with cmake? Usually I just add the libraries I need into my CMakeLists.txt, but in the link above they use a shell script.
  2. What is the purpose of the command intltoolize?
  3. I got a little confused with the file POTFILES.in. If the translation is done in 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?
  4. What is the purpose of the other files of the Internet (intltool-extract.in, intltool-merge.in and intltool-update.in?

I don’t know if this helps, but some details of the project:

  • I’m using g++
  • Target language is c++17
  • The library is already included in my project gtkmm, so I don’t know if I need to include more dependencies to use the gettext.
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.