[JT] Jochen Topf's Blog
Thu 2018-08-09 16:31

Taginfo Localization

An international project like OpenStreetMap needs localized documentation. Ideally everybody can use OSM and contribute to OSM knowing only their own language. Of course we are far away from that goal and will probably never fully reach it, but it is worth the effort to try to get there. Taginfo did an important step into the right direction in the last weeks.

Taginfo has supported multiple languages almost from the beginning. Most of the user interface is set up in a way so it can be translated (the exception are mostly “internal” pages directed at developers) and many users have contributed translations of the 407 words, sentences and longer texts that taginfo uses. All together we are currently supporting 18 languages.

Recently GitHub user iriman supplied the translations for the Farsi (Persian) language (فارسی) used mostly in Iran. Unlike all the other languages that taginfo supported up to that time, Farsi is written from right to left. As you might imagine, this brought some complications…

The taginfo pages are more difficult to localize than probably most web pages, because they almost always contain parts from several languages. Tag keys and values are usually in English while tag descriptions are from the Wiki and will be shown in the language the user chooses (or in English if the Wiki doesn’t contain a translation). Some pages (like the wiki tab on key pages) contain many different languages.

But it turns out modern browsers support all of this relatively well. Every element in the HTML can get a lang attribute that tells the browser which language something is in and additionally a dir attribute telling the browser whether this element should be written left-to-right (ltr) or right-to-left (rtl). We added these attributes to many tags and iriman supplied many changes to the CSS to make it all work well and look nice. The result is not perfect but pretty good. Some compromises are necessary when trying to decide whether to make each table or other element left-aligned or right-aligned for instance. Users of left-to-right languages will see almost no differences, but for the Farsi speakers it looks much better now and we are well-prepared for more languages. Arabic or Hebrew anyone?

Want to contribute to the translations? Whether you can supply a completely new translation or some additions to an existing one, read the Taginfo/I18N wiki page to get started.

Tags: openstreetmap · taginfo