Hello All,<br><br>I&#39;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 &#39;LANG=es ./sugar-jhbuild run&#39; 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 &#39;po&#39; 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 &#39;python setup.py genpot&#39; from the Annotate.activity directory. This generated an &#39;Annotate.pot&#39; 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&#39;s terminal, I ran &#39;msginit -l es&#39; which generated a file called &#39;es.po&#39;.<br><br>5. finally, I did &#39;msgfmt -o ../locale/es/LC_MESSAGES/<a href="http://org.laptop.AnnotateActivity.mo">org.laptop.AnnotateActivity.mo</a> es.po&#39; 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 &#39;LANG=es ./sugar-jhbuild run&#39; . 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: &#39;Courier New&#39;,Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: &#39;Courier New&#39;,Courier,monospace; font-weight: normal;">
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)
</div></li><li style="font-family: &#39;Courier New&#39;,Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: &#39;Courier New&#39;,Courier,monospace; font-weight: normal;">
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)
</div></li><li style="font-family: &#39;Courier New&#39;,Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: &#39;Courier New&#39;,Courier,monospace; font-weight: normal;">
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)
</div></li><li style="font-family: &#39;Courier New&#39;,Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: &#39;Courier New&#39;,Courier,monospace; font-weight: normal;">
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)
</div></li><li style="font-family: &#39;Courier New&#39;,Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: &#39;Courier New&#39;,Courier,monospace; font-weight: normal;">
write(1, &quot;hello world should be translated&quot;..., 33hello world should be translated
</div></li><li style="font-family: &#39;Courier New&#39;,Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: &#39;Courier New&#39;,Courier,monospace; font-weight: normal;">
) = 33</div></li></ol></div>                                </div>
                                
                                
                                                                
                                
                                
                                <div style="display: none;" id="view_m_embedded">
                                <code>1
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>2
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>3
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>4
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>5 
write(1, &quot;hello world should be translated&quot;..., 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(&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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
write(1, &quot;hello world should be translated&quot;..., 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: &#39;Courier New&#39;,Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: &#39;Courier New&#39;,Courier,monospace; font-weight: normal;">
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)
</div><br></li><li style="font-family: &#39;Courier New&#39;,Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: &#39;Courier New&#39;,Courier,monospace; font-weight: normal;">
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)
</div><br></li><li style="font-family: &#39;Courier New&#39;,Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: &#39;Courier New&#39;,Courier,monospace; font-weight: normal;">
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)
</div><br></li><li style="font-family: &#39;Courier New&#39;,Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: &#39;Courier New&#39;,Courier,monospace; font-weight: normal;">
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)
</div><br></li><li style="font-family: &#39;Courier New&#39;,Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: &#39;Courier New&#39;,Courier,monospace; font-weight: normal;">
write(1, &quot;hello world should be translated&quot;..., 33hello world should be translated
</div><br></li><li style="font-family: &#39;Courier New&#39;,Courier,monospace; color: black; font-weight: normal; font-style: normal;"><div style="font-family: &#39;Courier New&#39;,Courier,monospace; font-weight: normal;">
) = 33</div><br></li></ol></div>                                </div>
                                
                                
                                                                
                                
                                
                                <div style="display: none;" id="view_n_embedded">
                                <code>1
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>2
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>3
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>4
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>5 
write(1, &quot;hello world should be translated&quot;..., 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(&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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
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">org.laptop.AnnotateActivity.mo</a>&quot;,
0x7fffa41f75d0) = -1 ENOENT (No such file or directory)<br>
write(1, &quot;hello world should be translated&quot;..., 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>