Pixaria Gallery Pixaria Websites     Pixaria Gallery | Pixaria Forums | Pixaria Documentation | PopCard.me

Translating Pixaria

As of Pixaria Gallery 2.5, it's possible to translate the front end user interface for use with other languages. The ability to translate the script - a process known as 'localisation' - is provided by means of two PHP files that contain every text string used in the front end of the script.

The localised strings files can be found in the resources/local/ directory and are named according to the code name of the language they contain. The default language in Pixaria is British English and the two files providing this language are en_GB.php and en_GB_emails.php.

Creating a new language

The first step in creating a new language translation of Pixaria is to make copies of the English localised strings files. Once copies have been made, the text strings inside both files need to be edited and the English text replaced by its equivalent in the new language.

You can download the localised strings from version 2.5 here.

Be warned, there are a large number of text strings (over 800) and translating them all may take a significant amount of time.

Guidelines for translation

Unlike in English, most languages make use of extended Latin character sets, accented characters or completely different alphabets such as Cyrillic. To accomodate this, Pixaria's languages files use UTF-8 encoding which enables them to hold characters for most modern languages whether they are based on the Latin alphabet like Turkish or are entirely different like Greek.

To ensure that edited files work with Pixaria it is essential to preserve the file's UTF-8 encoding when editing and ensure that there is no byte order mark (BOM) on the file. In order to do this, it's necessary to use a text editor that supports saving files as UTF-8 with no BOM. Windows Notepad and Mac OS X TextEdit cannot do this and should be avoided.

For multi-byte character sets such as Kanji or Traditional Chinese, it may be necessary to save the language file in UTF-16 format. For help with this, please contact the developer.

Awareness of PHP variables

Many of the text strings in the localised string files contain PHP variables which are needed to show certain bits of information which change depending on the context.

PHP variables can be recognised because they always begin with a backslash symbol followed by a dollar sign like this:


\$my_variable

These variables must not be edited as they are required in order for Pixaria to function properly.

Testing your localisation

To test your localisation, you will need access to a working Pixaria 2.5 installation where you have FTP access to the hosting website. Once you have a website to test the translated interface on, the first step is to find the file localisations.xml (in resources/local/) and open it in a text editor capable of saving files as UTF-8 encoded with no BOM (as above).

When you've opened the file, you will find XML data that lists a range of European languages ordered alphabetically by the local name of the language. As of version 2.5.0, the list contains every official European Union language plus Russian, Welsh and Mexican Spanish.

The first step is to check to see if the language you wish to test is in the list. If it isn't in the list, then you will need to add it yourself and is easily done by copying the following code for the German language, pasting it into the localisations.xml file and changing the attributes for the new language:


        <language code="de_DE" enabled="0">
            <name>Deutsch</name>
            <name_en>German</name_en>
        </language>

You will need to ensure that you change the 'code' attribute to match your language and country in the format shown and then add the local name of the language followed by the English name of the language.

Once you've located the language you're translating or have added it to the file, change the 'enabled' attribute for the language to '1' and save the file back to your web server. This process will enable the language so it appears in the drop down list of available languages on the 'General Settings' admin control panel.

The final step is to upload versions of the language files for user interface strings and e-mail making sure that you use the same 'code' from the XML file as the prefix for the filename. As an example, German files would be named:


resources/local/de_DE.php
resources/local/de_DE_email.php

Submitting a new localisation

To submit a new localisation for inclusion with the Pixaria Gallery package, please e-mail the language files to info@pixaria.com enclosing details of the language contained and ensuring that the files are saved as UTF-8 with no byte order mark.

As a thank-you, anyone submitting a successfully approved new localisation will receive a free license for Pixaria!

Go back to contents

Created: Thursday, August 21, 2008
Last edited: Sunday, August 24, 2008


image Pixaria Gallery Divestock