Tag Archives: website localization

Lost in Traslation

Is your website speaking your customer's language?

 

Lost in Traslation

Lost in Translation

There are many important reasons to have your website translated into other languages

  • Over 100 million people access the Internet in a language other than English.
  • Over 50% of webs users speak a native language other than English.
  • Visitors stay for twice as long on sites with content in their native language.

The most important reason? Web users are four times more likely to purchase from a site that communicates in the customer’s own language!

You know having a localized website is an important step in running a global business but how can you be sure that your website is translated properly? There are many tools available for free web page translation but it is important to realize these services provide a “gist” translation and they are not always accurate or truly localized. Professional website translation is the only way to guarantee that your site is truly localized and speaking your customer’s language.

With professional website translation the translation process is very similar to the translations of documents. You work with your website administrator to provide the source files to your Verbatim Solutions account manager who will determine a word count and provide you a quote. Once the quote is approved, the source files are given to our team of experienced website translators who then begin to translate your content into a truly localized version of the original.

Can I just send you a link to my website?
This is actually the least accurate way to get a word count for your website. Only you and your website administrator know exactly what content is on your site. Automated tools that claim to capture complete site content can miss things.You should send your account manager the source files; this allows them to get an accurate word count. Here are some examples of source files your website may use:

HTML XHTML XML FLASH JAVA CSS ASP PHP

Our translation team uses specialized tools to work directly in these source files without disrupting the code. This allows you to upload the completed files to your server once they are ready; saving you time and money! If you have more questions about website translation services contact your account manager.

> Learn More

> Get Instant Quote

Help your Website Communicate Better

Language Translation Services Can Help!

Do you have a web presence to support your business goals? Do you think your website would better serve your present and future customers if it was offered in multiple languages?

If so, then language translation services for your website may help you boost your website’s usability and ultimately your organization’s bottom line. To determine if translating your website is warranted, carefully evaluate your business needs and establish performance indicators to measure your success.

If you decide that translating your website makes sense, consider these eight tips that will help you ensure the translated website is just as effective as your English one.

  • Avoid including content that is still in English. For people in other countries or those for whom English is not their primary language, it can be insulting to include text that is still in English.
  • Ensure that your language translation services provider uses the local measurement systems, date format, punctuation, decimal system and colors so that no cultural sensitivity issues arise.
  • Provide a subject glossary to the language translation services provider related to the content of your site so that the translator will understand the theme, context and tone of your site’s content.
  • Ensure that the English site uses simple, clear, and formal sentences and phrases. Also, try to keep sentences short, limiting them to 15-20 words for best results. For your translated site to be successful, it is best to avoid unnecessarily complex words and sentences.
  • Avoid ambiguity in your English site by not using words that have more than one meaning (for example, using the word painting instead of picture).
  • Before handing over your English text, do a strict double check of spelling and grammar, because incorrect spelling or grammar will lead to translation errors.
  • Try to avoid the use of complicated punctuation marks such as parentheses and hyphens. In order for your language translation services provider to be successful with your website translation, it is important to avoid abbreviations and lingo.
  • When the translated website is complete, do some testing to ensure the site looks good and works properly. Have someone well versed in the translated language check the visuals first. Then check to make sure that all necessary pages have been uploaded and translated, all the links are working and that the translated text can be viewed properly.

Think of your language translation services provider as your partner in the development of your translated website. If you work with a company like Verbatim Solutions, they will work with you every step of the way to ensure your new website meets your business goals.

Verbatim is a trusted provider of translation services to small and Fortune 500 companies worldwide. Their impressive client list, commitment to exceeding translation quality standards and affordable rates make them the ideal partner for all your translation needs – for your website and beyond.

Translation & PHP

Translating only implies simple string translation of code, you may do it in a clever way or a painful (very) way scanning all the code and translating strings. This method tends to produce errors (Have you ever seen a site in Spanglish?) and it is not reusable, just a patch. Internationalization defines a strategy to build sites and applications that you can easily translate into other languages. This is the goal of this article.

Enter GNU
GNU has a very good set of tools to produce internationalizable applications called gettext, it was developed with “C” and “C++” applications in mind but is also very easy to use in other languages such as PHP. Gettext is probably installed on your Unix station, try a gettext command like ‘gettext’ from the command line to see if you have it. If not (rare) download the package from ftp.gnu.org and install it. If you have gettext the next stage is to use it from PHP.

