🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3812

Re: Example of gettext() program without autoconf

#3812
From: Kalle Olavi Niemitalo
Date: Fri, 12 Jan 2001 12:52
33 lines
2356 bytes
Charlie Zender <zender@uci.edu> writes:

> I could not ever figure out what a PO file is but I know that
> I need one!

A PO file is a human-edited text file which lists original phrases and
their translations to some language.  It is then compiled to a MO file
with the msgfmt program.

To make a PO file, you first generate a POT file by using xgettext on
the program sources and then fill in the blanks.

> What should PACKAGE be? "gettext"?

PACKAGE should be the name of the program which uses gettext; in your
case, it might be "NCO".

> What about LOCALEDIR?

IIRC, it is usually ${datadir}/locale, as in /usr/share/locale.

> Where do I store the translations?

You type them in PO files, which you compile to MO files, which you
install in LOCALEDIR.  You should include the MO files in the source
package so that people can install it without msgfmt.  They'll work on
all architectures; if an OS vendor uses a different format for MO
files, that doesn't matter because they'll be read with the code in
intl/ of your package.

> Where is there a complete example of all this on the net?

I don't know.
Technical Details
Message-ID: <izn66jlc4qb.fsf@iki.fi>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!howland.erols.net!newspharm.inet.tele.dk.MISMATCH!news.tele.dk!194.255.56.67!newsfeed101.telia.com!newsrouter.euroconnect.net!news.clinet.fi!news.cs.hut.fi!newsfeed3.funet.fi!newsfeed2.funet.fi!newsfeeds.funet.fi!ousrvr3.oulu.fi!not-for-mail
References: <3A58033D.1040505@uci.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc89c,6c31fbd9f931131d
X-Google-Attributes: gidfc89c,public
X-Google-Thread: 1025b4,6c31fbd9f931131d
X-Google-Attributes: gid1025b4,public
X-Google-ArrivalTime: 2001-01-12 05:04:03 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!howland.erols.net!newspharm.inet.tele.dk.MISMATCH!news.tele.dk!194.255.56.67!newsfeed101.telia.com!newsrouter.euroconnect.net!news.clinet.fi!news.cs.hut.fi!newsfeed3.funet.fi!newsfeed2.funet.fi!newsfeeds.funet.fi!ousrvr3.oulu.fi!not-for-mail
From: Kalle Olavi Niemitalo <kon@iki.fi>
Newsgroups: comp.unix.programmer,gnu.misc.discuss
Subject: Re: Example of gettext() program without autoconf
Date: 12 Jan 2001 14:52:28 +0200
Organization: University of Oulu, Department of Electrical Engineering, Finland
Lines: 33
Sender: tosi@stekt20
Message-ID: <izn66jlc4qb.fsf@iki.fi>
References: <3A58033D.1040505@uci.edu>
NNTP-Posting-Host: stekt20.oulu.fi
X-Trace: ousrvr3.oulu.fi 979303950 12668 130.231.60.60 (12 Jan 2001 12:52:30 GMT)
X-Complaints-To: news@news.oulu.fi
NNTP-Posting-Date: 12 Jan 2001 12:52:30 GMT
X-URL: http://www.iki.fi/kon/
X-Newsreader: Gnus v5.7/Emacs 20.6