Knowledgebase: v 4.x.x
How to translate static content?
Posted by Lena Kosyakova on 29 May 2008 04:29 PM
|
|
For example, when a user switch a language, you want your /about page to be switched too and displayed translated to a specified language. Please follow the below instructions and you'll get it: 1. You need to create several static pages for the "About Us" page, and you need to put there a relevant content in different languages. E.g. you create about_en in English, about_es in Spanish and about_zh in Chinese. 2. Then you need to make a copy of the index.tpl file from /templates/the_name_of_your_theme/main and paste it there and name it index_about.tpl. 3. In index_about.tpl find the following code: {$MAIN_CONTENT} and replace {$MAIN_CONTENT} with: {if $GLOBALS.current_language eq "en"} {module name="static_content" function="show_static_content" pageid="about_en"} {elseif $GLOBALS.current_language eq "es"} {module name="static_content" function="show_static_content" pageid="about_es"} {else} {module name="static_content" function="show_static_content" pageid="about_zh"} {/if} 4. Go to Admin Panel -> Site Layout _ User Pages -> /about/ and edit it. Put the index_about.tpl in the "Template" field and save it. And it will work! | |
|
Comments (0)