Aunque habla más de la parte técnica, creo que la propuesta inicial es interesante como adaptación a un caso en nuestro país. Alguien se apunta a crear un guión para hacer la programación?<br><br>
<div style="margin: 0px 2px; padding-top: 1px;    background-color: #c3d9ff; font-size: 1px !important;    line-height: 0px !important;">&nbsp;</div>
<div style="margin: 0px 1px; padding-top: 1px;    background-color: #c3d9ff; font-size: 1px !important;    line-height: 0px !important;">&nbsp;</div>
<div style="padding: 4px; background-color: #c3d9ff;"><h3 style="margin:0px 3px;font-family:sans-serif">Enviado por Fabian Prieto a través de Google Reader:</h3></div>
<div style="margin: 0px 1px; padding-top: 1px;    background-color: #c3d9ff; font-size: 1px !important;    line-height: 0px !important;">&nbsp;</div>
<div style="margin: 0px 2px; padding-top: 1px;    background-color: #c3d9ff; font-size: 1px !important;    line-height: 0px !important;">&nbsp;</div>
<div style="font-family:sans-serif;overflow:auto;width:100%;margin: 0px 10px"><h2 style="margin: 0.25em 0 0 0"><div class=""><a href="http://feedproxy.google.com/~r/TantasCosasParaHacerYTanPocoTiempo/~3/Zrnz5tFFHTY/traduciendo-foodforce.html">Traduciendo FoodForce</a></div></h2>
<div style="margin-bottom: 0.5em">vía <a href="http://godiard.blogspot.com/" class="f">Tantas cosas para hacer y tan poco tiempo!</a> de Gonzalo el 15/03/10</div><br style="display:none">
En La Rioja, Jorge Cabrera me contó una idea que me pareció muy buena, modificar el Food Force para adaptarlo a una época de la historia de la provincia. Mientras pensaba como hacerlo, se me ocurrió que sería mejor comenzar por trabajar en la internacionalización (i18n) del juego, y una vez que supieramos bien como funciona y como está programado, sería mas facil modificarlo. A su vez, es un juego interesante para que usen los chicos.<br>Nos contactamos con <span style="color:rgb(0, 0, 0)"><span>Mohit Taneja</span></span>, uno de los desarrolladores y se mostró interesado en la i18n.<br>Como puede ser util para otras actividades, detallo aqui el procedimiento aplicado, aunque está bien explicado en <a href="http://wiki.laptop.org/go/Internationalization_in_Sugar">http://wiki.lapt</a><a href="http://wiki.laptop.org/go/Internationalization_in_Sugar">op.org/go/Internationalization_in_Sugar</a><br><br>Si iniciamos el juego vemos esta pantalla (haciendo click en las imagenes pueden ver mejor los textos)<br><br><a href="http://1.bp.blogspot.com/_PCI71r7e44s/S577qVUTeCI/AAAAAAAABMk/Jj2n4ccOgn4/s1600-h/ff.png"><img style="margin:0px auto 10px;display:block;text-align:center;width:320px;height:241px" src="http://1.bp.blogspot.com/_PCI71r7e44s/S577qVUTeCI/AAAAAAAABMk/Jj2n4ccOgn4/s320/ff.png" alt="" border="0"></a><br>Para empezar por los textos que se ven en esta pantalla, en primer lugar busco en que archivo del programa se encuentran. Desde el directorio de la actividad (Activities/FoodForce2.activity/) en la linea de comandos escribo:<br><br><code><br>[gonzalo@nautilus FoodForce2.activity]$ grep -n "Start New Game" *.py<br>Foodforce2.py:304:            self.start_button = gui.Button(position = threades.resize_pos((475,500)), size = threades.resize_pos((250,50)), parent = desktop2, text = "Start New Game",style = self.button_style)<br></code><br><br>Esto me indica que el texto que busco está en la linea 304 del archivo FoodForce2.py. Ahora lo tenemos que editar con cualquier editor de texto.<br><br>Para poder hacer la i18n de ese archivo, debemos agregar al comienzo del archivo, donde estan los imports, una linea que importe la libreria necesaria<br><code><br>import pygame<br>from pygame.locals import *<br>from pygame.display import *<br>from pygame.mouse import * <br><span style="color:rgb(51, 51, 255)">from gettext import gettext as _</span><br></code><br><br>ahora buscamos las lineas donde se encuentran el texto de los botones y reemplazamos el texto, por ejemplo "Start New Game", por <span style="color:rgb(51, 51, 255)">_(</span>"Start New Game"<span style="color:rgb(51, 51, 255)">)</span><br><br>En este caso vamos hasta la linea 304 y modificamos para que quede:<br><br><code><br>       if self.pause_flag:<br>           self.start_button = gui.Button(position = threades.resize_pos((475,500)), size = threades.resize_pos((250,50)), parent = desktop2, text = <span style="color:rgb(51, 51, 255)">_("Start New Game")</span>,style = self.button_style)<br>           self.start_button.onClick = self.startup_text<br>           if self.init_game_save_flag == True:<br>               self.resume_saved_level_button = gui.Button(position = threades.resize_pos((475,430)),size = threades.resize_pos((250,50)), parent = desktop2, text = <span style="color:rgb(51, 51, 255)">_("Resume Saved Game")</span>,style =self.button_style)<br>               self.resume_saved_level_button.onClick = self.resume_saved_level<br>       else:<br>           self.resume_button = gui.Button(position = threades.resize_pos((475,500)), size = threades.resize_pos((250,50)), parent = desktop2, text = <span style="color:rgb(51, 51, 255)">_("Resume Game")</span>,style = self.button_style)<br>           self.resume_button.onClick = self.resume           <br>           #Save Game Button<br>           if proceduralFlow.storyboard_level != 1:<br>               self.save_button = gui.Button(position = threades.resize_pos((475,430)), size = threades.resize_pos((250,50)), parent = desktop2, text = <span style="color:rgb(51, 51, 255)">_("Save Current Level")</span>,style = self.button_style)<br>               self.save_button.onClick = self.save_current_level       <br>       self.controls_button = gui.Button(position = threades.resize_pos((475,640)), size = threades.resize_pos((250,50)), parent = desktop2, text = <span style="color:rgb(51, 51, 255)">_("Controls")</span>,style = self.button_style)<br>       self.exit_button = gui.Button(position = threades.resize_pos((475,710)), size = threades.resize_pos((250,50)), parent = desktop2, text = <span style="color:rgb(51, 51, 255)">_("Exit")</span>,style = self.button_style)<br>       self.instructions_button = gui.Button(position = threades.resize_pos((475,570)), size = threades.resize_pos((250,50)), parent = desktop2, text = <span style="color:rgb(51, 51, 255)">_("Guide")</span>,style = self.button_style)<br>       self.about_us_button = gui.Button(position = threades.resize_pos((1000,20)), size = threades.resize_pos((150,40)), parent = desktop2, text = <span style="color:rgb(51, 51, 255)">_("About Us")</span>,style = self.button_style)<br></code><br><br>Ahora, como la actividad no lo incluye, agregamos un archivo setup.py con el siguiente contenido:<br><pre>from sugar.activity import bundlebuilder<br>bundlebuilder.start()<br></pre>y lo ejecutamos:<br><br><span style="font-size:85%"><span style="font-family:courier new">python setup.py genpot</span></span><br><br>Esto nos genera el directorio y archivo con las traducciones.<br>Nos movemos a ese directorio<br><br><span style="font-size:85%"><span style="font-family:courier new">[gonzalo@nautilus FoodForce2.activity]$ cd po</span></span><br><br>Y creamos el archivo para las traducciones en español:<br><br><span style="font-size:85%"><span style="font-family:courier new">[gonzalo@nautilus po]msginit -l es</span></span><br><br>Me pide mi mail y genera un archivo es.po<br>Tenemos que editarlo y agregar las traducciones a los textos, en este caso queda:<br><br><code><br># Spanish translations for FoodForce package.<br># Copyright (C) 2010 THE FoodForce'S COPYRIGHT HOLDER<br># This file is distributed under the same license as the FoodForce package.<br># Gonzalo Odiard , 2010.<br>#<br>msgid ""<br>msgstr ""<br>"Project-Id-Version: FoodForce 2.activity\n"<br>"Report-Msgid-Bugs-To: \n"<br>"POT-Creation-Date: 2010-03-16 00:04-0300\n"<br>"PO-Revision-Date: 2010-03-16 00:06-0300\n"<br>"Last-Translator: Gonzalo Odiard \n"<br>"Language-Team: Spanish\n"<br>"MIME-Version: 1.0\n"<br>"Content-Type: text/plain; charset=ASCII\n"<br>"Content-Transfer-Encoding: 8bit\n"<br>"Plural-Forms: nplurals=2; plural=(n != 1);\n"<br><br>#: activity/activity.info:2<br>#: /home/gonzalo/Activities/FoodForce2.activity/activity.py:8<br>msgid "FoodForce2"<br>msgstr ""<br><br>#: /home/gonzalo/Activities/FoodForce2.activity/Foodforce2.py:307<br>msgid "Start New Game"<br>msgstr "Comienza Nuevo Juego"<br><br>#: /home/gonzalo/Activities/FoodForce2.activity/Foodforce2.py:311<br>msgid "Resume Saved Game"<br>msgstr "Retoma Juego Anterior"<br><br>#: /home/gonzalo/Activities/FoodForce2.activity/Foodforce2.py:316<br>msgid "Resume Game"<br>msgstr "Retoma Juego"<br><br>#: /home/gonzalo/Activities/FoodForce2.activity/Foodforce2.py:321<br>msgid "Save Current Level"<br>msgstr "Graba Nivel Actual"<br><br>#: /home/gonzalo/Activities/FoodForce2.activity/Foodforce2.py:325<br>msgid "Controls"<br>msgstr "Controles"<br><br>#: /home/gonzalo/Activities/FoodForce2.activity/Foodforce2.py:326<br>msgid "Exit"<br>msgstr "Salir"<br><br>#: /home/gonzalo/Activities/FoodForce2.activity/Foodforce2.py:327<br>msgid "Guide"<br>msgstr "Guia"<br><br>#: /home/gonzalo/Activities/FoodForce2.activity/Foodforce2.py:328<br>msgid "About Us"<br>msgstr "Acerca de"<br></code><br><br>Ahora tenemos que preparar el archivo de traducciones compiladas, que usará finalmente la actividad, para ello necesitamos saber el service_name de la actividad, hacemos:<br><br><code><br>[gonzalo@nautilus po]$ cat ../activity/activity.info<br>[Activity]<br>name = FoodForce2<br>activity_version = 4<br>host_version = 1<br>service_name = <span style="color:rgb(51, 51, 255)">org.laptop.community.FoodForce2</span><br>icon = activity-foodforce2<br>exec = sugar-activity activity.Activity<br></code><br><br>Ahora creamos el directorio para las traducciones compiladas<br><br><code><br>[gonzalo@nautilus po]$ mkdir -p ../locale/es/LC_MESSAGES/<br></code><br><br>Y creamos el archivo compilado, con el nombre que tomamos del service name:<br><br><code><br>[gonzalo@nautilus po]$ msgfmt es.po --output='../locale/es/LC_MESSAGES/org.laptop.community.FoodForce2.mo'<br></code><br><br>Ahora si ingreso en la aplicacion veo:<br><br><a href="http://2.bp.blogspot.com/_PCI71r7e44s/S58ECwZpx2I/AAAAAAAABMs/--Xvs-YKL9c/s1600-h/ff-traducido.png"><img style="margin:0px auto 10px;display:block;text-align:center;width:320px;height:242px" src="http://2.bp.blogspot.com/_PCI71r7e44s/S58ECwZpx2I/AAAAAAAABMs/--Xvs-YKL9c/s320/ff-traducido.png" alt="" border="0"></a><br>Bien, este es el comienzo. Segun nos explica <span style="color:rgb(0, 0, 0)"><span>Mohit Taneja</span></span>, la mayoría de los textos se encuentran en los siguientes archivos:<br><br>texts.py : These are the texts which are shown at the start and end of the game.<br><br>display_panel.py : It contains the texts regarding the resources panel, manpower resources and stuff.<br><br>storyboard.pkl : It contains the strings regarding the chats and mission messages being shown in the game. This file is created by write_storyboard.py script. This file is not present in the XO bundle but is present in the svn repository of foodforce2.<br><br>gui_buttons.py : this file contains the strings which are displayed when you open windows regarding setup facility, upgrade facility, and buy sell button.<br><br>Comenzaremos por los archivos .py y luego veremos como hacemso con el archivo storyboard.pkl<br><br>Alguien está interesado en colaborar?<div><img width="1" height="1" src="https://blogger.googleusercontent.com/tracker/6706929-8126655085376365923?l=godiard.blogspot.com" alt=""></div><p><iframe src="http://feedads.g.doubleclick.net/~ah/f/jpk06mfrk439vb05hmgg3h3kak/300/250?ca=1&amp;fh=280#http%3A%2F%2Fgodiard.blogspot.com%2F2010%2F03%2Ftraduciendo-foodforce.html" width="100%" height="280" frameborder="0" scrolling="no" marginwidth="0" marginheight="0"></iframe></p><img src="http://feeds.feedburner.com/~r/TantasCosasParaHacerYTanPocoTiempo/~4/Zrnz5tFFHTY" height="1" width="1"></div>
<br>
<div style="margin: 0px 2px; padding-top: 1px;    background-color: #c3d9ff; font-size: 1px !important;    line-height: 0px !important;">&nbsp;</div>
<div style="margin: 0px 1px; padding-top: 1px;    background-color: #c3d9ff; font-size: 1px !important;    line-height: 0px !important;">&nbsp;</div>
<div style="padding: 4px; background-color: #c3d9ff;"><h3 style="margin:0px 3px;font-family:sans-serif">Cosas que puedes hacer desde aquí:</h3>
<ul style="font-family:sans-serif"><li><a href="http://www.google.com/reader/view/feed%2Fhttp%3A%2F%2Fgodiard.blogspot.com%2Ffeeds%2Fposts%2Fdefault?source=email">Subscribirte a Tantas cosas para hacer y tan poco tiempo!</a> con <b>Google Reader</b></li>
<li><a href="http://www.google.com/reader/?source=email">Empezar a utilizar Google Reader</a> para mantenerte al día fácilmente de <b>todos tus sitios favoritos</b></li></ul></div>
<div style="margin: 0px 1px; padding-top: 1px;    background-color: #c3d9ff; font-size: 1px !important;    line-height: 0px !important;">&nbsp;</div>
<div style="margin: 0px 2px; padding-top: 1px;    background-color: #c3d9ff; font-size: 1px !important;    line-height: 0px !important;">&nbsp;</div>