Hello All,<br><br>I'm trying to set up some simple internationalization on a sugar activity but am running in to problems. I am specifically using sugar-jhbuild and launching it with 'LANG=es ./sugar-jhbuild run' command when I want to test my internationalization out. Here are the steps I have followed (I used <a href="http://wiki.laptop.org/go/Python_i18n" target="_blank">http://wiki.laptop.org/go/Python_i18n</a> and <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 activity which I have called Annotate.activity) called 'po' and I went in to that directory. <br>2. In Annotate.activity/po, I created a POTFILES.in file and put the 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 setup.py genpot' from the Annotate.activity directory. This generated an 'Annotate.pot' file. I went in to Annotate.pot and added some translations for strings that I knew would need translating in my program (one specific 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 a file called 'es.po'.<br><br>5. finally, I did 'msgfmt -o ../locale/es/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo">org.laptop.AnnotateActivity.mo</a> es.po' to generate the mo file and place it within the right directory for spanish (the directory path is similar to the one I found for Web.activity, whose translations are working fine). <br>
<br>After doing all this, I restarted sugar-jhbuild by using 'LANG=es ./sugar-jhbuild run' . I can see other activities have text translated, but my activity is not translating the text that I wrapped in _() and was printing out. I checked the source file and I am using gettext (importing it 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 this and found the following in the portion of the log where it has any reference to the string I want translated: <br><br><div style="display: block;" id="view_m_standard">
<div style="font-family: monospace;"><ol><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">
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">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)
</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">
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">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)
</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">
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">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)
</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">
stat("/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)
</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">
write(1, "hello world should be translated"..., 33hello world should be translated
</div></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">
) = 33</div></li></ol></div> </div>
<div style="display: none;" id="view_m_embedded">
<code>1
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">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>2
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">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>3
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">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>4
stat("/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>5
write(1, "hello world should be translated"..., 33hello world should be translated<br>6
) = 33</code> </div>
<div style="display: none;" id="view_m_nolines">
<div class="codeLines"><code>1<br>2<br>3<br>4<br>5<br>6</code></div><div class="codeContainer"><code>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">org.laptop.AnnotateActivity.mo</a>",
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">org.laptop.AnnotateActivity.mo</a>",
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">org.laptop.AnnotateActivity.mo</a>",
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">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
write(1, "hello world should be translated"..., 33hello world should be translated<br>
) = 33</code></div> </div>
<div style="display: none;" id="view_n_standard">
<div style="font-family: monospace;"><ol><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">
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">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)
</div><br></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">
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">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)
</div><br></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">
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">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)
</div><br></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">
stat("/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)
</div><br></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">
write(1, "hello world should be translated"..., 33hello world should be translated
</div><br></li><li style="font-family: 'Courier New',Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: 'Courier New',Courier,monospace; font-weight: normal;">
) = 33</div><br></li></ol></div> </div>
<div style="display: none;" id="view_n_embedded">
<code>1
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">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>2
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">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>3
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">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>4
stat("/home/fanwar/sugar-jhbuild/sugar-jhbuild/install/share/sugar/activities/Annotate.activity/locale/en/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>5
write(1, "hello world should be translated"..., 33hello world should be translated<br>6
) = 33</code> </div>
<div style="display: none;" id="view_n_nolines">
<div class="codeLines"><code>1<br>2<br>3<br>4<br>5<br>6</code></div><div class="codeContainer"><code>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">org.laptop.AnnotateActivity.mo</a>",
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">org.laptop.AnnotateActivity.mo</a>",
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">org.laptop.AnnotateActivity.mo</a>",
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">org.laptop.AnnotateActivity.mo</a>",
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
write(1, "hello world should be translated"..., 33hello world should be translated<br>
) = 33</code></div> </div>
<a name="information"></a>
<h2><font style="font-weight: normal;" size="2"><font face="arial,sans-serif">I would greatly appreciate any feedback on why translation is not working here. <br></font></font></h2>Thanks<br><br><br>Faisal<br>