Start Translating a New Language
0.8.8 introduces a completely new way of working. Here is the first documentation on the subject:
1) Active the plugin Internationalization
From that moment on ProjectPier uses language elements found in some tables (i18n*). Initially these tables are empty. ProjectPier simply displays the internal key (an English string) prefixed with a tilde (~). So, now all the labels on your screen look weird (so many ~). Let's load a language. To be able to load a language you need to create a locale.
2) Create a locale
2.a) Click ~administration / ~i18n
2.b) Click ~add locale
2.c) Fill out ~name, ~description (e.g. Japanese, This is the Japanese version for 0.8.8
2.d) Fill out ~language code, ~country code in lower case (e.g ja, jp)
2.e) Set editor to your user id (this will give you access to the load values option)
2.f) Click ~add locale button
Now we can start loading. Loading a language is nothing more than collecting all the files in the language folders and storing the values in the tables.
3) Load language
3.a) Click ~load values
This will show you a page for loading a language from another locale or from the file system.
3.b) Set ~replace to ~yes
We want to replace any values in the database with the new values we are loading. Otherwise, only the difference would be loaded. And there are already values in the database because ProjectPier automatically creates a new value prefixed with ~ when it does not find such an item. Which is quite handy to detect items that were never translated ;-).
3.c) Click the radio button above ~files
We can load a new locale from another locale. In this case we want to load from files.
3.d) Select a language you wish to initialize this locale with
The ~files dropdown shows all the languages found in the filesystem. Simply a list of folders in the /language folder.
3.e) Click ~load
Hoppela! Now all your labels look fine.
Whenever you want to translate something, click Edit values of the desired locale on the Internationalization page. This will show a page with all the language items. Search quickly by entering search data in the input field. Edit a value by clicking on it. This will open up an edit field to allow you editing. Hit Enter to save. Anything else than Enter will not save the changes. Now you can translate real time in ProjectPier. No need to edit files anymore and FTP them to your site.
Note: I need to write a Save values function to let you save the values in a file :-). The file then can be transmitted to me for inclusion in the release ;-).
I have an incomplete translation or a 0.8.6 translation (which is incomplete compared to 0.8.8). What is the best way to get this in the system?
Create a locale and load the incomplete translation with Replace = Yes. ProjectPier will automagically create new language items while you are working with ProjectPier. You can find them easily in the Edit values page because they contain a ~.
I have an incomplete translation or a 0.8.6 translation (which is incomplete compared to 0.8.8) but I want the missing elements to be in e.g. English.
Create a locale and load the incomplete translation with Replace = Yes. Next load the English translation with Replace = No. You will now have a set of translation items of which some are in language X and some are in English.
There is a central place for translators here ProjectPier Translation Central. Ask user engelbert on this site to give you access.
Select language menu
The select language menu (top right in 0.8.8 sp2) still works on the folders in the /language folder. If you are creating a locale with a new language code an/or country code you need to create a folder in the /language folder that has the language code and country code in it with an underscore between it. Remember to put everything in lower case. If you create the folder you will see a new entry in the language select and ProjectPier will use your database locale.
ProjectPier is very easy on language files. Any file (no matter what name) found in /language or any of the plugin language folders is used as language file.
Some languages have an all.php, some have many. The all.php is simply a summary of all the files and makes for easier editing. There are also files in the application/plugins/.../language folders. If you want you can collect all files in all language directories into 1 file. To get started:
Navigate to the /languages folder inside your development ProjectPier setup. Copy the en_us folder, and give it an appropriate name. (You have to follow the naming conventions(1) or your translation will not work.) This will be the template for our translation. In the rest of this guide we shall reference the template folder as the xx_yy folder
In the xx_yy folder there will be a file named en_us.php, change the filename so it represents your language. (check the naming conventions(1) ) You do not have to change anything else in this file.
Also in the xx_yy folder will be a file called all.php. This is the file we are going to translate in our own language. Open all.php in your favourite code editor.
You notice that there are a whole lot of strings in this file all like the ones below:
'username' => 'Username',
'password' => 'Password',
The part before
=>is the part ProjectPier uses as a reference so do not change it!!!
The part after
=>is the part you need to change to your own language.
Make sure you never delete any of the apostrophe characters, if you do delete one or put in one too many, ProjectPier will no longer work, and you will have to go trough the entire translation to find the error.
(1) : Translation folders have to follow these naming conventions: xx_yy.
Where xx is the "languagecode". (en for English, de for german, nl for dutch, ...)
And where yy is the locale. (ar for Argentinia, us for America, gb for Great-Brittain, ...)
xx and yy always need to be in small letters not capital letters.
For 0.86 and earlier versions you need to translate files. This can be done for 0.8.8 as well but the integrated solution is much easier.
Tools Of The Trade
Go to this page and check some of the tools you can use to translate ProjectPier.
You also need something to get started with. Best is to start with the English included in your ProjectPier installation.
There are however some translations that are already finished, or in development. Below you can find a list.