Hi Tomeu,<br><br>I&#39;m starting up sugar-jhbuild with the command &#39;LANG=es ./sugar-jhbuild run&#39;. Then I open up a terminal and do &#39;sugar-launch annotate&#39;. I tried it with other activities and they seem to work just fine with translation. <br>
<br>Faisal<br><br><div class="gmail_quote">On Thu, Jul 3, 2008 at 8:38 AM, Tomeu Vizoso &lt;<a href="mailto:tomeu@tomeuvizoso.net">tomeu@tomeuvizoso.net</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
from that strace log, seems like gettext thinks you are in the en<br>
locale, right? How are you running your activity?<br>
<br>
Regards,<br>
<br>
Tomeu<br>
<div><div></div><div class="Wj3C7c"><br>
On Wed, Jul 2, 2008 at 11:50 PM, Faisal Anwar &lt;<a href="mailto:fanwar@mediamods.com">fanwar@mediamods.com</a>&gt; wrote:<br>
&gt; Hello All,<br>
&gt;<br>
&gt; I&#39;m trying to set up some simple internationalization on a sugar activity<br>
&gt; but am running in to problems. I am specifically using sugar-jhbuild and<br>
&gt; launching it with &#39;LANG=es ./sugar-jhbuild run&#39; command when I want to test<br>
&gt; my internationalization out. Here are the steps I have followed (I used<br>
&gt; <a href="http://wiki.laptop.org/go/Python_i18n" target="_blank">http://wiki.laptop.org/go/Python_i18n</a> and<br>
&gt; <a href="http://wiki.laptop.org/go/Localization/Testing" target="_blank">http://wiki.laptop.org/go/Localization/Testing</a> to guide me):<br>
&gt;<br>
&gt; 1. First, I created a directory within my activity (a simple shell fo an<br>
&gt; activity which I have called Annotate.activity) called &#39;po&#39; and I went in to<br>
&gt; that directory.<br>
&gt; 2. In Annotate.activity/po, I created a POTFILES.in file and put the<br>
&gt; following text:<br>
&gt;<br>
&gt; encoding: UTF-8<br>
&gt; annotateactivity.py<br>
&gt;<br>
&gt; 3. I launched sugar-jhbuild and went in to the terminal, where I ran &#39;python<br>
&gt; setup.py genpot&#39; from the Annotate.activity directory. This generated an<br>
&gt; &#39;Annotate.pot&#39; file. I went in to Annotate.pot and added some translations<br>
&gt; for strings that I knew would need translating in my program (one specific<br>
&gt; one was a from a print statement where the string is wrapped in _()).<br>
&gt;<br>
&gt; 4. Still in sugar-jhbuild&#39;s terminal, I ran &#39;msginit -l es&#39; which generated<br>
&gt; a file called &#39;es.po&#39;.<br>
&gt;<br>
&gt; 5. finally, I did &#39;msgfmt -o<br>
&gt; ../locale/es/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a> es.po&#39; to generate<br>
&gt; the mo file and place it within the right directory for spanish (the<br>
&gt; directory path is similar to the one I found for Web.activity, whose<br>
&gt; translations are working fine).<br>
&gt;<br>
&gt; After doing all this, I restarted sugar-jhbuild by using &#39;LANG=es<br>
&gt; ./sugar-jhbuild run&#39; . I can see other activities have text translated, but<br>
&gt; my activity is not translating the text that I wrapped in _() and was<br>
&gt; printing out. I checked the source file and I am using gettext (importing it<br>
&gt; as _ and then using the wrapper in the print statement I want translated).<br>
&gt;<br>
&gt; Someone suggested trying to do an strace to see what was happening. I did<br>
&gt; this and found the following in the portion of the log where it has any<br>
&gt; reference to the string I want translated:<br>
&gt;<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en_US.UTF8/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en_US/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en.UTF8/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; write(1, &quot;hello world should be translated&quot;..., 33hello world should be<br>
&gt; translated<br>
&gt; ) = 33<br>
&gt;<br>
&gt; 1<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en_US.UTF8/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; 2<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en_US/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; 3<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en.UTF8/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; 4<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; 5 write(1, &quot;hello world should be translated&quot;..., 33hello world should be<br>
&gt; translated<br>
&gt; 6 ) = 33<br>
&gt; 1<br>
&gt; 2<br>
&gt; 3<br>
&gt; 4<br>
&gt; 5<br>
&gt; 6<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en_US.UTF8/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en_US/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en.UTF8/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; write(1, &quot;hello world should be translated&quot;..., 33hello world should be<br>
&gt; translated<br>
&gt; ) = 33<br>
&gt;<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en_US.UTF8/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en_US/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en.UTF8/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; write(1, &quot;hello world should be translated&quot;..., 33hello world should be<br>
&gt; translated<br>
&gt; ) = 33<br>
&gt;<br>
&gt; 1<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en_US.UTF8/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; 2<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en_US/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; 3<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en.UTF8/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; 4<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; 5 write(1, &quot;hello world should be translated&quot;..., 33hello world should be<br>
&gt; translated<br>
&gt; 6 ) = 33<br>
&gt; 1<br>
&gt; 2<br>
&gt; 3<br>
&gt; 4<br>
&gt; 5<br>
&gt; 6<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en_US.UTF8/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en_US/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en.UTF8/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; stat(&quot;/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a>&quot;,<br>

&gt; 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
&gt; write(1, &quot;hello world should be translated&quot;..., 33hello world should be<br>
&gt; translated<br>
&gt; ) = 33<br>
&gt;<br>
&gt; I would greatly appreciate any feedback on why translation is not working<br>
&gt; here.<br>
&gt;<br>
&gt; Thanks<br>
&gt;<br>
&gt;<br>
&gt; Faisal<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Sugar mailing list<br>
&gt; <a href="mailto:Sugar@lists.laptop.org">Sugar@lists.laptop.org</a><br>
&gt; <a href="http://lists.laptop.org/listinfo/sugar" target="_blank">http://lists.laptop.org/listinfo/sugar</a><br>
&gt;<br>
&gt;<br>
</blockquote></div><br>