<s>
In	O
computing	O
,	O
gettext	B-Application
is	O
an	O
internationalization	B-General_Concept
and	I-General_Concept
localization	I-General_Concept
(	O
i18n	B-General_Concept
and	I-General_Concept
l10n	I-General_Concept
)	O
system	O
commonly	O
used	O
for	O
writing	O
multilingual	O
programs	O
on	O
Unix-like	B-Operating_System
computer	B-General_Concept
operating	I-General_Concept
systems	I-General_Concept
.	O
</s>
<s>
One	O
of	O
the	O
main	O
benefits	O
of	O
gettext	B-Application
is	O
that	O
it	O
separates	O
programming	O
from	O
translating	O
.	O
</s>
<s>
The	O
most	O
commonly	O
used	O
implementation	O
of	O
gettext	B-Application
is	O
GNU	B-Application
gettext	I-Application
,	O
released	O
by	O
the	B-Application
GNU	I-Application
Project	I-Application
in	O
1995	O
.	O
</s>
<s>
The	O
runtime	O
library	O
is	O
libintl	B-Application
.	O
</s>
<s>
gettext	B-Application
provides	O
an	O
option	O
to	O
use	O
different	O
strings	O
for	O
any	O
number	O
of	O
plural	O
forms	O
of	O
nouns	O
,	O
but	O
this	O
feature	O
has	O
no	O
support	O
for	O
grammatical	O
gender	O
.	O
</s>
<s>
Two	O
proposals	O
were	O
raised	O
in	O
the	O
late	O
1980s	O
,	O
the	O
1988	O
Uniforum	O
gettext	B-Application
and	O
the	O
1989	O
X/Open	O
catgets	O
(	O
XPG-3	O
§	O
5	O
)	O
.	O
</s>
<s>
Sun	O
Microsystems	O
implemented	O
the	O
first	O
gettext	B-Application
in	O
1993	O
.	O
</s>
<s>
The	O
Unix	B-Application
and	O
POSIX	O
developers	O
never	O
really	O
agreed	O
on	O
what	O
kind	O
of	O
interface	O
to	O
use	O
(	O
the	O
other	O
option	O
is	O
the	O
X/Open	O
catgets	O
)	O
,	O
so	O
many	O
C	B-Language
libraries	I-Language
,	O
including	O
glibc	B-Language
,	O
implemented	O
both	O
.	O
</s>
<s>
,	O
whether	O
gettext	B-Application
should	O
be	O
part	O
of	O
POSIX	O
was	O
still	O
a	O
point	O
of	O
debate	O
in	O
the	O
Austin	O
Group	O
,	O
despite	O
the	O
fact	O
that	O
its	O
old	O
foe	O
has	O
already	O
fallen	O
out	O
of	O
use	O
.	O
</s>
<s>
Concerns	O
cited	O
included	O
its	O
dependence	O
on	O
the	O
system-set	O
locale	O
(	O
a	O
global	O
variable	O
subject	O
to	O
multithreading	O
problems	O
)	O
and	O
its	O
support	O
for	O
newer	O
C-language	O
extensions	O
involving	O
wide	O
strings	O
.	O
</s>
<s>
The	B-Application
GNU	I-Application
Project	I-Application
decided	O
that	O
the	O
message-as-key	O
approach	O
of	O
gettext	B-Application
is	O
simpler	O
and	O
more	O
friendly	O
.	O
</s>
<s>
They	O
released	O
GNU	B-Application
gettext	I-Application
,	O
a	O
free	B-Application
software	I-Application
implementation	O
of	O
the	O
system	O
in	O
1995	O
.	O
</s>
<s>
Gettext	B-Application
,	O
GNU	O
or	O
not	O
,	O
has	O
since	O
been	O
ported	O
to	O
many	O
programming	O
languages	O
.	O
</s>
<s>
The	O
simplicity	O
of	O
po	O
and	O
widespread	O
editor	O
support	O
even	O
lead	O
to	O
its	O
adoption	O
in	O
non-program	O
contexts	O
for	O
text	O
documents	O
or	O
as	O
an	O
intermediate	O
between	O
other	O
localization	O
formats	O
,	O
with	O
converters	O
like	O
po4a	O
(	O
po	O
for	O
anything	O
)	O
and	O
Translate	B-Language
Toolkit	I-Language
emerging	O
to	O
provide	O
such	O
a	O
bridge	O
.	O
</s>
<s>
The	O
basic	O
interface	O
of	O
gettext	B-Application
is	O
the	O
function	O
,	O
which	O
accepts	O
a	O
string	O
that	O
the	O
user	O
will	O
see	O
in	O
the	O
original	O
language	O
,	O
usually	O
English	O
.	O
</s>
<s>
To	O
save	O
typing	O
time	O
,	O
and	O
to	O
reduce	O
code	O
clutter	O
,	O
this	O
function	O
is	O
commonly	O
aliased	B-Application
to	O
_	O
:	O
</s>
<s>
gettext( )	O
then	O
uses	O
the	O
supplied	O
strings	O
as	O
keys	O
for	O
looking	O
up	O
translations	O
,	O
and	O
will	O
return	O
the	O
original	O
string	O
when	O
no	O
translation	O
is	O
available	O
.	O
</s>
<s>
This	O
is	O
in	O
contrast	O
to	O
POSIX	O
catgets( )	O
,	O
AmigaOS	B-Application
GetString( )	O
,	O
or	O
Microsoft	B-Application
Windows	I-Application
LoadString( )	O
where	O
a	O
programmatic	O
ID	O
(	O
often	O
an	O
integer	O
)	O
is	O
used	O
.	O
</s>
<s>
To	O
handle	O
the	O
case	O
where	O
the	O
same	O
original-language	O
text	O
can	O
have	O
different	O
meanings	O
,	O
gettext	B-Application
has	O
functions	O
like	O
cgettext( )	O
that	O
accept	O
an	O
additional	O
"	O
context	O
"	O
string	O
.	O
</s>
<s>
The	O
resultant	O
.pot	O
file	O
looks	O
like	O
this	O
with	O
the	O
comment	O
(	O
note	O
that	O
xgettext	O
recognizes	O
the	O
string	O
as	O
a	O
C-language	O
printf	B-Language
format	I-Language
string	I-Language
)	O
:	O
</s>
<s>
In	O
POSIX	O
shell	B-Language
script	I-Language
,	O
gettext	B-Application
provides	O
a	O
gettext.sh	O
library	O
one	O
can	O
include	O
that	O
provides	O
the	O
many	O
same	O
functions	O
gettext	B-Application
provides	O
in	O
similar	O
languages	O
.	O
</s>
<s>
GNU	B-Operating_System
bash	I-Operating_System
also	O
has	O
a	O
simplified	O
construct	O
$	O
"	O
msgid	O
"	O
for	O
the	O
simple	O
gettext	B-Application
function	O
,	O
although	O
it	O
depends	O
on	O
the	O
C	B-Language
library	I-Language
to	O
provide	O
a	O
gettext( )	O
function	O
.	O
</s>
<s>
The	O
translator	O
then	O
edits	O
the	O
resultant	O
file	O
,	O
either	O
by	O
hand	O
or	O
with	O
a	O
translation	O
tool	O
like	O
Poedit	B-Language
,	O
or	O
Emacs	B-Application
with	O
its	O
editing	O
mode	O
for	O
.po	O
files	O
.	O
</s>
<s>
Finally	O
,	O
the	O
.po	O
files	O
are	O
compiled	O
with	O
msgfmt	B-Application
into	O
binary	O
.mo	O
(	O
Machine	O
Object	O
)	O
files	O
.	O
</s>
<s>
GNU	B-Application
gettext	I-Application
may	O
use	O
its	O
own	O
file	O
name	O
extension	O
.gmo	O
on	O
systems	O
with	O
another	O
gettext	B-Application
implementation	O
.	O
</s>
<s>
GNU	O
msgfmt	B-Application
can	O
also	O
perform	O
some	O
checks	O
relevant	O
to	O
the	O
format	B-Language
string	I-Language
used	O
by	O
the	O
programming	O
language	O
.	O
</s>
<s>
The	O
user	O
,	O
on	O
Unix-type	O
systems	O
,	O
sets	O
the	O
environment	O
variable	O
LC_MESSAGES	O
,	O
and	O
the	O
program	O
will	O
display	O
strings	O
in	O
the	O
selected	O
language	O
,	O
if	O
there	O
is	O
an	O
.mo	O
file	O
for	O
it	O
.	O
</s>
<s>
Users	O
on	O
GNU	B-Application
variants	I-Application
can	O
also	O
use	O
the	O
environment	O
variable	O
LANGUAGE	O
instead	O
.	O
</s>
<s>
Its	O
main	O
difference	O
from	O
the	O
Unix	B-Application
variable	O
is	O
that	O
it	O
supports	O
multiple	O
languages	O
,	O
separated	O
with	O
a	O
colon	O
,	O
for	O
fallback	O
.	O
</s>
<s>
As	O
with	O
the	O
convention	O
of	O
gettext( )	O
,	O
it	O
is	O
often	O
aliased	B-Application
to	O
N_	O
in	O
practical	O
use	O
.	O
</s>
<s>
A	O
header	O
in	O
the	O
""	O
(	O
empty	O
string	O
)	O
entry	O
of	O
the	O
PO	O
file	O
stores	O
some	O
metadata	O
,	O
one	O
of	O
which	O
is	O
the	O
plural	O
form	O
that	O
the	O
language	O
uses	O
,	O
usually	O
specified	O
using	O
a	O
C-style	O
ternary	O
operator	O
.	O
</s>
<s>
In	O
addition	O
to	O
C	B-Language
,	O
gettext	B-Application
has	O
the	O
following	O
implementations	O
:	O
C#	B-Application
for	O
both	O
ASP.NET	B-Application
and	O
for	O
WPF	B-Device
,	O
Perl	B-Language
,	O
PHP	B-Application
,	O
Python	B-Language
,	O
R	B-Language
,	O
Scala	B-Application
,	O
and	O
Node.js	B-Language
.	O
</s>
<s>
GNU	B-Application
gettext	I-Application
has	O
native	O
support	O
for	O
Objective-C	O
,	O
but	O
there	O
is	O
no	O
support	O
for	O
the	O
Swift	B-Application
programming	I-Application
language	I-Application
yet	O
.	O
</s>
<s>
A	O
commonly	O
used	O
gettext	B-Application
implementation	O
on	O
these	O
Cocoa	O
platforms	O
is	O
POLocalizedString	O
.	O
</s>
<s>
The	O
Microsoft	O
Outlook	O
for	O
iOS	O
team	O
also	O
provides	O
a	O
LocalizedStringsKit	O
library	O
with	O
a	O
gettext-like	O
API	O
.	O
</s>
