How To Internationalize Your Website

How To Internationalize Your Website

When your website is in its infancy, internationalization, or the process of converting your website to be readable in many different languages, is not necessary.  There are considerations that should be thought about from the onset of the site to make future internationalization a possibility.

Here are some of those considerations as listed by Ryan Doherty from StackOverflow:

  • Use UTF-8 everywhere. No exceptions. HTML, server-side language (watch out for PHP especially), database, etc.
  • No text in images unless you want a ton of work. Use CSS to put text over images if necessary.
  • Separate configuration from localization. That way localizers can translate the text and you can deal with different configurations per locale (features, layout, etc). You don’t want localizers to have the ability to mess with your app.
  • Make sure your layouts can deal with text that is 2-3 times longer than English. And also 50% less than English (Japanese and Chinese are often shorter).
  • Some languages need larger font sizes (Japanese, Chinese)
  • Colors are locale-specific also. Red and green don’t mean the same thing everywhere!
  • Add a classname that is the locale name to the body tag of your documents. That way you can specify a specific locale’s layout in your CSS file easily.
  • Watch out for variable substitution. Don’t split your strings. Leave them whole like this: “You have X new messages” and replace the ‘X’ with the #.
  • Different languages have different pluralization. 0, 1, 2-4, 5-7, 7-infinity. Hard to deal with.
  • Context is difficult. Sometimes localizers need to know where/how a string is used to make sure it’s translated correctly.