Internationalizing PHP Scripts
To use gettext in your PHP scripts you’ll have to modify all your scripts, however this will have to be done only once. The modifications are not very difficult and you’ll probably want to build some utility to scan the code and prompt ‘want to modify this?’ etc… If you don’t want to do that, no problem at all. So what do you have to do in your code? Very simple just replace all the “strings” with something like:

print(_(“Hello world”));

Yes, you use the very unknown PHP function “underscore”, which is an alias to the not-short-to-write “gettext” function. Every string that you may translate sometime will have to be translated. Once you get used to this and see the advantages you’ll find that you always write your strings wrapped with the “_” function.

Extracting Strings from the Code
Gettext provides a utility called ‘xgettext’ to extract all the strings from your scripts to a file called a “po” file, you have to use:

$xgettext -a src/*.php

To extract all the strings. Read the GNU’s documentation for ‘xgettext’ for more options . After xgettexting your code you will have a ‘messages.po’ file which may look like this one:

# SOME DESCRIPTIVE TITLE.

# Copyright (C) YEAR Free Software Foundation, Inc.

# FIRST AUTHOR , YEAR.

#

#, fuzzy

msgid “”

msgstr “”

“Project-Id-Version: PACKAGE VERSIONn”

“POT-Creation-Date: 2000-12-08 19:15-0300n”

“PO-Revision-Date: YEAR-MO-DA HO:MI+ZONEn”

“Last-Translator: FULL NAME n”

“Language-Team: LANGUAGE n”

“MIME-Version: 1.0n”

“Content-Type: text/plain; charset=CHARSETn”

“Content-Transfer-Encoding: ENCODINGn” #: prueba.php:12

msgid “Hello world”

msgstr “” #: prueba.php:12 prueba.php:13

msgid “”

msgstr “” #: prueba.php:13

msgid “This is a test”

msgstr “”

This will be the file that you have to pass to translators, they will have to set msgstr for each entry to the proper translation of the string for the target language. You can add comments (using #comment) for each entry to provide context if needed such as:

#: prueba.php:12

# This is displayed at the beginning of the script

msgid “Hello world”

msgstr “”

Etc, after this you have a “master” po file where all the msgstr strings are “”. Using gettext on a string that is not translated will simply output the msgid. This is a good feature.

Once translators have translated the ‘messages.po’ file, you’ll have several files for different languages. It is time yo use them from PHP.

Producing mo Files

You have to produce a .mo file to use gettext, this is done using the ‘msgfmt’ command for each .po file:

$msgfmt messages.po -o messages.mo

Setting up Directories

The best way to use gettext is to build a “locale” directory in some branch of your code tree and inside this directory you create one subdirectory for each language, inside each language’s direcory you create an LC_MESSAGES directory, where you put .mo and .po files for the language. Example:

/src

/locale/en/LC_MESSAGES/messages.mo

messages.po

es/LC_MESSAGES/messages.po

messages.mo

Use this URL http://lcweb.loc.gov/standards/iso639-2/bibcodes.html#op to find the 2 character codes for languages. It’s nice to follow standards…

You’d probably start liking your “neat” structure of languages a lot, you are ready to decide which language to use in PHP, simply add, in your main script, this code:

// Set language to Spanish

putenv (“LC_ALL=es”); // Specify location of translation tables

bindtextdomain (“messages”, “./locale”); // Choose domain

textdomain (“messages”);

The important line is putenv(“LC_ALL=es”) which basically tells which language to use, with this PHP will use your /locale/es/LC_MESSAGES/messages.mo file to translate all the strings. If you want a different language just change:

putenv (“LC_ALL=en);

And “auto-magically” you have an English application.

Conclusions and Code
Gettext is a very good way to standardize your PHP code to support internationalization, you modify or write your code only once and you can have your site or application in several different languages with only a minor modification. One side effect of this strategy is that you have to make sure that all the strings are set in the content or logic layer not in the presentation layer. If you use XSLT to parse XML generated from PHP for example you’ll have to make sure that no strings are added in the XSLT layer. I think this is quite good.

In inter.tar.gz you’ll find a subtree that you can put wherever you want inside your document tree, I ship examples in English and Spanish, change the environment variable from “en” to “es” and browse “prueba.php” (the Spanish file),and see the changes. Edit the .po files and rebuild the .mo files using msgfmt to play the translator role. As perl fans says “there are many ways of doing things…” this is a neat one, try it.