HOW TO add new language?

Talk and info about common issues

Moderators: ne_moj, zewa

administrator
Site Admin
Site Admin
Posts: 5938
Joined: Jan 7th, '09, 23:18
Contact:

HOW TO add new language?

Postby administrator » Nov 9th, '10, 18:41

The adding new language is a very simple procedure. You have to perform following steps:

1. Log into admin panel and go to: Languages Settings -> Languages page and click on [Add New Language] button.

2. On this page add all needed information, including icon name for new language (it must be placed in images/flags/ folder before)
lang_1.PNG
lang_1.PNG (10.66 KiB) Viewed 6126 times


3. Now go to: Languages Settings -> Vocabulary page and select a new language from dropdown box (translator doesn't work when English selected).

4. Now you have to walk throw all vocabulary keys and translate them into new language. Online Google translation feature will help you to do this. To make it works set English as a default language, select Preferred Language in My Account also English, then open Vocabulary page and select any constant for editing. You have to see following on your screen:
lang_3.PNG
lang_3.PNG (6.46 KiB) Viewed 6119 times


NOTE: Google Translate is available now as a paid service ONLY:
http://code.google.com/apis/language/tr ... html#intro

You may also update vocabulary by uploading vocabulary file. To do this simply select appropriate language, then click on [ Upload from File ] link, select vocabulary file and upload it. MicroCMS will automatically update the vocabulary table.
vocabulary_upload.png
vocabulary_upload.png (33.58 KiB) Viewed 5960 times


5. To make changes work - you have to re-write vocabulary files. To to this simply go to Languages Settings -> Languages, select appropriate language from dropdown box and press on [Rewrite Vocabulary] button.

6. Here you can find some localizations, prepared by our members:
1. Hebrew: (provided by Eli A.)
messages.he.inc.zip
(13.32 KiB) Downloaded 398 times

2. Albanian: (provided by Alfa Studio)
messages.sq.inc.zip
(20.47 KiB) Downloaded 206 times

3. Traditional Chinese (provided by Nick Chang)
messages.tw.inc.zip
(12.52 KiB) Downloaded 194 times


7. Video Tutorial

administrator
Site Admin
Site Admin
Posts: 5938
Joined: Jan 7th, '09, 23:18
Contact:

HOW TO translate the site (solution from contactovisual)

Postby administrator » Aug 8th, '12, 08:11

You can get the CSV file from the database table "vocabulary"

Here's what you can do:
1. Access the database of apPHP Hotel Site
2. Find the table vocabulary. Probably, the last one (mine is aphs_vocabulary).
3. Filter by language, to get only the english (language_id = en)
4. Export the result as CSV. It's better to use TAB field separator because comma conflicts with text, but you can experiment and try different options
5. Open with Excel or any other CSV reader, replace the language_id (en) by your language code (mine is pt), translate the column key_text (do not touch the key_value content), and save it
6. Re-import to database, make sure not to use the id number, it must be auto-increment

Now you have the vocabulary of your language in the database. Next step, you need to write it down to the the messages file. This is done in the administration.

7. Duplicate file messages.inc.php and rename it messages.xx.inc.php where xx is the two characters of your language code (mine is messages.pt.inc.php)
8. Upload the file to server (inside folder include)
9. On the site Administration, make sure you already have your language active, and select the option Vocabulary.
10. Select your language, and click on the button Rewrite Vocabulary on the top right. This will write the translated text of your language stored on the database to the file messages.xx.inc.php

Done. You have now the site translated.


Return to “ApPHP MicroCMS {HOW TO}”