GetSimple Support Forum

Full Version: How to make multi language site?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone!

I got that one user who wants multi language site. He already have GetSimple CMS installed and that CMS is completely strange to me. So, how can I create multi language site? There would be 2 languages, primary language will be English but the visitor can change it to 2nd language.
You can use the I18N plugin.
Like Carlos says you use the excellent i18n plugin. The full instructions are on Martin Vlcek's site here:
http://mvlcek.bplaced.net/get-simple/i18n
I don't get how to install it. I'm totally noob about this GetSimple CMS. Can someone please explain it better and simpler?

This website which need translation isn't big and special website. It's only website with Home, Contact and Gallery.

Come on guys, I need your help Sad
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.

  • 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.
USAGE
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
When you have created one page of a language, you can just click on the [+] symbol at the right hand side of an empty cell in the table on the Page Management page.
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
Can I do it through PHP?. like that - http://www.bitrepository.com/php-how-to-...bsite.html
No you can't use that method. Just get the plugin and follow the simple instructions. If you find it difficult then ask a question here. 
(2015-04-20, 06:45:09)Timbow Wrote: [ rel="nofollow" -> ]No you can't use that method. Just get the plugin and follow the simple instructions. If you find it difficult then ask a question here. 

First of all, I can't  find that "get_component(id)"


Second, "Go to the Pages tab and enter the two-letter language code of your default language and press Save." - where to enter the two-letter language code?
In the Theme folder a file named template.php contains the default page html. It will probably have for instance
PHP Code:
<?php get_component('sidebar'); ?>

to insert the sidebar into the page, and maybe other components too which will need to be multi-language. There may be different templates for different page layouts.
There is a screenshot at http://mvlcek.bplaced.net/get-simple/i18n showing the box for entering the language code.
So, now I have sidebar component, it's something like this:

<div class="sidebar">
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<div class="sidebar_clear_bottom"></div>
</div>

---

In theme that sidebar is called by this:

<div class="sidebar">
<?php get_component('sidebar'); ?>
</div>

---

Now I'm interested, how can I translate that sidebar with this i18n plugin?
Ok, and how to translate something from sidebar (it's not menu or nothing, it's just 4 lines of text)?
You are saying GS is strange, no way GS is the amazing CMS builder for converting static websites. Its just like a dream come true for all of us.
@Timbow, I admire your patience.

@razvan: see http://mvlcek.bplaced.net/get-simple/i18n for info on how to convert your website to multilingual Btw, replace get_component with get_i18n_component, get_navigation with get_i8n_navigation, etc., etc.