Posted: 31 May 2013 05:16 AM PDT
Note from the editors: After previously looking into various ways to handle internationalization for Google's web-search, here's a post from Google Web Studio team members with tips for web developers.
Many websites exist in more than one language, and more and more websites are made available for more than one language. Yet, building a website for more than one language doesn't simply mean translation, or localization (L10N), and that's it. It requires a few more things, all of which are related to internationalization (I18N). In this post we share a few tips for international websites.
1. Make pages I18N-ready in the markup, not the style sheetsLanguage and directionality are inherent to the contents of the document. If possible you should hence always use markup, not style sheets, for internationalization purposes. Use
Avoid coming up with your own solutions like special classes or IDs.
As for I18N in style sheets, you can't always rely on CSS: The CSS spec defines that conforming user agents may ignore properties like
2. Use one style sheet for all localesInstead of creating separate style sheets for LTR and RTL directionality, or even each language, bundle everything in one style sheet. That makes your internationalization rules much easier to understand and maintain.
So instead of embedding an alternative style sheet like
just use your existing
When taking this approach you'll need to complement existing CSS rules by their international counterparts:
3. Use the Since we recommend to stick with the style sheet you have (tip #2), you need a different way of selecting elements you need to style differently for the other directionality. As RTL contents require specific markup (tip #1), this should be easy: For most modern browsers, we can simply use
|You are subscribed to email updates from Google Webmaster Central Blog |
To stop receiving these emails, you may unsubscribe now.
|Email delivery powered by Google|
|Google Inc., 20 West Kinzie, Chicago IL USA 60610|