When we enter the website, the sentences shown in the Flash banner will be in its original language, which is English. The variable and data (sentences) that shown in the Flash are stored in a php file. When want to change the contents of website to another language, the php file will call to translation part.
Process of forming the translation file are as below:
A tool, gettext is run in order to extract all the translatable strings from the sources (which stored in php) and implant them in a single .POT file.
This .POT file is actually a .PO (Portable Object) template that you distribute to your translators in order for them to translate it.
The translators will send you back a .PO file, containing both the original English version and
the translated strings.
After that, compilation of the .PO file into a .MO (Machine Object) file is done. It is stored at
the correct place in the defined directory and file naming organization.
Then, the _() function in the php file will automatically display the translated strings in the Flash banner at that website, depending on the locale set at runtime.
Flash file
We used Flash as the platform to display the data that are called from a php file. Inside Flash, a set of Action Script is written in order to get the data from php file that is stored in server. A simple script will load the php file and get the variables contain in it and output the data in text field which is located in the flash. Below are the coding part:
PHP
The php file will get call from script. Once the data are checked, it will call the translation part. The _( ) function in php file is very important as the data written within the brackets will be the gettext for file.PO.
Below are the variable and data for php file:
Translation
When php file calls for translation, the data within _( ) function will be the gettext in form of file.PO. This is the language that read by human. Once the file is saved, the PO program will auto generate the saved file as MO (Machine Object) file. This MO file is actually the language which read by machine.