OpenStreetMap

Translation Script

Posted by manuvarkey on 5 March 2016 in English.

Wrote a small script for JOSM that will add “nameːml” tags to places without them by searching over a dictionary file (a CSV file with Malayalam counterparts of English names). I have also compiled a sample dictionary from the LSG website.

Installation:

  1. Download “translate.js” and “dict.csv” and place them in the same path and you are done.

  2. You can create your own “dict.csv” using any spreadsheet app and saving the result as a CSV file. Ensure that the first column corresponds to the “name” field and second colomn corresponds to the translated string in the “name:xx” field. Please note that it is important to have the data in the first column sorted in the ascending order.

  3. Modify “name:xx” fields in the script to correspond to the target language.

Usage instructions:

  1. Generate a list of places for translation from OSM using overpass turbo (http://overpass-turbo.eu/). The script that can acheive this is available in the file “overpass_script.txt”.

  2. Download the raw data generated using “export->raw data” as “export.osm”

  3. Import “export.osm” in JOSM.

  4. Install the plugin “scripting” from “JOSM:Edit->Preferences->Plug-in”

  5. Run the script using “JOSM:Scripting->Run”

  6. Upload changes to OSM server

The script and dictionary can be downloaded from here. https://github.com/manuvarkey/JOSM-Translation-Script

Discussion

Comment from lyx on 5 March 2016 at 06:53

Thanks for publishing your script. Any users of this should be aware that using this script would be an “automated edit” where special rules apply. More information can be found at our wiki at https://wiki.openstreetmap.org/wiki/Automated_edits

Comment from PlaneMad on 7 March 2016 at 19:14

Very cool! A spreadsheet is definitely the most convenient interface for translators to use for such a task. You should also check with the Kannada OSM folks how they translated over 35000 objects which is the highest for an Indic language on the map.

This is going to be really really useful for us in India. Thank you so much.

Comment from PlaneMad on 7 March 2016 at 19:15

Btw, this is the Kannada map of the world http://yogiks.github.io/osm-kn/map/

Comment from yogi_ks on 10 March 2016 at 14:43

This can be super useful for Indic languages!

For Kannada, I think users like indigomc have been adding Kannada labels since past 5 years. Lately, I have been adding both Kannada and English labels whenever I create any object with name=* tag in Karnataka region. And for existing objects which have only English label, I use JOSM filter with “name:kn” string to find those objects which don’t have Kannada labels in the region I map and add then Kannada labels to them.

Log in to leave a comment