2015-04-19, 02:05:27
INSTALLATION
Download the plugin from http://get-simple.info/extend/plugin/i18n/69/, unzip it and copy it to the plugins directory of your GetSimple installation.
Go to the Pages tab and enter the two-letter language code of your default language and press Save.
Create another language version of a page by creating a new page and (after opening the page options) naming its URL/Slug as that of the default language version + "_" + language code, e.g. for german pages:
To display a page in another than the user's prefered language, a link likehttp://my.site/my/page?lang=de (German) can be used. You can use the helper functionreturn_i18n_lang_url to create a link to the current page in another language:
<a href="<?php echo htmlspecialchars(return_i18n_lang_url('de')); ?>">In deutsch</a>
You can also use the helper function find_i18n_url to create a link to another page in a specific language:
<a href="<?php echo htmlspecialchars(find_i18n_url('my-page','my-page-parent','de')); ?>">Meine Seite in deutsch</a>
To switch the language for the current session, add links like http://my.site/?setlang=de(German) to your template or home page. You can use the helper function return_i18n_setlang_url to switch the language, but stay on the same page:
<a href="<?php echo htmlspecialchars(return_i18n_setlang_url('de')); ?>">deutsch</a>
from http://mvlcek.bplaced.net/get-simple/i18n?lang=en
Download the plugin from http://get-simple.info/extend/plugin/i18n/69/, unzip it and copy it to the plugins directory of your GetSimple installation.
- in your template(s) replace get_navigation(return_page_slug()) withget_i18n_navigation(return_page_slug()) and get_component(id) withget_i18n_component(id) and get_header() with get_i18n_header().
- You can change the default language on the I18N view.
Go to the Pages tab and enter the two-letter language code of your default language and press Save.
Create another language version of a page by creating a new page and (after opening the page options) naming its URL/Slug as that of the default language version + "_" + language code, e.g. for german pages:
- index -> index_de
- my-page -> my-page_de
To display a page in another than the user's prefered language, a link likehttp://my.site/my/page?lang=de (German) can be used. You can use the helper functionreturn_i18n_lang_url to create a link to the current page in another language:
<a href="<?php echo htmlspecialchars(return_i18n_lang_url('de')); ?>">In deutsch</a>
You can also use the helper function find_i18n_url to create a link to another page in a specific language:
<a href="<?php echo htmlspecialchars(find_i18n_url('my-page','my-page-parent','de')); ?>">Meine Seite in deutsch</a>
To switch the language for the current session, add links like http://my.site/?setlang=de(German) to your template or home page. You can use the helper function return_i18n_setlang_url to switch the language, but stay on the same page:
<a href="<?php echo htmlspecialchars(return_i18n_setlang_url('de')); ?>">deutsch</a>
from http://mvlcek.bplaced.net/get-simple/i18n?lang=en