This is an old revision of the document!
These instructions will walk you through the steps needed to use any of the Language Translations provided in the public downloads on our site.
<tip c n>Note: The template sets with translated text in them that are available on our site, only contain the templates that have translations in them, in other words the templates that have no changes from the default templates are not included with the template set. To get a "full" template set so that you can have all the templates in one place, you can use the Merge Sets Together button in your admin panel after you have followed the instructions above. What you would do, is make sure the translated template set is above yours in the list of template sets, then use that tool to merge the new template set with your main template set. If you do not yet have your main template set created, you can create one with the Create Main Template Set button near the bottom of the page.</tip>
If you use a single language on your site, the instructions above are all you need to import and use the language based template set you need. If you have a multiple language website, and want to make it load a different template set for each language, you can do that by following the instructions below.
Skills
Instructions
<?php ########################################### ## Auto-generated file ## It is not recommended to edit ## this file directly, but you can ## if you want. ## ## Generated: Oct 5, 2010 17:07:16 ########################################### /** * To manually add your own template set, use the syntax: * * geoTemplate::addTemplateSet('folder_name'); * * Where folder_name is the directory name, relative to this current directory. * NOTE: Default template set is always added by system as the last template set * to load. You do not need to add the default tempalte set here. * * If you do not wish manual changes to be overwritten next time admin makes a * change, be sure to put them in the "custom section" below. */ if (!defined('IN_ADMIN')) { # [CUSTOM SECTION] # //Anything manually added to this section will be left intact even if changes //are made in the admin panel. //BOO! # [/CUSTOM SECTION] # } geoTemplate::addTemplateSet('my_templates');
If you are still only using the default template set, that last line will be replaced by a PHP Comment stating that there are no template sets. If that is the case, that means you did not follow step 3 above correctly, follow that step and make sure you have your main template set active. <
$languages_map = array ( 24 => 'my_templates_french_5.1', 25 => 'my_templates_arabic_5.1', );
In that example, it maps language ID 24 to the template set my_templates_french_5.1 and the language ID 25 to the template set my_templates_arabic_5.1. This is just an example, unless your site happens to match that mapping exactly, you will need to create one that matches for your site. If you need some help you may ask in the user forums for some help, just reference this tutorial and post what ID goes to what template set for your site. Someone should be able to help you create what you need. <
$session = geoSession::getInstance(); $current_language = $session->getLanguageId(); if (isset($languages_map[$current_language])) { geoTemplate::addTemplateSet($languages_map[$current_language]); }
<
<?php ########################################### ## Auto-generated file ## It is not recommended to edit ## this file directly, but you can ## if you want. ## ## Generated: Oct 5, 2010 17:07:16 ########################################### /** * To manually add your own template set, use the syntax: * * geoTemplate::addTemplateSet('folder_name'); * * Where folder_name is the directory name, relative to this current directory. * NOTE: Default template set is always added by system as the last template set * to load. You do not need to add the default tempalte set here. * * If you do not wish manual changes to be overwritten next time admin makes a * change, be sure to put them in the "custom section" below. */ if (!defined('IN_ADMIN')) { # [CUSTOM SECTION] # $languages_map = array ( 24 => 'my_templates_french_5.1', 25 => 'my_templates_arabic_5.1', ); $session = geoSession::getInstance(); $current_language = $session->getLanguageId(); if (isset($languages_map[$current_language])) { geoTemplate::addTemplateSet($languages_map[$current_language]); } //Anything manually added to this section will be left intact even if changes //are made in the admin panel. //BOO! # [/CUSTOM SECTION] # } geoTemplate::addTemplateSet('my_templates');
<