As website localization gains in importance, developers and integrators can use a number of tricks upstream to simplify their work during the process of localization.
Which step comes before localization ?
A website is not only composed of textual content. You also have to adapt graphic and multimedia elements to the language and culture of the targeted visitors. This is what we call localization.
Before even beginning to create a website, a preliminary step helps speed up localization and allow you to save significant amounts of time and money in the long run. This step is called internationalization. It refers to the process of conceiving your product in the most neutral possible way, rendering its subsequent localization a much simpler task. Without this step, any future localizations you plan for your site could be quite expensive. Let’s have a look at some useful tips:
1. Publish your page in the appropriate language
If a website user has not selected a specific language, the server can retrieve the browser or operating system’s language settings by use of HTTP_ACCEPT_LANGUAGE. If the user has selected a language, make sure that the information is stocked in a cookie and that the server will later prioritize the language in which the page was last viewed.
2. Choose the correct encoding
Encoding involves associating a unique combination of bits to each character in the graphic system of a language or group of languages. This system unfortunately entails a universality problem. For instance, latin-1 encoding (or ISO-8859-1) accounts for most Western European writing systems but cannot correctly display cyrillic characters.
UTF-8 encoding is the most adapted to internationalization. You can indicate it in the header of your HTML file, with the following tag: <meta charset=”UTF-8”>.
3. Use escape characters sparingly
Escape characters allow you to represent any Unicode character by using only ASCII characters. For example, é represents the character é. Avoid them as much as possible because they increase the size of the file and can lead to unreadable content. The most appropriate solution is to use Unicode encoding (e.g. UTF-8) and only use escape characters in cases where they risk being interpreted as HTML elements. The most useful escape characters are the following:
- < (<)
- > (>)
- & (&)
4. Adapt to character size
Depending on the language, the size of text-occupied space varies according to the number of words, the character width, and the height of line spacings. Text might therefore no longer fit in its allotted space after translation. Sylverdrag proposes two solutions:
- Use a flexible display format whose sections can easily expand or contract, using max-width or max-height, for example. If the problem persists, there is also the option of displaying only the first part of a text and adding a “Read more…” link that will redirect users to the complete article. If you do not wish your text to be cut mid-word, have it fade out in front of the redirection link.
- For menus and buttons, identify the one with the lengthiest content and adjust the others accordingly by use of blank spaces.
5. Let your users know where they are on your site
One user-friendly touch not to be neglected is a visual cue of some sort that indicates to the user which page he/she is currently on. There are several different ways to do this, depending on the structure of your site. Some sites will display a line of text detailing the path that led to the present page. A more simple solution is to graphically indicate the active page directly in the menu bar (e.g. a tab effect, different colour, smaller border). In both cases, use PHP to add an “active” class to the indicator element and define a unique CSS style for that class.
6. Write effectively
Finally, text that is simple and concise will be easier and quicker to translate. You should also keep in mind that your website might not be available in the languages of all your users, and that some will need to read the content in a language that is not their own. Make sure this task is as simple for them as possible.
All of these tips will allow for a more efficient localization in terms of both time and money. For more useful tips, you can visit https://www.w3.org/International/quicktips/
Translation by Madeleine Barois