Hi Tomeu,<br><br>Thank You for your kind and quick reply. I am thinking of a small activity which can be easily localized and whose code can be easily understood. I will be writing a very small pyGTK activity from scratch or otherwise I will be localizing a simple activity like 'HelloWorld' which is a simple tutorial activity made by sugarlabs. I will soon mail the details about the same. <br>
<br>Regards,<br>VIJIT <br><br><div class="gmail_quote">On Sat, Jun 20, 2009 at 11:11 PM, Tomeu Vizoso <span dir="ltr"><<a href="mailto:tomeu@sugarlabs.org">tomeu@sugarlabs.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2009/6/19 vijit singh <<a href="mailto:vijitthetopcoder@gmail.com">vijitthetopcoder@gmail.com</a>>:<br>
<div><div></div><div class="h5">> Hi everyone,<br>
><br>
> I am a software engineer at SEETA (<a href="http://seeta.in" target="_blank">http://seeta.in</a>) working in the Food Force II project. I have been recently trying to localize this project to Hindi, and have run into issues towards doing the same. I have followed the steps mentioned at the wiki pages, and I am not sure, where I could have gone wrong. Please find the details of the steps followed by me below-<br>
><br>
><br>
> 1. Selected the strings from the project files, which I wanted to translate. Selected 5 of them. These were contained in 2 python modules. So, I included gettext in these 2 modules, and then wrapped the 5 strings in gettext. Please find the details as follows-<br>
> from gettext import gettext as _ # at the top of both the modules<br>
><br>
> _(‘string to be translated’) # with the 5 strings<br>
><br>
> 2. Created a sub-directory namely "po" in the main FoodForceII directory. Then, I created POTFILES.in file in the po directory, and added-<br>
><br>
> encoding: UTF-8<br>
><br>
> Foodforce2.py<br>
><br>
> gui_buttons.py<br>
><br>
> FoodForce2.py and gui_buttons.py are the modules, which contain the strings to be translated.<br>
><br>
> 3. Tried creating the .POT file for FoodForceII. Ran the olpc-setup.py file (the setup file for FoodForce2) with genpot command. Received the following error message-<br>
><br>
> Xgettext error: Can’t include the svgsprite.py file: no such file exist<br>
><br>
> svgsprite.py is a module required for running pygames in the sugar environment. Encountered similar error with every file in the olpcgames folder placed in the activity bundle.<br>
><br>
> I experimented with moving the olpcgames folder outside the FoodForceII bundle, and then ran olpc-setup.py file with genpot. The FoodForce2.pot file was created in the po folder.<br>
><br>
> 4. Now, I copied back the olpcgames folder into the FoodForce2 main directory .Now, we were supposed to generate a .po file. As, I was firstly translating the game into hindi language ( a regional language of INDIA); I gave the following command from inside the po folder in terminal-<br>
><br>
> msginit -l hi<br>
><br>
> hi becoz we were generating po file for the hindi language. It was successfully done and the hi.po file was created. So, now our po folder contains the following three files-<br>
><br>
> FoodForce2.pot hi.po POTFILES.in<br>
><br>
> 5. Now, the next step was to add the hindi text in the msgstr part in the hi.po file . As I am proficient in the hindi language I did the translation on my own using a hindi editor. The translated strings were placed between the quotes in the hi.po file for the 5 strings-<br>
><br>
> msgstr “ “<br>
><br>
> 6. So, the next and final step was to make the .mo file. Firstly I created the following directories-<br>
><br>
> locale/hi/LC_MESSAGES<br>
><br>
> where the locale sub-directory was located directly in the FoodForce2 directory and hi was contained in locale sub-directory and LC_MESSAGES in hi sub-directory.<br>
><br>
> Now, I ran the following command from inside the po folder in the terminal-<br>
><br>
> msgfmt hi.po --output='../locale/hi/LC_MESSAGES/<a href="http://org.laptop.FoodForce2.mo" target="_blank">org.laptop.FoodForce2.mo</a>'<br>
><br>
> And so the <a href="http://org.laptop.FoodForce2.mo" target="_blank">org.laptop.FoodForce2.mo</a> file was generated in locale/hi/LC_MESSAGES<br>
><br>
> 7. As all the necessary steps were done, I made a new xo bundle for FoodForce2 and then changed the language of my sugar environment to Hindi and then installed the bundle on it and ran the game. But, instead of the strings which I tried to translate appearing in HIndi, they appeared in english only.<br>
><br>
> As these steps didn't result into a successful localization, I tried some other ways also but none gave the right result. The other changes which I made were-<br>
><br>
> 1. As the i18n page I mentioned earlier in the mail was not very clear about this , so I included all the python modules present in FoodForce2 directory in the POTFILES.in and then generated the .pot file as done in step 2.<br>
><br>
> I am still trying to work out why the translation is not taking place successfully. I would highly appreciate if anyone can send me some ideas about why it didn't it worked properly.<br>
<br>
</div></div>I'm sorry but I don't have any concrete recommendations. What I would<br>
do in your place is to get a very simple activity written from scratch<br>
and make localization work there. After you got that, you could move<br>
to add localization to FoodForce with a more knowledge of what is<br>
required.<br>
<br>
It will be also easier to answer your questions about such a simple<br>
activity than about a big one like FoodForce.<br>
<br>
Hope it helps,<br>
<br>
Tomeu<br>
<br>
> Regards,<br>
><br>
> VIJIT SINGH<br>
> _______________________________________________<br>
> Sugar-devel mailing list<br>
> <a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
> <a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
><br>
><br>
</blockquote></div><br>