Interspire Product Knowledge Base

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Export to PDF

User Opinions (22 votes)

45% thumbs up 54% thumbs down

How would you rate this answer?



Thank you for rating this answer.

Localizing your Website Publisher 5.0 language files

Website Publisher 5.0 features a new layered approach to language localization. This was created with future multi-lingual support in mind, allowing multiple languages to be stored in one filesystem.

By default, a US English language pack is provided, consisting of several .ini files plus some javascript and HTML, and is stored in the following location of your Website Publisher installation:

/language/en-US/

The 'en-US' code is an ISO-standard Language-Country Code, consisting of a language code followed by a country code. In this case, en-US defines US English.

A list of language codes may be found here, in the ISO 639-1 column:
http://www.loc.gov/standards/iso639-2/php/code_list.php

A list of country codes may be found here:
http://www.iso.org/iso/english_country_names_and_code_elements

The current language files used by your site is controlled by two configuration variables, defined in a file located at:

/configs/config.php

The two relevant variables are, by default:

$config['BaseLocaleCode'] = 'en-US';
$config['LocaleCode'] = 'en-US';

In this example, I will guide you in beginning a French translation for your Website Publisher installation.

First, you will want to decide on a language code to use. In this case, we will use 'fr-FR'. Without changing the 'BaseLocaleCode', change the 'LocaleCode' config variable to 'fr-FR'.

$config['LocaleCode'] = 'fr-FR';

This will instruct the language subsystem to first load the en-US language files, and then load additional language entries from the fr-FR set, allowing you to add your fr-FR translation without modifying the original language files.

Next, create a folder in the language directory to contain your fr-FR language files:

/language/fr-FR/

Next, find a language entry to translate. For our example, we will choose to customize the welcome message on the dashboard of the control panel. The text begins with "Welcome," so we search our en-US language files for this text and find that it is defined in "admin.common.ini":

DashboardWelcome = "Welcome, %s!"

To create our French version of this, we first create a text file which contains only the following:

DashboardWelcome = "Bienvenue, %s!"

Save this file to your /language/fr-FR/ directory and name it exactly "admin.common.ini" (to match the filename above). Once this is done, simply visit the dashboard of your control panel and you should see:

Bienvenue, (name)!

You may now proceed to customize your language line by line. Should you choose to, you can also create a copy of all the en-US files and place them in the fr-FR direcory and work from there.

Currently, module-specific language entries are separate and have their language files located in one file at:

/modules/{module name}/language.ini

For now you will be required to modify these files directly. This will change in future to use the layered approach detailed above.

Please note that, despite the multi-lingual approach detailed above, there is not currently an interface for "switching" languages. This has been left out intentionally until full multi-lingual support is implemented.

As always, should you have difficulty with this, please lodge a support ticket. However, currently we cannot provide you translated language files.

Related Articles

No related articles were found.

Attachments

No attachments were found.

Powered by Interspire Knowledge Manager - World's #1 Best Selling FAQ and Knowledge Base Software