<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52b
- from gettext.texi on 6 June 2010 -->
+ from gettext.texi on 7 January 2014 -->
<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
<TITLE>GNU gettext utilities - 15 Other Programming Languages</TITLE>
<H2><A NAME="SEC246" HREF="gettext_toc.html#TOC246">15.1 The Language Implementor's View</A></H2>
<P>
-<A NAME="IDX1170"></A>
-<A NAME="IDX1171"></A>
+<A NAME="IDX1178"></A>
+<A NAME="IDX1179"></A>
</P>
<P>
</P>
<P>
-<A NAME="IDX1172"></A>
-<A NAME="IDX1173"></A>
+<A NAME="IDX1180"></A>
+<A NAME="IDX1181"></A>
As a special feature for Farsi (Persian) and maybe Arabic, translators can
insert an <SAMP>‘I’</SAMP> flag into numeric format directives. For example, the
translation of <CODE>"%d"</CODE> can be <CODE>"%Id"</CODE>. The effect of this flag,
<H3><A NAME="SEC252" HREF="gettext_toc.html#TOC252">15.3.4 Python Format Strings</A></H3>
<P>
-Python format strings are described in
+There are two kinds of format strings in Python: those acceptable to
+the Python built-in format operator <CODE>%</CODE>, labelled as
+<SAMP>‘python-format’</SAMP>, and those acceptable to the <CODE>format</CODE> method
+of the <SAMP>‘str’</SAMP> object.
+
+</P>
+<P>
+Python <CODE>%</CODE> format strings are described in
Python Library reference /
2. Built-in Types, Exceptions and Functions /
2.2. Built-in Types /
<A HREF="http://www.python.org/doc/2.2.1/lib/typesseq-strings.html">http://www.python.org/doc/2.2.1/lib/typesseq-strings.html</A>.
</P>
+<P>
+Python brace format strings are described in PEP 3101 -- Advanced
+String Formatting, <A HREF="http://www.python.org/dev/peps/pep-3101/">http://www.python.org/dev/peps/pep-3101/</A>.
+
+</P>
<H3><A NAME="SEC253" HREF="gettext_toc.html#TOC253">15.3.5 Lisp Format Strings</A></H3>
</P>
-<H2><A NAME="SEC272" HREF="gettext_toc.html#TOC272">15.4 The Maintainer's View</A></H2>
+<H3><A NAME="SEC272" HREF="gettext_toc.html#TOC272">15.3.24 Lua Format Strings</A></H3>
+
+<P>
+Lua format strings are described in the Lua reference manual, section String Manipulation,
+<A HREF="http://www.lua.org/manual/5.1/manual.html#pdf-string.format">http://www.lua.org/manual/5.1/manual.html#pdf-string.format</A>.
+
+</P>
+
+
+<H3><A NAME="SEC273" HREF="gettext_toc.html#TOC273">15.3.25 JavaScript Format Strings</A></H3>
+
+<P>
+Although JavaScript specification itself does not define any format
+strings, many JavaScript implementations provide printf-like
+functions. <CODE>xgettext</CODE> understands a set of common format strings
+used in popular JavaScript implementations including Gjs, Seed, and
+Node.JS. In such a format string, a directive starts with <SAMP>‘%’</SAMP>
+and is finished by a specifier: <SAMP>‘%’</SAMP> denotes a literal percent
+sign, <SAMP>‘c’</SAMP> denotes a character, <SAMP>‘s’</SAMP> denotes a string,
+<SAMP>‘b’</SAMP>, <SAMP>‘d’</SAMP>, <SAMP>‘o’</SAMP>, <SAMP>‘x’</SAMP>, <SAMP>‘X’</SAMP> denote an integer,
+<SAMP>‘f’</SAMP> denotes floating-point number, <SAMP>‘j’</SAMP> denotes a JSON
+object.
+
+</P>
+
+
+
+<H2><A NAME="SEC274" HREF="gettext_toc.html#TOC274">15.4 The Maintainer's View</A></H2>
<P>
For the maintainer, the general procedure differs from the C language
-<H2><A NAME="SEC273" HREF="gettext_toc.html#TOC273">15.5 Individual Programming Languages</A></H2>
+<H2><A NAME="SEC275" HREF="gettext_toc.html#TOC275">15.5 Individual Programming Languages</A></H2>
-<H3><A NAME="SEC274" HREF="gettext_toc.html#TOC274">15.5.1 C, C++, Objective C</A></H3>
+<H3><A NAME="SEC276" HREF="gettext_toc.html#TOC276">15.5.1 C, C++, Objective C</A></H3>
<P>
-<A NAME="IDX1174"></A>
+<A NAME="IDX1182"></A>
</P>
<DL COMPACT>
</P>
-<H3><A NAME="SEC275" HREF="gettext_toc.html#TOC275">15.5.2 sh - Shell Script</A></H3>
+<H3><A NAME="SEC277" HREF="gettext_toc.html#TOC277">15.5.2 sh - Shell Script</A></H3>
<P>
-<A NAME="IDX1175"></A>
+<A NAME="IDX1183"></A>
</P>
<DL COMPACT>
<DT>gettext/ngettext functions
<DD>
-<A NAME="IDX1176"></A>
-<A NAME="IDX1177"></A>
+<A NAME="IDX1184"></A>
+<A NAME="IDX1185"></A>
<CODE>gettext</CODE>, <CODE>ngettext</CODE> programs
<BR><CODE>eval_gettext</CODE>, <CODE>eval_ngettext</CODE> shell functions
<DT>textdomain
<DD>
-<A NAME="IDX1178"></A>
+<A NAME="IDX1186"></A>
environment variable <CODE>TEXTDOMAIN</CODE>
<DT>bindtextdomain
<DD>
-<A NAME="IDX1179"></A>
+<A NAME="IDX1187"></A>
environment variable <CODE>TEXTDOMAINDIR</CODE>
<DT>setlocale
-<H4><A NAME="SEC276" HREF="gettext_toc.html#TOC276">15.5.2.1 Preparing Shell Scripts for Internationalization</A></H4>
+<H4><A NAME="SEC278" HREF="gettext_toc.html#TOC278">15.5.2.1 Preparing Shell Scripts for Internationalization</A></H4>
<P>
-<A NAME="IDX1180"></A>
+<A NAME="IDX1188"></A>
</P>
<P>
near the top of the script. <CODE>gettext.sh</CODE> is a shell function library
that provides the functions
-<CODE>eval_gettext</CODE> (see section <A HREF="gettext_15.html#SEC281">15.5.2.6 Invoking the <CODE>eval_gettext</CODE> function</A>) and
-<CODE>eval_ngettext</CODE> (see section <A HREF="gettext_15.html#SEC282">15.5.2.7 Invoking the <CODE>eval_ngettext</CODE> function</A>).
+<CODE>eval_gettext</CODE> (see section <A HREF="gettext_15.html#SEC283">15.5.2.6 Invoking the <CODE>eval_gettext</CODE> function</A>) and
+<CODE>eval_ngettext</CODE> (see section <A HREF="gettext_15.html#SEC284">15.5.2.7 Invoking the <CODE>eval_ngettext</CODE> function</A>).
You have to ensure that <CODE>gettext.sh</CODE> can be found in the <CODE>PATH</CODE>.
<LI>
-<H4><A NAME="SEC277" HREF="gettext_toc.html#TOC277">15.5.2.2 Contents of <CODE>gettext.sh</CODE></A></H4>
+<H4><A NAME="SEC279" HREF="gettext_toc.html#TOC279">15.5.2.2 Contents of <CODE>gettext.sh</CODE></A></H4>
<P>
<CODE>gettext.sh</CODE>, contained in the run-time package of GNU gettext, provides
<LI>eval_gettext
-See section <A HREF="gettext_15.html#SEC281">15.5.2.6 Invoking the <CODE>eval_gettext</CODE> function</A>.
+See section <A HREF="gettext_15.html#SEC283">15.5.2.6 Invoking the <CODE>eval_gettext</CODE> function</A>.
<LI>eval_ngettext
-See section <A HREF="gettext_15.html#SEC282">15.5.2.7 Invoking the <CODE>eval_ngettext</CODE> function</A>.
+See section <A HREF="gettext_15.html#SEC284">15.5.2.7 Invoking the <CODE>eval_ngettext</CODE> function</A>.
</UL>
-<H4><A NAME="SEC278" HREF="gettext_toc.html#TOC278">15.5.2.3 Invoking the <CODE>gettext</CODE> program</A></H4>
+<H4><A NAME="SEC280" HREF="gettext_toc.html#TOC280">15.5.2.3 Invoking the <CODE>gettext</CODE> program</A></H4>
<P>
-<A NAME="IDX1181"></A>
-<A NAME="IDX1182"></A>
+<A NAME="IDX1189"></A>
+<A NAME="IDX1190"></A>
<PRE>
gettext [<VAR>option</VAR>] [[<VAR>textdomain</VAR>] <VAR>msgid</VAR>]
</PRE>
<P>
-<A NAME="IDX1183"></A>
+<A NAME="IDX1191"></A>
The <CODE>gettext</CODE> program displays the native language translation of a
textual message.
<DD>
<DT><SAMP>‘--domain=<VAR>textdomain</VAR>’</SAMP>
<DD>
-<A NAME="IDX1184"></A>
-<A NAME="IDX1185"></A>
+<A NAME="IDX1192"></A>
+<A NAME="IDX1193"></A>
Retrieve translated messages from <VAR>textdomain</VAR>. Usually a <VAR>textdomain</VAR>
corresponds to a package, a program, or a module of a program.
<DT><SAMP>‘-e’</SAMP>
<DD>
-<A NAME="IDX1186"></A>
+<A NAME="IDX1194"></A>
Enable expansion of some escape sequences. This option is for compatibility
with the <SAMP>‘echo’</SAMP> program or shell built-in. The escape sequences
<SAMP>‘\a’</SAMP>, <SAMP>‘\b’</SAMP>, <SAMP>‘\c’</SAMP>, <SAMP>‘\f’</SAMP>, <SAMP>‘\n’</SAMP>, <SAMP>‘\r’</SAMP>, <SAMP>‘\t’</SAMP>,
<DT><SAMP>‘-E’</SAMP>
<DD>
-<A NAME="IDX1187"></A>
+<A NAME="IDX1195"></A>
This option is only for compatibility with the <SAMP>‘echo’</SAMP> program or shell
built-in. It has no effect.
<DD>
<DT><SAMP>‘--help’</SAMP>
<DD>
-<A NAME="IDX1188"></A>
-<A NAME="IDX1189"></A>
+<A NAME="IDX1196"></A>
+<A NAME="IDX1197"></A>
Display this help and exit.
<DT><SAMP>‘-n’</SAMP>
<DD>
-<A NAME="IDX1190"></A>
+<A NAME="IDX1198"></A>
Suppress trailing newline. By default, <CODE>gettext</CODE> adds a newline to
the output.
<DD>
<DT><SAMP>‘--version’</SAMP>
<DD>
-<A NAME="IDX1191"></A>
-<A NAME="IDX1192"></A>
+<A NAME="IDX1199"></A>
+<A NAME="IDX1200"></A>
Output version information and exit.
<DT><SAMP>‘[<VAR>textdomain</VAR>] <VAR>msgid</VAR>’</SAMP>
</P>
-<H4><A NAME="SEC279" HREF="gettext_toc.html#TOC279">15.5.2.4 Invoking the <CODE>ngettext</CODE> program</A></H4>
+<H4><A NAME="SEC281" HREF="gettext_toc.html#TOC281">15.5.2.4 Invoking the <CODE>ngettext</CODE> program</A></H4>
<P>
-<A NAME="IDX1193"></A>
-<A NAME="IDX1194"></A>
+<A NAME="IDX1201"></A>
+<A NAME="IDX1202"></A>
<PRE>
ngettext [<VAR>option</VAR>] [<VAR>textdomain</VAR>] <VAR>msgid</VAR> <VAR>msgid-plural</VAR> <VAR>count</VAR>
</PRE>
<P>
-<A NAME="IDX1195"></A>
+<A NAME="IDX1203"></A>
The <CODE>ngettext</CODE> program displays the native language translation of a
textual message whose grammatical form depends on a number.
<DD>
<DT><SAMP>‘--domain=<VAR>textdomain</VAR>’</SAMP>
<DD>
-<A NAME="IDX1196"></A>
-<A NAME="IDX1197"></A>
+<A NAME="IDX1204"></A>
+<A NAME="IDX1205"></A>
Retrieve translated messages from <VAR>textdomain</VAR>. Usually a <VAR>textdomain</VAR>
corresponds to a package, a program, or a module of a program.
<DT><SAMP>‘-e’</SAMP>
<DD>
-<A NAME="IDX1198"></A>
+<A NAME="IDX1206"></A>
Enable expansion of some escape sequences. This option is for compatibility
with the <SAMP>‘gettext’</SAMP> program. The escape sequences
<SAMP>‘\a’</SAMP>, <SAMP>‘\b’</SAMP>, <SAMP>‘\c’</SAMP>, <SAMP>‘\f’</SAMP>, <SAMP>‘\n’</SAMP>, <SAMP>‘\r’</SAMP>, <SAMP>‘\t’</SAMP>,
<DT><SAMP>‘-E’</SAMP>
<DD>
-<A NAME="IDX1199"></A>
+<A NAME="IDX1207"></A>
This option is only for compatibility with the <SAMP>‘gettext’</SAMP> program. It has
no effect.
<DD>
<DT><SAMP>‘--help’</SAMP>
<DD>
-<A NAME="IDX1200"></A>
-<A NAME="IDX1201"></A>
+<A NAME="IDX1208"></A>
+<A NAME="IDX1209"></A>
Display this help and exit.
<DT><SAMP>‘-V’</SAMP>
<DD>
<DT><SAMP>‘--version’</SAMP>
<DD>
-<A NAME="IDX1202"></A>
-<A NAME="IDX1203"></A>
+<A NAME="IDX1210"></A>
+<A NAME="IDX1211"></A>
Output version information and exit.
<DT><SAMP>‘<VAR>textdomain</VAR>’</SAMP>
</P>
-<H4><A NAME="SEC280" HREF="gettext_toc.html#TOC280">15.5.2.5 Invoking the <CODE>envsubst</CODE> program</A></H4>
+<H4><A NAME="SEC282" HREF="gettext_toc.html#TOC282">15.5.2.5 Invoking the <CODE>envsubst</CODE> program</A></H4>
<P>
-<A NAME="IDX1204"></A>
-<A NAME="IDX1205"></A>
+<A NAME="IDX1212"></A>
+<A NAME="IDX1213"></A>
<PRE>
envsubst [<VAR>option</VAR>] [<VAR>shell-format</VAR>]
</PRE>
<P>
-<A NAME="IDX1206"></A>
-<A NAME="IDX1207"></A>
-<A NAME="IDX1208"></A>
+<A NAME="IDX1214"></A>
+<A NAME="IDX1215"></A>
+<A NAME="IDX1216"></A>
The <CODE>envsubst</CODE> program substitutes the values of environment variables.
</P>
<DD>
<DT><SAMP>‘--variables’</SAMP>
<DD>
-<A NAME="IDX1209"></A>
-<A NAME="IDX1210"></A>
+<A NAME="IDX1217"></A>
+<A NAME="IDX1218"></A>
Output the variables occurring in <VAR>shell-format</VAR>.
</DL>
<DD>
<DT><SAMP>‘--help’</SAMP>
<DD>
-<A NAME="IDX1211"></A>
-<A NAME="IDX1212"></A>
+<A NAME="IDX1219"></A>
+<A NAME="IDX1220"></A>
Display this help and exit.
<DT><SAMP>‘-V’</SAMP>
<DD>
<DT><SAMP>‘--version’</SAMP>
<DD>
-<A NAME="IDX1213"></A>
-<A NAME="IDX1214"></A>
+<A NAME="IDX1221"></A>
+<A NAME="IDX1222"></A>
Output version information and exit.
</DL>
</P>
-<H4><A NAME="SEC281" HREF="gettext_toc.html#TOC281">15.5.2.6 Invoking the <CODE>eval_gettext</CODE> function</A></H4>
+<H4><A NAME="SEC283" HREF="gettext_toc.html#TOC283">15.5.2.6 Invoking the <CODE>eval_gettext</CODE> function</A></H4>
<P>
-<A NAME="IDX1215"></A>
+<A NAME="IDX1223"></A>
<PRE>
eval_gettext <VAR>msgid</VAR>
</PRE>
<P>
-<A NAME="IDX1216"></A>
+<A NAME="IDX1224"></A>
This function outputs the native language translation of a textual message,
performing dollar-substitution on the result. Note that only shell variables
mentioned in <VAR>msgid</VAR> will be dollar-substituted in the result.
</P>
-<H4><A NAME="SEC282" HREF="gettext_toc.html#TOC282">15.5.2.7 Invoking the <CODE>eval_ngettext</CODE> function</A></H4>
+<H4><A NAME="SEC284" HREF="gettext_toc.html#TOC284">15.5.2.7 Invoking the <CODE>eval_ngettext</CODE> function</A></H4>
<P>
-<A NAME="IDX1217"></A>
+<A NAME="IDX1225"></A>
<PRE>
eval_ngettext <VAR>msgid</VAR> <VAR>msgid-plural</VAR> <VAR>count</VAR>
</PRE>
<P>
-<A NAME="IDX1218"></A>
+<A NAME="IDX1226"></A>
This function outputs the native language translation of a textual message
whose grammatical form depends on a number, performing dollar-substitution
on the result. Note that only shell variables mentioned in <VAR>msgid</VAR> or
</P>
-<H3><A NAME="SEC283" HREF="gettext_toc.html#TOC283">15.5.3 bash - Bourne-Again Shell Script</A></H3>
+<H3><A NAME="SEC285" HREF="gettext_toc.html#TOC285">15.5.3 bash - Bourne-Again Shell Script</A></H3>
<P>
-<A NAME="IDX1219"></A>
+<A NAME="IDX1227"></A>
</P>
<P>
</P>
-<H3><A NAME="SEC284" HREF="gettext_toc.html#TOC284">15.5.4 Python</A></H3>
+<H3><A NAME="SEC286" HREF="gettext_toc.html#TOC286">15.5.4 Python</A></H3>
<P>
-<A NAME="IDX1220"></A>
+<A NAME="IDX1228"></A>
</P>
<DL COMPACT>
-<H3><A NAME="SEC285" HREF="gettext_toc.html#TOC285">15.5.5 GNU clisp - Common Lisp</A></H3>
+<H3><A NAME="SEC287" HREF="gettext_toc.html#TOC287">15.5.5 GNU clisp - Common Lisp</A></H3>
<P>
-<A NAME="IDX1221"></A>
-<A NAME="IDX1222"></A>
-<A NAME="IDX1223"></A>
+<A NAME="IDX1229"></A>
+<A NAME="IDX1230"></A>
+<A NAME="IDX1231"></A>
</P>
<DL COMPACT>
</P>
-<H3><A NAME="SEC286" HREF="gettext_toc.html#TOC286">15.5.6 GNU clisp C sources</A></H3>
+<H3><A NAME="SEC288" HREF="gettext_toc.html#TOC288">15.5.6 GNU clisp C sources</A></H3>
<P>
-<A NAME="IDX1224"></A>
+<A NAME="IDX1232"></A>
</P>
<DL COMPACT>
-<H3><A NAME="SEC287" HREF="gettext_toc.html#TOC287">15.5.7 Emacs Lisp</A></H3>
+<H3><A NAME="SEC289" HREF="gettext_toc.html#TOC289">15.5.7 Emacs Lisp</A></H3>
<P>
-<A NAME="IDX1225"></A>
+<A NAME="IDX1233"></A>
</P>
<DL COMPACT>
-<H3><A NAME="SEC288" HREF="gettext_toc.html#TOC288">15.5.8 librep</A></H3>
+<H3><A NAME="SEC290" HREF="gettext_toc.html#TOC290">15.5.8 librep</A></H3>
<P>
-<A NAME="IDX1226"></A>
+<A NAME="IDX1234"></A>
</P>
<DL COMPACT>
</P>
-<H3><A NAME="SEC289" HREF="gettext_toc.html#TOC289">15.5.9 GNU guile - Scheme</A></H3>
+<H3><A NAME="SEC291" HREF="gettext_toc.html#TOC291">15.5.9 GNU guile - Scheme</A></H3>
<P>
-<A NAME="IDX1227"></A>
-<A NAME="IDX1228"></A>
+<A NAME="IDX1235"></A>
+<A NAME="IDX1236"></A>
</P>
<DL COMPACT>
</P>
-<H3><A NAME="SEC290" HREF="gettext_toc.html#TOC290">15.5.10 GNU Smalltalk</A></H3>
+<H3><A NAME="SEC292" HREF="gettext_toc.html#TOC292">15.5.10 GNU Smalltalk</A></H3>
<P>
-<A NAME="IDX1229"></A>
+<A NAME="IDX1237"></A>
</P>
<DL COMPACT>
</P>
-<H3><A NAME="SEC291" HREF="gettext_toc.html#TOC291">15.5.11 Java</A></H3>
+<H3><A NAME="SEC293" HREF="gettext_toc.html#TOC293">15.5.11 Java</A></H3>
<P>
-<A NAME="IDX1230"></A>
+<A NAME="IDX1238"></A>
</P>
<DL COMPACT>
handling and the <CODE>pgettext</CODE> and <CODE>npgettext</CODE> for strings constraint
to a particular context.
-<A NAME="IDX1231"></A>
+<A NAME="IDX1239"></A>
To use this API, one needs the <CODE>libintl.jar</CODE> file which is part of
the GNU gettext package and distributed under the LGPL.
</OL>
</P>
-<H3><A NAME="SEC292" HREF="gettext_toc.html#TOC292">15.5.12 C#</A></H3>
+<H3><A NAME="SEC294" HREF="gettext_toc.html#TOC294">15.5.12 C#</A></H3>
<P>
-<A NAME="IDX1232"></A>
+<A NAME="IDX1240"></A>
</P>
<DL COMPACT>
specific to a particular context, with plural handling, like the
<CODE>npgettext</CODE> function in C.
-<A NAME="IDX1233"></A>
+<A NAME="IDX1241"></A>
To use this API, one needs the <CODE>GNU.Gettext.dll</CODE> file which is part of
the GNU gettext package and distributed under the LGPL.
</OL>
</P>
-<H3><A NAME="SEC293" HREF="gettext_toc.html#TOC293">15.5.13 GNU awk</A></H3>
+<H3><A NAME="SEC295" HREF="gettext_toc.html#TOC295">15.5.13 GNU awk</A></H3>
<P>
-<A NAME="IDX1234"></A>
-<A NAME="IDX1235"></A>
+<A NAME="IDX1242"></A>
+<A NAME="IDX1243"></A>
</P>
<DL COMPACT>
</P>
-<H3><A NAME="SEC294" HREF="gettext_toc.html#TOC294">15.5.14 Pascal - Free Pascal Compiler</A></H3>
+<H3><A NAME="SEC296" HREF="gettext_toc.html#TOC296">15.5.14 Pascal - Free Pascal Compiler</A></H3>
<P>
-<A NAME="IDX1236"></A>
-<A NAME="IDX1237"></A>
-<A NAME="IDX1238"></A>
+<A NAME="IDX1244"></A>
+<A NAME="IDX1245"></A>
+<A NAME="IDX1246"></A>
</P>
<DL COMPACT>
</P>
-<H3><A NAME="SEC295" HREF="gettext_toc.html#TOC295">15.5.15 wxWidgets library</A></H3>
+<H3><A NAME="SEC297" HREF="gettext_toc.html#TOC297">15.5.15 wxWidgets library</A></H3>
<P>
-<A NAME="IDX1239"></A>
+<A NAME="IDX1247"></A>
</P>
<DL COMPACT>
-<H3><A NAME="SEC296" HREF="gettext_toc.html#TOC296">15.5.16 YCP - YaST2 scripting language</A></H3>
+<H3><A NAME="SEC298" HREF="gettext_toc.html#TOC298">15.5.16 YCP - YaST2 scripting language</A></H3>
<P>
-<A NAME="IDX1240"></A>
-<A NAME="IDX1241"></A>
+<A NAME="IDX1248"></A>
+<A NAME="IDX1249"></A>
</P>
<DL COMPACT>
</P>
-<H3><A NAME="SEC297" HREF="gettext_toc.html#TOC297">15.5.17 Tcl - Tk's scripting language</A></H3>
+<H3><A NAME="SEC299" HREF="gettext_toc.html#TOC299">15.5.17 Tcl - Tk's scripting language</A></H3>
<P>
-<A NAME="IDX1242"></A>
-<A NAME="IDX1243"></A>
+<A NAME="IDX1250"></A>
+<A NAME="IDX1251"></A>
</P>
<DL COMPACT>
</P>
-<H3><A NAME="SEC298" HREF="gettext_toc.html#TOC298">15.5.18 Perl</A></H3>
+<H3><A NAME="SEC300" HREF="gettext_toc.html#TOC300">15.5.18 Perl</A></H3>
<P>
-<A NAME="IDX1244"></A>
+<A NAME="IDX1252"></A>
</P>
<DL COMPACT>
<DT>File extension
<DD>
-<CODE>pl</CODE>, <CODE>PL</CODE>, <CODE>pm</CODE>, <CODE>cgi</CODE>
+<CODE>pl</CODE>, <CODE>PL</CODE>, <CODE>pm</CODE>, <CODE>perl</CODE>, <CODE>cgi</CODE>
<DT>String syntax
<DD>
</P>
<P>
-<A NAME="IDX1245"></A>
+<A NAME="IDX1253"></A>
</P>
<P>
-<H4><A NAME="SEC299" HREF="gettext_toc.html#TOC299">15.5.18.1 General Problems Parsing Perl Code</A></H4>
+<H4><A NAME="SEC301" HREF="gettext_toc.html#TOC301">15.5.18.1 General Problems Parsing Perl Code</A></H4>
<P>
It is often heard that only Perl can parse Perl. This is not true.
</P>
-<H4><A NAME="SEC300" HREF="gettext_toc.html#TOC300">15.5.18.2 Which keywords will xgettext look for?</A></H4>
+<H4><A NAME="SEC302" HREF="gettext_toc.html#TOC302">15.5.18.2 Which keywords will xgettext look for?</A></H4>
<P>
-<A NAME="IDX1246"></A>
+<A NAME="IDX1254"></A>
</P>
<P>
-<H4><A NAME="SEC301" HREF="gettext_toc.html#TOC301">15.5.18.3 How to Extract Hash Keys</A></H4>
+<H4><A NAME="SEC303" HREF="gettext_toc.html#TOC303">15.5.18.3 How to Extract Hash Keys</A></H4>
<P>
-<A NAME="IDX1247"></A>
+<A NAME="IDX1255"></A>
</P>
<P>
</P>
-<H4><A NAME="SEC302" HREF="gettext_toc.html#TOC302">15.5.18.4 What are Strings And Quote-like Expressions?</A></H4>
+<H4><A NAME="SEC304" HREF="gettext_toc.html#TOC304">15.5.18.4 What are Strings And Quote-like Expressions?</A></H4>
<P>
-<A NAME="IDX1248"></A>
+<A NAME="IDX1256"></A>
</P>
<P>
-<H4><A NAME="SEC303" HREF="gettext_toc.html#TOC303">15.5.18.5 Invalid Uses Of String Interpolation</A></H4>
+<H4><A NAME="SEC305" HREF="gettext_toc.html#TOC305">15.5.18.5 Invalid Uses Of String Interpolation</A></H4>
<P>
-<A NAME="IDX1249"></A>
+<A NAME="IDX1257"></A>
</P>
<P>
</P>
-<H4><A NAME="SEC304" HREF="gettext_toc.html#TOC304">15.5.18.6 Valid Uses Of String Interpolation</A></H4>
+<H4><A NAME="SEC306" HREF="gettext_toc.html#TOC306">15.5.18.6 Valid Uses Of String Interpolation</A></H4>
<P>
-<A NAME="IDX1250"></A>
+<A NAME="IDX1258"></A>
</P>
<P>
-<H4><A NAME="SEC305" HREF="gettext_toc.html#TOC305">15.5.18.7 When To Use Parentheses</A></H4>
+<H4><A NAME="SEC307" HREF="gettext_toc.html#TOC307">15.5.18.7 When To Use Parentheses</A></H4>
<P>
-<A NAME="IDX1251"></A>
+<A NAME="IDX1259"></A>
</P>
<P>
-<H4><A NAME="SEC306" HREF="gettext_toc.html#TOC306">15.5.18.8 How To Grok with Long Lines</A></H4>
+<H4><A NAME="SEC308" HREF="gettext_toc.html#TOC308">15.5.18.8 How To Grok with Long Lines</A></H4>
<P>
-<A NAME="IDX1252"></A>
+<A NAME="IDX1260"></A>
</P>
<P>
</P>
-<H4><A NAME="SEC307" HREF="gettext_toc.html#TOC307">15.5.18.9 Bugs, Pitfalls, And Things That Do Not Work</A></H4>
+<H4><A NAME="SEC309" HREF="gettext_toc.html#TOC309">15.5.18.9 Bugs, Pitfalls, And Things That Do Not Work</A></H4>
<P>
-<A NAME="IDX1253"></A>
+<A NAME="IDX1261"></A>
</P>
<P>
</P>
-<H3><A NAME="SEC308" HREF="gettext_toc.html#TOC308">15.5.19 PHP Hypertext Preprocessor</A></H3>
+<H3><A NAME="SEC310" HREF="gettext_toc.html#TOC310">15.5.19 PHP Hypertext Preprocessor</A></H3>
<P>
-<A NAME="IDX1254"></A>
+<A NAME="IDX1262"></A>
</P>
<DL COMPACT>
</P>
-<H3><A NAME="SEC309" HREF="gettext_toc.html#TOC309">15.5.20 Pike</A></H3>
+<H3><A NAME="SEC311" HREF="gettext_toc.html#TOC311">15.5.20 Pike</A></H3>
<P>
-<A NAME="IDX1255"></A>
+<A NAME="IDX1263"></A>
</P>
<DL COMPACT>
-<H3><A NAME="SEC310" HREF="gettext_toc.html#TOC310">15.5.21 GNU Compiler Collection sources</A></H3>
+<H3><A NAME="SEC312" HREF="gettext_toc.html#TOC312">15.5.21 GNU Compiler Collection sources</A></H3>
<P>
-<A NAME="IDX1256"></A>
+<A NAME="IDX1264"></A>
</P>
<DL COMPACT>
-<H2><A NAME="SEC311" HREF="gettext_toc.html#TOC311">15.6 Internationalizable Data</A></H2>
+<H3><A NAME="SEC313" HREF="gettext_toc.html#TOC313">15.5.22 Lua</A></H3>
+
+<DL COMPACT>
+
+<DT>RPMs
+<DD>
+lua
+
+<DT>File extension
+<DD>
+<CODE>lua</CODE>
+
+<DT>String syntax
+<DD>
+
+<UL>
+
+<LI><CODE>"abc"</CODE>
+
+<LI><CODE>'abc'</CODE>
+
+<LI><CODE>[[abc]]</CODE>
+
+<LI><CODE>[=[abc]=]</CODE>
+
+<LI><CODE>[==[abc]==]</CODE>
+
+<LI>...
+
+</UL>
+
+<DT>gettext shorthand
+<DD>
+<CODE>_("abc")</CODE>
+
+<DT>gettext/ngettext functions
+<DD>
+<CODE>gettext.gettext</CODE>, <CODE>gettext.dgettext</CODE>, <CODE>gettext.dcgettext</CODE>,
+<CODE>gettext.ngettext</CODE>, <CODE>gettext.dngettext</CODE>, <CODE>gettext.dcngettext</CODE>
+
+<DT>textdomain
+<DD>
+<CODE>textdomain</CODE> function
+
+<DT>bindtextdomain
+<DD>
+<CODE>bindtextdomain</CODE> function
+
+<DT>setlocale
+<DD>
+automatic
+
+<DT>Prerequisite
+<DD>
+<CODE>require 'gettext'</CODE> or running lua interpreter with <CODE>-l gettext</CODE> option
+
+<DT>Use or emulate GNU gettext
+<DD>
+use
+
+<DT>Extractor
+<DD>
+<CODE>xgettext</CODE>
+
+<DT>Formatting with positions
+<DD>
+---
+
+<DT>Portability
+<DD>
+On platforms without gettext, the functions are not available.
+
+<DT>po-mode marking
+<DD>
+---
+</DL>
+
+
+
+<H3><A NAME="SEC314" HREF="gettext_toc.html#TOC314">15.5.23 JavaScript</A></H3>
+
+<DL COMPACT>
+
+<DT>RPMs
+<DD>
+js
+
+<DT>File extension
+<DD>
+<CODE>js</CODE>
+
+<DT>String syntax
+<DD>
+
+<UL>
+
+<LI><CODE>"abc"</CODE>
+
+<LI><CODE>'abc'</CODE>
+
+</UL>
+
+<DT>gettext shorthand
+<DD>
+<CODE>_("abc")</CODE>
+
+<DT>gettext/ngettext functions
+<DD>
+<CODE>gettext</CODE>, <CODE>dgettext</CODE>, <CODE>dcgettext</CODE>, <CODE>ngettext</CODE>,
+<CODE>dngettext</CODE>
+
+<DT>textdomain
+<DD>
+<CODE>textdomain</CODE> function
+
+<DT>bindtextdomain
+<DD>
+<CODE>bindtextdomain</CODE> function
+
+<DT>setlocale
+<DD>
+automatic
+
+<DT>Prerequisite
+<DD>
+---
+
+<DT>Use or emulate GNU gettext
+<DD>
+use, or emulate
+
+<DT>Extractor
+<DD>
+<CODE>xgettext</CODE>
+
+<DT>Formatting with positions
+<DD>
+---
+
+<DT>Portability
+<DD>
+On platforms without gettext, the functions are not available.
+
+<DT>po-mode marking
+<DD>
+---
+</DL>
+
+
+
+<H2><A NAME="SEC315" HREF="gettext_toc.html#TOC315">15.6 Internationalizable Data</A></H2>
<P>
Here is a list of other data formats which can be internationalized
-<H3><A NAME="SEC312" HREF="gettext_toc.html#TOC312">15.6.1 POT - Portable Object Template</A></H3>
+<H3><A NAME="SEC316" HREF="gettext_toc.html#TOC316">15.6.1 POT - Portable Object Template</A></H3>
<DL COMPACT>
-<H3><A NAME="SEC313" HREF="gettext_toc.html#TOC313">15.6.2 Resource String Table</A></H3>
+<H3><A NAME="SEC317" HREF="gettext_toc.html#TOC317">15.6.2 Resource String Table</A></H3>
<P>
-<A NAME="IDX1257"></A>
+<A NAME="IDX1265"></A>
</P>
<DL COMPACT>
-<H3><A NAME="SEC314" HREF="gettext_toc.html#TOC314">15.6.3 Glade - GNOME user interface description</A></H3>
+<H3><A NAME="SEC318" HREF="gettext_toc.html#TOC318">15.6.3 Glade - GNOME user interface description</A></H3>
<DL COMPACT>
<DT>File extension
<DD>
-<CODE>glade</CODE>, <CODE>glade2</CODE>
+<CODE>glade</CODE>, <CODE>glade2</CODE>, <CODE>ui</CODE>
<DT>Extractor
<DD>