<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://w.arbores.tech/w/index.php?action=history&amp;feed=atom&amp;title=Gettext</id>
	<title>Gettext - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://w.arbores.tech/w/index.php?action=history&amp;feed=atom&amp;title=Gettext"/>
	<link rel="alternate" type="text/html" href="http://w.arbores.tech/w/index.php?title=Gettext&amp;action=history"/>
	<updated>2026-04-11T14:43:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.11</generator>
	<entry>
		<id>http://w.arbores.tech/w/index.php?title=Gettext&amp;diff=16355&amp;oldid=prev</id>
		<title>Daniel K. Schneider: Text replacement - &quot;$&quot; to &quot;
{{edutechwiki}}&quot;</title>
		<link rel="alternate" type="text/html" href="http://w.arbores.tech/w/index.php?title=Gettext&amp;diff=16355&amp;oldid=prev"/>
		<updated>2021-04-10T00:19:42Z</updated>

		<summary type="html">&lt;p&gt;Text replacement - &amp;quot;$&amp;quot; to &amp;quot; {{edutechwiki}}&amp;quot;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:19, 10 April 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l78&quot;&gt;Line 78:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 78:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: Programming]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: Programming]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: Ergonomics and human-computer interaction]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category: Ergonomics and human-computer interaction]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{edutechwiki}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Daniel K. Schneider</name></author>
	</entry>
	<entry>
		<id>http://w.arbores.tech/w/index.php?title=Gettext&amp;diff=15214&amp;oldid=prev</id>
		<title>Daniel K. Schneider: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://w.arbores.tech/w/index.php?title=Gettext&amp;diff=15214&amp;oldid=prev"/>
		<updated>2021-04-09T22:30:42Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:30, 10 April 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Daniel K. Schneider</name></author>
	</entry>
	<entry>
		<id>http://w.arbores.tech/w/index.php?title=Gettext&amp;diff=15213&amp;oldid=prev</id>
		<title>Daniel K. Schneider: using an external editor</title>
		<link rel="alternate" type="text/html" href="http://w.arbores.tech/w/index.php?title=Gettext&amp;diff=15213&amp;oldid=prev"/>
		<updated>2010-01-21T16:12:09Z</updated>

		<summary type="html">&lt;p&gt;using &lt;a href=&quot;/w/index.php?title=Help:External_editors&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Help:External editors (page does not exist)&quot;&gt;an external editor&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Stub}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Gettext&amp;#039;&amp;#039;&amp;#039; is the name of the popular GNU internationalization and localization (i18n) library used in free software. &lt;br /&gt;
&lt;br /&gt;
See also: [[Software localization]].&lt;br /&gt;
&lt;br /&gt;
== Principle ==&lt;br /&gt;
&lt;br /&gt;
Gettext uses the following principle:&lt;br /&gt;
* All source code must use Gettext calls when using strings. (e.g. &amp;#039;&amp;#039;print(&amp;quot;salut&amp;quot;)&amp;#039;&amp;#039; would become &amp;#039;&amp;#039;print (gettext (&amp;quot;salut&amp;quot;)&amp;#039;&amp;#039; or the shorcut &amp;#039;&amp;#039;print (_(&amp;quot;salut&amp;quot;))&amp;#039;&amp;#039;&lt;br /&gt;
* The language used in the code will be the key for all translation languages&lt;br /&gt;
* xgetttext then can extract all these from the source and produce a *.pot template file.&lt;br /&gt;
* This template file then is use to produce editable *.po files that look like this&lt;br /&gt;
 #: src/name.c:36&lt;br /&gt;
 msgid &amp;quot;My name is %s.\n&amp;quot;&lt;br /&gt;
 msgstr &amp;quot;Je m&amp;#039;appelle %s.\n&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Msgid (the key and original language) and msgstr the translated string can be displayd side-by side by so-called PO editors.&lt;br /&gt;
&lt;br /&gt;
Gettext is used in slightly different ways in different languages.&lt;br /&gt;
&lt;br /&gt;
; PHP source code example&lt;br /&gt;
&lt;br /&gt;
(1) Sample code with a string that needs translation&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
echo _(&amp;quot;Hello World!&amp;quot;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(2) Translations then should go a directory, e.g. &amp;#039;&amp;#039;locale&amp;#039;&amp;#039;&lt;br /&gt;
Each locale will sit in its own subdirectory. (more details needed here ..)&lt;br /&gt;
&lt;br /&gt;
(3) Sample code to initialize the run-time localization&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$locale = &amp;quot;de_DE&amp;quot;;&lt;br /&gt;
if (isSet($_GET[&amp;quot;locale&amp;quot;])) $locale = $_GET[&amp;quot;locale&amp;quot;];&lt;br /&gt;
putenv(&amp;quot;LC_ALL=$locale&amp;quot;);&lt;br /&gt;
setlocale(LC_ALL, $locale);&lt;br /&gt;
bindtextdomain(&amp;quot;messages&amp;quot;, &amp;quot;./locale&amp;quot;);&lt;br /&gt;
textdomain(&amp;quot;messages&amp;quot;);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Java&lt;br /&gt;
&lt;br /&gt;
Gettext can be used with the [http://code.google.com/p/gettext-commons/ gettext-commons] library. Java source code modifications rather would look like this:&lt;br /&gt;
 I18n i18n = I18nFactory.getI18n(getClass());&lt;br /&gt;
 System.out.println(i18n.tr(&amp;quot;This text will be translated&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
== Tools ==&lt;br /&gt;
&lt;br /&gt;
There exist several PO editors, e.g.&lt;br /&gt;
&lt;br /&gt;
* [http://translate.sourceforge.net/wiki/virtaal/index Virtaal].&lt;br /&gt;
* [http://www.poedit.net/ Poedit]&lt;br /&gt;
* Some programming editors (like [[emacs]] also have PO support.&lt;br /&gt;
&lt;br /&gt;
Toolkits for localization and translation&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Translate_Toolkit Translate Toolkit] (Wikipedia) can handle PO files.&lt;br /&gt;
&lt;br /&gt;
== Complications ==&lt;br /&gt;
&lt;br /&gt;
* Dealing with arguments&lt;br /&gt;
* Handling plural&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Gettext GNU Gettext] (Wikipedia)&lt;br /&gt;
&lt;br /&gt;
*[http://mel.melaxis.com/devblog/2005/08/06/localizing-php-web-sites-using-gettext/ Localizing PHP web sites using gettext] by Pablo Hoch, 2005.&lt;br /&gt;
&lt;br /&gt;
[[Category: Programming]]&lt;br /&gt;
[[Category: Ergonomics and human-computer interaction]]&lt;/div&gt;</summary>
		<author><name>Daniel K. Schneider</name></author>
	</entry>
</feed>