WS.WebTV: Create/Edit Language Pack (Advanced Customization)
support, ws.webtv, advanced, customization, language, pack
1. Start by configuring the WebTV to load language files with every page view
Go to Configuration > General tab > Regional Settings > Read language files once per session: set it to "No" (and Save).
2. Locate the language folder
Front-End language packs: They are located in the folder langs/frontend/<language_code>/
Back-End language packs: They are located in the folder langs/backend/<language_code>/
Each language folder contains a k_lang.js and a k_lang.txt file:
3. Download the files to your computer and edit them
Download the .js and .txt files to your computer and edit them. Please note that they are plain text, UTF-8, files.
You can use any plain text editor like Notepad, Notepad2, Notepad++, Dreamweaver, etc.
TIP: Add or modify text to/from k_lang.txt without changing the original file.
Since WS.WebTV 2.1.0.1 it is possible to include a custom.txt file into langs/backend/<language_code>/ or langs/frontend/<language_code>/. The custom.txt must be formatted just like the k_lang.txt file (it must also be an UTF-8 encoded, plain text file). All the text entries from the custom.txt file will be added to the k_lang.txt file or, in the case of duplicated indexes, replace the original texts. Therefore, this is a good way for customizing texts because every time the WebTV is updated, the custom.txt files will remain unchanged.
4. Upload and refresh
Upload the edited files to the server (overwriting existing ones) and refresh the WebTV page to see the changes.
5. Done editing
When you are done editing the language files, go to Configuration > General tab > Regional Settings > Read language files once per session: set it again to "Yes" (and Save).
Loading language files once per session improves the system performance; therefore, if you are not editing language files, it is recommended to set the value as Yes.
1. Start by configuring the WebTV to load language files with every page view
Go to Configuration > General tab > Regional Settings > Read language files once per session: set it to "No" (and Save).
2. Duplicate an existing language Pack folder and rename it using a two-letter ISO language code
In order to know the two-letter code for your language, please visit the following page and look for the column "639-1", which cointains the two-letter code of every language: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
Example: English = "en", Spanish = "es", etc...
NOTE: You can also use country-specific language codes like "es_ES", "en_UK", etc.
The language code must match the folder name
For this tutorial we have duplicated the "en" folder and rename it to "eo" in order to create an "Esperanto" language pack:
3. Add the new language into the WebTV configuration file
Edit the config/Config.inc.php file and add the following line:
$CUSTOM_FRONTEND_LANGUAGE = array("eo"=>"Esperanto");
IMPORTANT: The config file is ASCII.
If you need to include Unicode characters do it by using HTML Entities or HTML Unicode values (&#nnnn;).
For example: "Română" = "Română"
(Upload the modified Config.inc.php file, overwriting existing one...)
4. Verify the new language is listed in the WebTV ...and select it
The new language should appear in Configuration > General tab > Regional Settings:
Select it and Save...
5. Edit, upload and refresh
Now, that you have selected the new language, you can start editing your files.
Upload the edited files to the server (overwriting existing ones) and refresh the WebTV page to see the changes.
6. Done editing
When you are done editing the language files, go to Configuration > General tab > Regional Settings > Read language files once per session: set it again to "Yes" (and Save).
Loading language files once per session improves the system performance; therefore, if you are not editing language files, it is recommended to set the value as Yes.
1. Start by configuring the WebTV to load language files with every page view
Go to Configuration > General tab > Regional Settings > Read language files once per session: set it to "No" (and Save).
2. Duplicate an existing language Pack folder and rename it using a two-letter ISO language code
In order to know the two-letter code for your language, please visit the following page and look for the column "639-1", which cointains the two-letter code of every language: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
Example: English = "en", Spanish = "es", etc...
NOTE: You can also use country-specific language codes like "es_ES", "en_UK", etc.
The language code must match the folder name
For this tutorial we have duplicated the "en" folder and rename it to "eo" in order to create an "Esperanto" language pack:
3. Add the new language into the WebTV configuration file
Edit the config/Config.inc.php file and add the following line:
$CUSTOM_BACKEND_LANGUAGE = array("eo"=>"Esperanto");
IMPORTANT: The config file is ASCII.
If you need to include Unicode characters do it by using HTML Entities or HTML Unicode values (&#nnnn;).
For example: "Română" = "Română"
(Upload the modified Config.inc.php file, overwriting existing one...)
4. Verify the new language is listed in the WebTV ...and select it
The new language should appear in Configuration > General tab > Regional Settings:
Select it and Save...
5. Edit, upload and refresh
Now, that you have selected the new language, you can start editing your files.
Upload the edited files to the server (overwriting existing ones) and refresh the WebTV page to see the changes.
6. TinyMCE Language Pack
TinyMCE is the WYSIWYG HTML editor that WS.WebTV uses. If you want to use a specific language pack for TinyMCE, then do the following:
6.1. Download the corresponding language pack (in "js" format) from the following URL:
http://www.tinymce.com/i18n3x/index.php?ctrl=lang&act=index&pr_id=7
6.2. Copy the language pack files into the corresponding folders. The TinyMCE location is public/backend/js/tiny_mce/
6.3. Specify the TinyMCE language code in the WebTV language pack: look for "tinymce_language" index. Example for Thai:
tinymce_language => th
NOTE: The language code can also be found the the aforementioned download URL, in the "Code" column.
7. Diagnostics Tool Language File
The WebTV Diagnostics tool uses separate language files. In case you want to add a language, or edit an existing one, then:
7.1. Locate the Diagnostics tool language files (support/diagnostics_lang_{language_code}.txt). For example, the English language file is "support/diagnostics_lang_en.txt".
7.2. Like the other WebTV language pack files, create/edit it using a plain text editor and save it with UTF-8 encoding.
NOTE: In case there is no matching language file for the selected Back-End language then the English texts will be used.
8. Done editing
When you are done editing the language files, go to Configuration > General tab > Regional Settings > Read language files once per session: set it again to "Yes" (and Save).
Loading language files once per session improves the system performance; therefore, if you are not editing language files, it is recommended to set the value as Yes.
9. The help files!...
Once you have finished editing your language pack files, don't forget to translate the help files.
Help files are HTML files that are located in public/backend/help/xx folder. There is a folder per language. The folder name must match the language code. The procedure is similar to the previous steps: Duplicate the "en" folder and rename it according to your language code (since, for this example, we are creating an Esperanto language pack, the new folder would be public/backend/help/eo ). Then download the files to your computer; translate them and upload then again to the server.
Advice: Always keep track of any modification you make to the WebTV so you can re-apply it after updates or reinstallations.