salam every one, this is a topic from google web master centrale blog:
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. this is a topic published in 2013... to get contents for your blog or your forum, just contact me at: devnasser@gmail.com
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@lang and @dir , at least on the html element:<html lang="ar" dir="rtl"> 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 direction or unicode-bidi . (For XML, the situation changes again. XML doesn’t offer special internationalization markup, so here it’s advisable to use CSS.)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 <link href="default.rtl.css" rel="stylesheet"> just use your existing <link href="default.css" rel="stylesheet"> 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 |
Labels: advanced, general tips, intermediate, localization