Hi Tomeu,<br><br>I'm starting up sugar-jhbuild with the command 'LANG=es ./sugar-jhbuild run'. Then I open up a terminal and do 'sugar-launch annotate'. 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 <<a href="mailto:tomeu@tomeuvizoso.net">tomeu@tomeuvizoso.net</a>> 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 <<a href="mailto:fanwar@mediamods.com">fanwar@mediamods.com</a>> wrote:<br>
> Hello All,<br>
><br>
> I'm trying to set up some simple internationalization on a sugar activity<br>
> but am running in to problems. I am specifically using sugar-jhbuild and<br>
> launching it with 'LANG=es ./sugar-jhbuild run' command when I want to test<br>
> my internationalization out. Here are the steps I have followed (I used<br>
> <a href="http://wiki.laptop.org/go/Python_i18n" target="_blank">http://wiki.laptop.org/go/Python_i18n</a> and<br>
> <a href="http://wiki.laptop.org/go/Localization/Testing" target="_blank">http://wiki.laptop.org/go/Localization/Testing</a> to guide me):<br>
><br>
> 1. First, I created a directory within my activity (a simple shell fo an<br>
> activity which I have called Annotate.activity) called 'po' and I went in to<br>
> that directory.<br>
> 2. In Annotate.activity/po, I created a POTFILES.in file and put the<br>
> following text:<br>
><br>
> encoding: UTF-8<br>
> annotateactivity.py<br>
><br>
> 3. I launched sugar-jhbuild and went in to the terminal, where I ran 'python<br>
> setup.py genpot' from the Annotate.activity directory. This generated an<br>
> 'Annotate.pot' file. I went in to Annotate.pot and added some translations<br>
> for strings that I knew would need translating in my program (one specific<br>
> one was a from a print statement where the string is wrapped in _()).<br>
><br>
> 4. Still in sugar-jhbuild's terminal, I ran 'msginit -l es' which generated<br>
> a file called 'es.po'.<br>
><br>
> 5. finally, I did 'msgfmt -o<br>
> ../locale/es/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo" target="_blank">org.laptop.AnnotateActivity.mo</a> es.po' to generate<br>
> the mo file and place it within the right directory for spanish (the<br>
> directory path is similar to the one I found for Web.activity, whose<br>
> translations are working fine).<br>
><br>
> After doing all this, I restarted sugar-jhbuild by using 'LANG=es<br>
> ./sugar-jhbuild run' . I can see other activities have text translated, but<br>
> my activity is not translating the text that I wrapped in _() and was<br>
> printing out. I checked the source file and I am using gettext (importing it<br>
> as _ and then using the wrapper in the print statement I want translated).<br>
><br>
> Someone suggested trying to do an strace to see what was happening. I did<br>
> this and found the following in the portion of the log where it has any<br>
> reference to the string I want translated:<br>
><br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> write(1, "hello world should be translated"..., 33hello world should be<br>
> translated<br>
> ) = 33<br>
><br>
> 1<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> 2<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> 3<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> 4<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> 5 write(1, "hello world should be translated"..., 33hello world should be<br>
> translated<br>
> 6 ) = 33<br>
> 1<br>
> 2<br>
> 3<br>
> 4<br>
> 5<br>
> 6<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> write(1, "hello world should be translated"..., 33hello world should be<br>
> translated<br>
> ) = 33<br>
><br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> write(1, "hello world should be translated"..., 33hello world should be<br>
> translated<br>
> ) = 33<br>
><br>
> 1<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> 2<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> 3<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> 4<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> 5 write(1, "hello world should be translated"..., 33hello world should be<br>
> translated<br>
> 6 ) = 33<br>
> 1<br>
> 2<br>
> 3<br>
> 4<br>
> 5<br>
> 6<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> stat("/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>",<br>

> 0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
> stat("/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>",<br>

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