|
|
Subscribe / Log in / New account

Clasen: Using modern gettext

At his blog, Matthias Clasen explores the recent enhancements to the the classic GNU gettext utility. Thanks in large part to new maintainer Daiki Ueno, gettext now understands many more file formats—thus enabling developers to easily extract strings from a wide variety of source files for translation. In addition to programming languages, Clasen notes, gettext understands .desktop files, GSettings schemas, GtkBuilder ui files, and Appdata files. "If you don’t want to wait for your favorite format to come with built-in its support, you can also include its files with your application; gettext will look for such files in $XDG_DATA_DIRS/gettext/its/."


to post comments

Clasen: Using modern gettext

Posted Jul 23, 2016 8:29 UTC (Sat) by cyperpunks (subscriber, #39406) [Link] (8 responses)

Can gettext be used for cross platform apps? Are Windows and macOS supported?

Clasen: Using modern gettext

Posted Jul 23, 2016 9:09 UTC (Sat) by mbunkus (subscriber, #87248) [Link] (7 responses)

The gettext tools (xgettext, msgfmt, msgcat etc. etc.) work on all platforms — as does the library libintl. I'm using it for translating an application running on all major Linux, BSDs, MacOS and WIndows. So the answer is a resounding "yes", and has been for ages.

Clasen: Using modern gettext

Posted Jul 23, 2016 21:50 UTC (Sat) by cyperpunks (subscriber, #39406) [Link] (6 responses)

Example of such apps?

Clasen: Using modern gettext

Posted Jul 24, 2016 8:06 UTC (Sun) by huftis (guest, #58900) [Link]

Tux Paint has been using gettext for translation on both Linux, Windows and Mac platforms for 10+ years. It’s been working very well.

A few other projects, like SuperTux and SuperTuxKart, have been using tinygettext instead. It’s a very simple gettext replacement that’s supposedly easier to use cross-platform. In my experience, it has had its share of bugs and lack of features, but it may very well have improved since I last looked at it.

Clasen: Using modern gettext

Posted Jul 24, 2016 8:25 UTC (Sun) by mbunkus (subscriber, #87248) [Link]

The application I meant is MKVToolNix. It has been cross-platform since 2003 and translatable using gettext since 2009.

Clasen: Using modern gettext

Posted Jul 24, 2016 9:16 UTC (Sun) by Lionel_Debroux (subscriber, #30014) [Link] (1 responses)

http://lpg.ticalc.org/ is the umbrella for four cross-platform programs related to TI graphing calculators, with four underlying "libti*" libraries. These programs and libraries have been using gettext facilities for about a decade as well.

Clasen: Using modern gettext

Posted Jul 24, 2016 9:18 UTC (Sun) by cyperpunks (subscriber, #39406) [Link]

Thanks guys!

Clasen: Using modern gettext

Posted Jul 26, 2016 9:26 UTC (Tue) by HenrikH (subscriber, #31152) [Link]

PostgreSQL includes libintl-8.dll in it's Windows install so I take it that they use gettext even on Windows.

Clasen: Using modern gettext

Posted Jul 28, 2016 6:42 UTC (Thu) by Abrahams (guest, #103692) [Link]

The KDE i18n toolchain relies on gettext. That includes many cross-platform applications like Krita.

If you run a Windows machine, just search your hard drive for libintl.dll. You will find copies it all over.

Clasen: Using modern gettext

Posted Jul 23, 2016 20:31 UTC (Sat) by welinder (guest, #4699) [Link] (1 responses)

This seems to depend on gettext 0.19.8.

It might be worth lobbying Ubuntu to upgrade from 0.19.7 to 0.19.8 so
more translators actually have the right tools out of the box.

Clasen: Using modern gettext

Posted Jul 26, 2016 15:28 UTC (Tue) by kiko (subscriber, #69905) [Link]

Thanks for the heads-up. I've requested merging it into 16.10, and we'll consider it for inclusion in backports.

Clasen: Using modern gettext

Posted Jul 24, 2016 8:18 UTC (Sun) by huftis (guest, #58900) [Link] (2 responses)

For the formats that gettext still doesn’t understand natively, one can usually use the Translate Toolkit to convert to/from gettext’s native PO file format. It supports an impressive number of file formats. There are many great tools for working the gettext PO format, and having converters to and from this format is incredibly useful.

Clasen: Using modern gettext

Posted Jul 24, 2016 10:48 UTC (Sun) by swilmet (subscriber, #98424) [Link] (1 responses)

Interesting, because ITS Tool supports only XML files.

Clasen: Using modern gettext

Posted Jul 24, 2016 15:47 UTC (Sun) by khagaroth (guest, #109895) [Link]

There is also the Okapi Framework. Though it is more XLIFF oriented, it can also produce PO files and for some input formats it has better results than translate toolkit and is a bit simpler to extend.


Copyright © 2016, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds