Tuesday, October 13, 2009

Maps API v3 Now Speaks Your Language

Good morning! G'day! Bom dia! Bonjour! доброе утро! 早安! നമസ്കാരമ്! доброго ранку!

This is how we, members of the Maps API team, would salute each other if we decided to use our native languages in the mornings. And those are just a minuscule sample of the multitude of the native languages for Googlers all over the world.

But this is only one of the reasons we are so passionate about translating our products to as many languages as possible. Our mission is to organize the world's information and make it universally accessible and useful. Providing our services in the native tongue of our users goes a long way towards achieving the universal accessibility and usefulness aspects of our mission.

Today, we are proud to announce that the Maps API v3 is now available in 40 languages, in addition to US English. You can find the list of languages here. (Right to left languages are notably missing from this list, as we still have some work to do before we can support them.)

Most developers won't need to do anything to take advantage of the new translations, our servers will decide what language to provide based on the browser's preferred languages settings.

Developers can override that behavior (and force all of their users to see one language) by specifying a parameter in the script tag. For instance, to force UI controls to always be displayed in Brazilian Portuguese, use:

  <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=pt-BR">
Map tiles may also vary slightly according to where in the world you or the bulk of your audience is. You may also want to bias geocoding results towards a specific region. "Newcastle", for instance, will geocode to different locations depending on whether you are more interested in American, British or Australian places.

Again, you can override the region biasing by specifying a parameter in the script tag. For instance, to bias your application towards British results, use:

  <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false®ion=GB">
For more in-depth information about localization of Google Maps API v3 maps, please refer to the documentation. As always, you can send feedback and questions via the forum.