नमस्कार • Namaskār
At Mapzen we are lucky to have people who speak a wide variety of languages on the team and the support of a vibrant open source community. Before today, Valhalla, our open source routing engine had six languages - Czech, English, French, German, Italian and Spanish. Today we have added हिंदी (Hindi) 🎉 making it seven and another step closer to a more universal routing engine! This means you can now build applications with written and spoken routing instructions in 7 different languages! (And shiver me timbers! We also have special support for pirates.)
Here are Hindi navigation instructions in action on our Android app, EraserMap, along Bistupur Road in Jamshedpur, Jharkhand:
What’s so special about Hindi you ask?
Hindi is spoken as a first language in northern and central India by more than 258 million people and by another 9 million in Nepal. The Hindi diaspora numbers in the millions: Mauritius, South Africa, Yemen, Uganda, the United States and Canada all have more than 100,000 speakers each. Such a wide distribution makes Hindi one of the most spoken languages of the world, and personally important to Varun and me.
Thejesh GN wrote a great post about the localized and regional languages in India and their coverage and representation in OpenStreetMap. No mapping provider currently offers routing guidelines for all Indian regional languages. Google currently offers navigation in Hindi and MapMyIndia offers a handful of regional languages for subscribers. We’d love to see more languages available as open data, and we’ll show you how you can do it!
Picking the right words
Voice matters. How to choose the words and the tone of the navigation instructions? First, a little bit about Hindi. It is considered to be a Category II language in terms of difficulty for speakers of English1. The word order is typically subject-object-verb as compared to English which has subject-verb-object. It draws much of its vocabulary from Sanskrit and is a highly inflected language which utilizes prefixes and suffixes to form words and to express grammatical relations. To give an example, second-person personal pronouns are marked for three levels of politeness:
- singular form ‘tu (तू)’: informal, extremely intimate, or disrespectful
- singular form 'tum (तुम)’: informal and showing intimacy
- plural form 'aap (आप)’: formal and respectful
For our navigation instructions, we decided to use the formal and respectful tone: ‘आप अपने गंतव्य पर पहुंच चुके हैं’ instead of an informal one: ‘तुम अपने गंतव्य पर पहुंच गए हैं’.
A lot our discussions ended up weighing a more accurate Hindi translation against what works for a navigation system and scalability. For example, when looking at terms for lengths we started with translating every measure like '1/10th of a mile’ to 'एक मील का दसवां’ and 'less than 10 feet’ to 'कम से कम 10 फुट’. These translations, though accurate, were not easy to scale to every possibility of a fraction, and 'less than 10 feet’ in Hindi is very different from 'in a little over 10 feet’. The interesting thing we realized was that when speaking in Hindi, especially in India, people will often mix in English words and numbers. A lot of the words in Hindi have come from English. So to make these sentence structures adaptable and easy to scale to different combinations of fractions and measures, we decided to go with 'मील का 1/10 हिस्सा’ for '1/10th of a mile’.
Hindi, like French and Spanish, uses grammatical gender. This got really tricky when constructing phrases that might contain street names that could be either masculine or feminine. (India has most of its street and road named after politicians, freedom fighters and Bollywood celebrities). Also, in most cases the words 'road’, 'street’ or 'marg’ (which means tertiary road) are included within the street name and are hard to separate out.
For example, we debated the usage of the linking verb 'becomes’ as feminine (जाती) or masculine (जाता):
"Vine Street becomes Middletown Road." > "Vine Street Middletown Road बन जाती है." OR "Mahatma Gandhi Marg becomes Link Road" > "Mahatma Gandhi Marg Link Road बन जाता है."
Our efforts are not limited to routing. We recently wrote about supporting Indian lanugages in our map rendering engine, Tangram. Valhalla is a 100% open source routing engine and we want to invite YOU, our language experts around the world, to add language(s) for routing instructions, or even make changes and help us improve existing ones. We really want to make a better and more intuitive routing experience for everyone, no matter what language they speak.
How to contribute your own language
To get started, go to Valhalla/ODIN repository and follow the instructions in the README. A few guidelines:
Do not translate the JSON keys or phrase tags. An example using the ramp instruction:
Please DO translate the JSON values. As needed, reorder the phrase words and tags - the tags must remain in the phrase. An example using the ramp instruction:
(Don’t have a Github account? No problem! Follow the steps above to translate the routing instructions file in your language and email it to us at email@example.com)
If the task looks too daunting, just start a new language – someone in the community can help finish it!