|WikiProject Free Software / Software / Computing|
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
LANGUAGE, 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)
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. --22.214.171.124 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'.
- 126.96.36.199 23:58, 29 October 2007 (UTC)
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. 188.8.131.52 22:47, 21 October 2007 (UTC)
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.
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 184.108.40.206 (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.
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 220.127.116.11 (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:
#. / TRANSLATORS: Please leave %s as it is, because it is needed by the program. #. / Thank you for contributing to this project. #: src/name.c:36 msgid "My name is %s.\n" msgstr ""
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:
#. / TRANSLATORS: Please leave %s as it is, because it is needed by the program. #. Thank you for contributing to this project. #: src/name.c:36 msgid "My name is %s.\n" msgstr ""