Changes

Line 141: Line 141:  
== Modify your activity to use the data files ==
 
== Modify your activity to use the data files ==
   −
You need can modify the file activity_es.py and modify the lines:
+
To create a wikipedia in a new language, you will need create the following files:
   −
        self.WIKIDB = 'es_new/eswiki-20111112-pages-articles.xml'
+
* activity/activity.info.''lang'': is the activity.info file for your language. You can copy
        self.HOME_PAGE = '/static/index_es.html'
+
one from other language, and modify the name, the bundle_id, the icon and the exec line.
   −
to point to your new data files or create a new different file, for example activity_pt.py.
+
* activity/activity-wikipedia-''lang''.svg: is the activity icon. The file can be copied from
 +
another language, and modify with a text editor the last text element, to put the labugage code.
 +
If you need edit the image with a graphic editor (like Inkscape) remember add the entities lines
 +
in the header and replace the entities for stroke_color and fill_color, after that.
   −
If you create a new file, you will need to modify the file activity/activity.info to point to this new file.
+
* activity_''lang''.py: is the startup class, sets the configuration values and starts the server.
 +
You can copy the class from another language and set the parameters. You need set the name of the class,
 +
equal than the value in the exec value in the activity/activity.info.lang file.
 +
 
 +
* static/about_''lang''.html: Is a static about page. Translate it from a similar page from other language.
 +
 
 +
* static/index_''lang''.html: is the activity home page. Will have links to good pages to start to explore.
 +
If you create your favorite list based in a translation of the home page from other language, would be a good idea translate the home page too.  
    
Now, you can test your changes, starting the wikipedia server:
 
Now, you can test your changes, starting the wikipedia server:
   −
  ./server.py es_lat/eswiki-20111112-pages-articles.xml 8000
+
  ./activity_''lang''.py es_lat/eswiki-20111112-pages-articles.xml 8000
    
The first parameter is your xml data file and the second parameter a number of port.
 
The first parameter is your xml data file and the second parameter a number of port.
Line 161: Line 171:     
[[File:Wikipedia_test.png]]
 
[[File:Wikipedia_test.png]]
  −
You can create a new icon too, or modify the existing activity/activity-wikipedia-es.svg file.
  −
  −
If you are creating a new wikipedia activity, it's important change the name and the bundle_id in the activity/activity.info file. If you are updating the data in a existinting activity, the activity_version value must be changed.
      
Finally, to create the new .xo file and distribute it, you must do:
 
Finally, to create the new .xo file and distribute it, you must do:
628

edits