Talk:Gettext

Only about GNU gettext
This page seems to be only about GNU gettext, but has a generic gettext title. It should at least mention that gettext originated at Sun, and is still used by Sun's software and OS. The portable environment variable is named, not  , the latter being a GNU extension with certain additional features.
 * I changed it to GNU gettext for now. If a generic gettext page is later made, this can be merged back in. Superm401 - Talk 00:01, 8 September 2008 (UTC)
 * ✅ This is now a generic page and not only GNU specific. The article has been renamed to gettext. Wget (talk) 22:01, 25 June 2016 (UTC)

LANG and LANGUAGE?
What is the difference between LANG and LANGUAGE? This is not defined in the gettext manual http://www.gnu.org/software/gettext/manual/html_mono/gettext.html


 * The proper variable which refers to translation only is neither but LC_MESSAGES. LANG is a very generic (mostly historic despite being most known) variable which affects also the character set, the date format and others. This is especially problematic as LANG often unnecessarily implies something inferior to UTF-8. --82.141.49.90 16:49, 9 January 2007 (UTC)


 * Replying to an old comment for clarity's sake. Here's what the ABOUT-NLS file (distributed with gettext) says:


 * "Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages.  This is done through a different environment variable, called `LANGUAGE'.  GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries.  For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'."


 * 80.233.255.7 23:58, 29 October 2007 (UTC)

Thread safe
It reads on this article that gettext isn't thread safe! But it is locales that aren't thread safe! I'm removing the whole sentence. 80.244.73.230 22:47, 21 October 2007 (UTC)

MIME type
Is there any MIME type for .po files? I have seen text/x-po used, but I want to know if there is anything (semi-)official.

Portable Object
Some articles link to this one for a discription of PO = portable object, but PO is not mentioned here. Maybe it should be. --LA2 (talk) 02:18, 7 January 2008 (UTC)

Merger from msgfmt
Any objections to merging the content from msgfmt into this article and leaving that as a redirect to here? That article has forever been only a 2-sentence stub and almost could be deletable for lack of asserted notability. Is there anything major to say about that utility, and is it so important on its own vs just being a component of the gettext system? DMacks (talk) 19:44, 4 July 2008 (UTC)

How to update a .po file
It should be interesting to present not only how to create, but also how to update a .po file. http://live.gnome.org/TranslationProject/SvnHowTo shows these steps: intltool-update xy ; vi xy.po ; msgfmt -cv -o /dev/null xy.po —Preceding unsigned comment added by 82.238.108.175 (talk) 17:03, 25 February 2009 (UTC)

History, background and perspective
It would be nice to have some background story available. Initially, POSIX provided no means of localizing messages. Then, some time in the late 1980's, two proposals emerged: in 1988, the X/Open consortium specified the catgets interface in the X/Open Portability Guide Issue 3 (XPG-3), where the messages are indexed by an integer, and in 1989, the UniForum group specified the gettext interface, where the messages are indexed by string constants. Sun Microsystems was the first to implement the gettext interface in their SunOS, but for a long time, most commercial Unices offered support to both interfaces. The gettext specifications eventually became part of POSIX.1b in 1993. — Preceding unsigned comment added by Peterlin~enwiki (talk • contribs)

Translator comments
The article uses /// to indicate translator comments. This is probably OK but why does the comment also start with " TRANSLATORS:"? This could be used as keyword instead of /// (multiline C-style comments would be required in this case). —Preceding unsigned comment added by 139.20.52.73 (talk) 11:21, 9 July 2010 (UTC)


 * To make it easier and more convenient to parse, Gettext uses "///" to tell whenever to add the comment to the translation file.


 * The "TRANSLATORS:" part is redundant. I think it's here to make a example on a situation on how it might be used for.


 * Take note however that the talk page is to talk about the article only. So don't talk about the subject. Karjam, AKA KarjamP (talk) 11:35, 23 June 2012 (UTC)

Incorrect output for example given
I'm just starting with gettext and the like, but I've noticed that if I run gettext with the options given in the example, i.e. run "xgettext --add-comments=/", then the pot (and po) content will include the leading '/' used as the comment tag. I.e. I get:

#: src/name.c:36 msgid "My name is %s.\n" msgstr ""
 * 1) . / TRANSLATORS: Please leave %s as it is, because it is needed by the program.
 * 2) . / Thank you for contributing to this project.

I have no idea if this is an error here in the article, or if this behaviour may occur for some version(s) of gettext.

It's also the case that, in the case of a continuous set of single-line comments, the tag is only needed on the first single-line, and not on the subsequent lines. Logical, of course, and this means that it's not necessary to add the tag to each line, as in the example (which could imply that it's necessary). You could have:

/// TRANSLATORS: Please leave %s as it is, because it is needed by the program. // Thank you for contributing to this project. printf(_("My name is %s.\n"), my_name);

..for an output of:

#: src/name.c:36 msgid "My name is %s.\n" msgstr ""
 * 1) . / TRANSLATORS: Please leave %s as it is, because it is needed by the program.
 * 2) . Thank you for contributing to this project.

Phylasnier (talk) 17:57, 22 August 2014 (UTC)

The example given in the article("TRANSLATORS: Please leave %s as it is, because it is needed by the program." "Thank you for contributing to this project.") is ridiculous. Nobody will set such a comment. It is best to find a comment from a real life open source project. Otherwise perhaps a comment such as "%s contains the user's name as specified in Setting Dialog" or something like that. Kotz (talk) 08:12, 14 January 2019 (UTC)

When was the first release?
The infobox claims it was 1990, its reference suggests it was 1987, the History-section says “Sun Microsystems implemented the first gettext in 1993.”. --MüffelSchnüffel (talk) 03:23, 7 March 2020 (UTC)