<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gustavo on Information Technology &#187; Internationalization</title>
	<atom:link href="http://gustavonarea.net/blog/tags/internationalization/feed/" rel="self" type="application/rss+xml" />
	<link>http://gustavonarea.net</link>
	<description>Just a social techie</description>
	<lastBuildDate>Tue, 20 Jul 2010 20:47:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A silly yet killer feature in Poliglota</title>
		<link>http://gustavonarea.net/blog/posts/a-silly-yet-killer-feature-in-poliglota/</link>
		<comments>http://gustavonarea.net/blog/posts/a-silly-yet-killer-feature-in-poliglota/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 23:02:46 +0000</pubDate>
		<dc:creator>Gustavo</dc:creator>
				<category><![CDATA[GNU/Linux Matters]]></category>
		<category><![CDATA[Internationalization]]></category>
		<category><![CDATA[Poliglota]]></category>

		<guid isPermaLink="false">http://gustavonarea.net/?p=52</guid>
		<description><![CDATA[Just a quick post to highlight a new feature in Poliglota:

While most CMSs around have a lot of trouble with non-Western languages and cross-linking the different language editions accordingly, Poliglota has a solid support for these features since day one! And it&#8217;s just one of the features.
By the way, want to get involved and speak [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick post to highlight a <a href="https://tracker.gnulinuxmatters.org/ticket/120">new feature</a> in <a href="https://tracker.gnulinuxmatters.org/wiki/Poliglota">Poliglota</a>:</p>
<p><a href="http://gustavonarea.net/uploads/poliglota-after-120.png"><img class="aligncenter size-full wp-image-54" title="A zoom at a killer feature in Poliglota" src="http://gustavonarea.net/uploads/poliglota-after-120-zoom.png" alt="" /></a></p>
<p>While most CMSs around have a lot of trouble with non-Western languages and cross-linking the different language editions accordingly, Poliglota has a solid support for these features since day one! And it&#8217;s just one of the features.</p>
<p>By the way, want to get involved and <em>speak</em> PHP? Then please <a href="http://www.gnulinuxmatters.org/contact">contact us</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://gustavonarea.net/blog/posts/a-silly-yet-killer-feature-in-poliglota/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Pootle on Debian Etch, The Easiest Way</title>
		<link>http://gustavonarea.net/blog/posts/installing-pootle-on-debian-etch-the-easiest-way/</link>
		<comments>http://gustavonarea.net/blog/posts/installing-pootle-on-debian-etch-the-easiest-way/#comments</comments>
		<pubDate>Wed, 21 May 2008 15:34:52 +0000</pubDate>
		<dc:creator>Gustavo</dc:creator>
				<category><![CDATA[HOWTOs]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Internationalization]]></category>
		<category><![CDATA[Pootle]]></category>

		<guid isPermaLink="false">http://gustavonarea.net/?p=41</guid>
		<description><![CDATA[Pootle is a user-friendly web application for online translation of contents. It&#8217;s used by organizations like Creative Commons, OpenOffice.org and GNU/Linux Matters.
I&#8217;m going to show you how to install it the easiest way, from my experience with the GLM Translation Service under Debian 4.0 (this guide might also work under Ubuntu, though). I&#8217;ll use the [...]]]></description>
			<content:encoded><![CDATA[<p><a title="A user-friendly web portal that makes the translation process so much simpler" href="http://translate.sourceforge.net/wiki/pootle/index">Pootle</a> is a user-friendly web application for online translation of contents. It&#8217;s used by organizations like <a href="http://translate.creativecommons.org/">Creative Commons</a>, <a href="http://www.sunvirtuallab.com:32300/">OpenOffice.org</a> and <a title="GNU/Linux Matters!" href="http://translate.gnulinuxmatters.org/">GNU/Linux Matters</a>.</p>
<p>I&#8217;m going to show you how to install it the easiest way, from my experience with the <a title="GNU/Linux Matters!" href="http://translate.gnulinuxmatters.org/">GLM Translation Service</a> under Debian 4.0 (this guide might also work under Ubuntu, though). I&#8217;ll use the <a title="Sudo Configuration in Debian" href="http://www.debianhelp.co.uk/sudo.htm">sudo</a> utility, so I assume that you&#8217;ve already installed and configured sudo accordingly for your user.</p>
<h2>Installing dependencies</h2>
<p>Some of the Pootle&#8217;s dependencies are available in Debian repositories, so we may install them by running:<br />
<code>sudo aptitude install python-dev python-pysqlite2 python-celementtree subversion bzip2 g++ curl</code></p>
<p>We&#8217;re now going to install the other software packages required by Pootle. First, select the directory where you want to download and compile your software, for example:<br />
<code>cd /usr/src</code></p>
<p>To get the source code of the packages and extract them, run the following commands:<br />
<code>curl http://www.kid-templating.org/dist/0.9.6/kid-0.9.6.tar.gz | tar xzv<br />
curl http://dfn.dl.sourceforge.net/sourceforge/translate/translate-toolkit-1.1.1.tar.bz2 | tar xjv<br />
curl http://garr.dl.sourceforge.net/sourceforge/translate/Pootle-1.1.0.tar.bz2 | tar xjv<br />
curl http://jtoolkit.sourceforge.net/snapshots/jToolkit-0.7.8/jToolkit-0.7.8.tar.gz | tar xzv<br />
</code></p>
<p>Installing the applications:<br />
<code>sudo python translate-toolkit-1.1.1/setup.py install<br />
sudo python kid-0.9.6/setup.py install<br />
sudo Pootle-1.1.0/pootlesetup.py install<br />
sudo jToolkit-0.7.8/jToolkitSetup.py install<br />
</code></p>
<h3>Do not install PyLucene</h3>
<p>Pootle is supposed to work better with PyLucene, but if you (like me) hate headaches, you won&#8217;t install PyLucene on Debian Etch. If you try to install it, you&#8217;d get this error:<br />
<code>install: cannot stat `/usr/lib/security/libgcj.security': No such file or directory<br />
make: *** [install] Error 1</code></p>
<p>There&#8217;s nothing you could install that would create that file; don&#8217;t you even try to create it as an empty file: You&#8217;d be able to install PyLucene, but Pootle won&#8217;t work and you&#8217;d get this error when you&#8217;ll try to run it:<br />
<code>GC Warning: Repeated allocation of very large block (appr. size 65536):<br />
May lead to memory leak and poor performance.</code></p>
<p>If it&#8217;s too late, and you&#8217;ve already installed PyLucene with <em>libgcj.security</em> as an empty file (as suggested in some mailing-lists), you may fix it by running the following commands:<br />
<code>sudo mv /usr/lib/python2.4/site-packages/_PyLucene.so /usr/lib/python2.4/site-packages/_PyLucene.so.old<br />
sudo mv /usr/lib/python2.4/site-packages/PyLucene.py /usr/lib/python2.4/site-packages/PyLucene.py.old<br />
sudo mv /usr/lib/python2.4/site-packages/PyLucene.pyc /usr/lib/python2.4/site-packages/PyLucene.pyc.old</code></p>
<h3>Don&#8217;t you have a mail server?</h3>
<p>If your mail server is not in the same host as Pootle, you&#8217;ll need to install one. Just run the command below to install <a href="http://en.wikipedia.org/wiki/Postfix_%28software%29">Postfix</a> and then select &#8220;Internet website&#8221; when asked about what you&#8217;ll use postfix for:<br />
<code>sudo apt-get install postfix</code></p>
<h2>Configuring Pootle</h2>
<p>To make it easy for you to configure and play with Pootle, I suggest you create softlinks to Pootle&#8217;s configuration files in a folder like <em>/etc/pootle</em>:<br />
<code>sudo mkdir /etc/pootle<br />
sudo ln /usr/lib/python2.4/site-packages/Pootle/pootle.prefs -s /etc/pootle/pootle.conf<br />
sudo ln /usr/lib/python2.4/site-packages/Pootle/users.prefs -s /etc/pootle/users.conf<br />
sudo ln /usr/lib/python2.4/site-packages/Pootle/html -s /etc/pootle/html<br />
sudo ln /usr/lib/python2.4/site-packages/Pootle/templates -s /etc/pootle/templates</code></p>
<p>This way, any file you might ever need to edit will be in /etc/pootle.</p>
<p>Now let&#8217;s edit the main configuration file in Pootle: <code>sudo nano /etc/pootle/pootle.conf</code></p>
<p>It&#8217;s well-documented, so I won&#8217;t talk a lot about it. I just suggest you only set the following parameters accordingly:</p>
<ul>
<li><em>description</em>: Describe your website powered by Pootle, with a text aimed at (potential) translators.</li>
<li><em>fromaddress</em>.</li>
<li><em>supportaddress</em>: The email address for translators to make questions. This might be a mailing list.</li>
<li><em>defaultrights</em>: I suggest you set it to <code>defaultrights = "view, suggest, archive, pocompile, translate, commit"</code></li>
<li><em>podirectory</em>: It&#8217;s the path to your translation files. For this HOWTO I&#8217;ll use <em>/var/translations</em>.</li>
</ul>
<h2>Your <em>pootle</em> user</h2>
<p>I suggest you create a user for running <em>pootle</em>:<br />
<code>sudo adduser --disabled-password --disabled-login pootle</code></p>
<h2>Setting up service scripts for Pootle</h2>
<p>Create the file <em>/etc/init.d/pootle</em> as root with the following contents:<br />
<code>#!/bin/bash<br />
# /etc/init.d/pootle: start and stop the Pootle Server<br />
# Pootle runs as user -pootle- via sudo<br />
# This script is based on the one published here http://translate.sourceforge.net/wiki/pootle/service_scripts<br />
PREFIX=/usr/local/pootle<br />
test -x /usr/bin/PootleServer || exit 0<br />
. /lib/lsb/init-functions<br />
case "$1" in<br />
start)<br />
log_begin_msg "Starting Pootle Server..."<br />
/usr/bin/sudo -u pootle $PREFIX/start_pootle &amp;<br />
log_end_msg 0<br />
;;<br />
stop)<br />
log_begin_msg "Stopping Pootle Server..."<br />
$PREFIX/stop_pootle &gt;/dev/null 2&gt;&amp;1<br />
log_end_msg 0<br />
;;<br />
restart)<br />
log_begin_msg "Stopping Pootle Server..."<br />
$PREFIX/stop_pootle &gt;/dev/null 2&gt;&amp;1<br />
log_end_msg 0<br />
log_begin_msg "Starting Pootle Server..."<br />
sudo -u pootle $PREFIX/start_pootle &amp;<br />
log_end_msg 0<br />
;;<br />
status)<br />
$PREFIX/status_pootle<br />
;;<br />
*)<br />
log_success_msg "Usage: /etc/init.d/pootle {start|stop|restart|status}"<br />
exit 1<br />
esac<br />
exit 0</code></p>
<p>Now let&#8217;s create, as root, the auxiliary scripts required by the script above:</p>
<h3>/usr/local/pootle/start_pootle</h3>
<p><code>#!/bin/bash<br />
# $PREFIX/start_pootle<br />
# Start script in port 8080, separates errors from normal logs<br />
# based on a script published here: http://translate.sourceforge.net/wiki/pootle/service_scripts<br />
export HOME="/home/pootle"<br />
/usr/bin/PootleServer -p 8080 $@ &gt;&gt; /var/log/pootle/`date "+%F"` 2&gt;&gt; /var/log/pootle/`date "+%F"`.err</code></p>
<h3>/usr/local/pootle/stop_pootle</h3>
<p><code><br />
#!/bin/bash<br />
# Stop script $PREFIX/stop_pootle<br />
# based on a script published here: http://translate.sourceforge.net/wiki/pootle/service_scripts<br />
echo "Killing Pootle"<br />
pidpootle=`ps -ef |grep PootleServer |grep python | awk '{print $2}'`<br />
pidpootle2=`ps -ef |grep start_pootle |grep bin | awk '{print $2}'`<br />
kill $pidpootle2 &gt;/dev/null 2&gt;&amp;1<br />
kill $pidpootle &gt;/dev/null 2&gt;&amp;1</code></p>
<h3>/usr/local/pootle/status_pootle</h3>
<p><code>#!/bin/bash<br />
# Pootle Status $PREFIX/status_pootle<br />
# based on a script published here: http://translate.sourceforge.net/wiki/pootle/service_scripts<br />
pidpootle=`ps -ef |grep PootleServer |grep python | awk '{print $2}'`<br />
if [ "$pidpootle" != "" ]<br />
then<br />
echo "Pootle Server running in pid ($pidpootle)"<br />
else<br />
echo "Pootle Server is not running"<br />
fi</code></p>
<h3>Make them work!</h3>
<p>Now we have to make these scripts <em>useful</em>:<br />
<code>sudo chmod +x /etc/init.d/pootle<br />
sudo chmod +x /usr/local/pootle/s*<br />
sudo update-rc.d pootle</code></p>
<h2>Configuring Pootle to use your repository</h2>
<p>Pootle supports several <a href="http://en.wikipedia.org/wiki/Revision_control">VCSs</a>, but I&#8217;ll only teach you how to setup a Subversion working copy that Pootle may update and commit. If you don&#8217;t use a version control system, I recommend you do so. If you&#8217;re sure you don&#8217;t need it, you may skip this section. If you&#8217;re using another VCS, you&#8217;ll need to go to the Pootle&#8217;s website to <a title="Version control in Pootle" href="http://translate.sourceforge.net/wiki/pootle/version_control">learn how to configure it with Pootle</a>.</p>
<h3>Setup your working copy</h3>
<p>Let&#8217;s create the working copy at, say, <em>/var/translations</em>. To do that in GNU/Linux Matters, we would run:<br />
<code>sudo svn co https://svn.gnulinuxmatters.org:81/i18n /var/translations</code><br />
You should replace the URL by yours.<br />
And don&#8217;t forget to set the <em>pootle</em> user as the owner:<br />
<code>sudo chown pootle -R /var/translations</code></p>
<h3>Create basic cronjobs</h3>
<p>We should run from time to time two scripts:</p>
<ul>
<li>One to commit the changes made by translators; ideally, these changes would be committed by translators themselves, but from my experience you should not count on that (most of them forget about it or just don&#8217;t know they can do that).</li>
<li>Another to update your PO templates from the repository.</li>
</ul>
<p>So we&#8217;re going to ask our <em>pootle</em> user to do this by creating cronjobs. First, <em>become pootle</em>:<br />
<code>sudo su - pootle</code><br />
Then run <code>crontab -e</code> and add the following two lines:<br />
<code>*/15 * * * * /usr/bin/svn update /var/translations &gt;&gt; /dev/null 2&gt;&gt; /home/pootle/update.err<br />
0 0,8,16 * * * /usr/bin/svn commit -m "Uncommitted translations in the last 8 hours" /var/translations &gt;&gt; /dev/null 2&gt;&gt; /home/pootle/commit.err</code></p>
<h2>Pootle is running on port 8080</h2>
<p>For security reasons, if you followed this HOWTO you&#8217;ll be running as the <em>pootle</em> user, not as root. And due to a UNIX misfeature, only root may open ports below 1024. So, unless you love appending the port number to your URLs, and if port 80 is available on your system, you&#8217;d <a title="Proxying Pootle through Apache" href="http://translate.sourceforge.net/wiki/pootle/apache">proxy Pootle through a webserver</a>.</p>
<p>The proxy trick is recommended, but if you cannot do that or just don&#8217;t want, you can use iptables to redirect traffic from port 8080 to 80. My suggestion would be to use the next iptables ruleset:<br />
<code># Generated by iptables-save v1.3.6 on Thu Jan 24 16:40:59 2008<br />
*nat<br />
 <img src='http://gustavonarea.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> REROUTING ACCEPT [0:0]<br />
 <img src='http://gustavonarea.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> OSTROUTING ACCEPT [0:0]<br />
:OUTPUT ACCEPT [0:0]<br />
-A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080<br />
COMMIT<br />
# Completed on Thu Jan 24 16:40:59 2008<br />
# Generated by iptables-save v1.3.6 on Thu Jan 24 16:40:59 2008<br />
*filter<br />
:INPUT ACCEPT [0:0]<br />
:FORWARD ACCEPT [0:0]<br />
:OUTPUT ACCEPT [495:60715]<br />
-A INPUT -i lo -j ACCEPT<br />
-A INPUT -m state --state INVALID -j DROP<br />
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT<br />
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT<br />
-A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT<br />
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT<br />
-A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7<br />
-A INPUT -p tcp -j REJECT --reject-with tcp-reset<br />
-A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable<br />
-A INPUT -j REJECT --reject-with icmp-proto-unreachable<br />
-A FORWARD -j REJECT --reject-with icmp-port-unreachable<br />
COMMIT<br />
# Completed on Thu Jan 24 16:40:59 2008</code></p>
<p>For more information about this basic iptables-based firewall, you may read my <a href="/blog/posts/setting-up-your-first-server/">Setting up your first server</a> HOWTO.</p>
<h2>Criticism? Suggestions? Complaints?</h2>
<p>Leave a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://gustavonarea.net/blog/posts/installing-pootle-on-debian-etch-the-easiest-way/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
