From: LM <lm...@gm...> - 2015-05-14 17:00:19
|
On Thu, May 14, 2015, Petra wrote: compiled > and installed it but I have a problem with getting .gmo files from .po > files. To get a .mo file from a .po file, run the msgfmt program (part of gettext): msgfmt filename.po -o filename.mo According to articles such as: http://en.wikipedia.org/wiki/Gettext http://stackoverflow.com/questions/4329756/what-are-the-different-gettext-file-formats-used-for .gmo files are .mo files. The extension just means they're GNU Machine Object files (where generated by/for GNU tools). > Also I tried to start the game in some other > language, like German, and it just started in English. Assuming your version of libintl handles switching languages, you should be able to change the language globally by changing environment variables. The version of libintl I use (BSD version, not GNU), checks environment variables LANGUAGE, LC_ALL (and other LC variables) and then LANG. I believe that's a POSIX standard so it should be similar for the GNU libintl library. Let's assume the country code for Croatia is HR. If I want to run a program using the mo file(s) for Croatia, I set the LANG variable before running it: export LANG=hr. You need the corresponding .mo file(s) installed in share/locale/hr/LC_MESSAGES so libintl can find them (or in a location libintl is configured to search). To start Tuxmath in German, you should be able to use: export LANG=de If you have gcc (GNU C compiler) on your system, type gcc to test out the results and see if the output is in another language. I typically start programs from the command line. If you're starting from a desktop or window manager, you need to set the environment variable globally somehow (methods vary depending on desktop) or set it before you start X Windows. If you're running on Windows 7, you can build Tuxmath natively on Windows using mingw and msys and then you don't have to deal with an extra layer of complexity. Same techniques work for setting languages on Windows (assuming the programs use libintl) and you can change the environment variables via msys shell program, command line or globally in Windows. I've built and run Tuxmath that way. Sincerely, Laura |