Posts: 6
Threads: 1
Joined: Apr 2015
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.
Posts: 3,491
Threads: 106
Joined: Mar 2010
You can use the
I18N plugin.
Posts: 1,127
Threads: 136
Joined: Feb 2012
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
Posts: 6
Threads: 1
Joined: Apr 2015
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
Posts: 1,127
Threads: 136
Joined: Feb 2012
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
Posts: 6
Threads: 1
Joined: Apr 2015
2015-04-20, 03:43:28
(This post was last modified: 2015-04-20, 03:43:47 by razvan-rat.)
Can I do it through PHP?. like that - http://www.bitrepository.com/php-how-to-add-multi-language-support-to-a-website.html
Posts: 1,127
Threads: 136
Joined: Feb 2012
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.
Posts: 6
Threads: 1
Joined: Apr 2015
(2015-04-20, 06:45:09)Timbow Wrote: 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?
Posts: 1,127
Threads: 136
Joined: Feb 2012
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.
Posts: 6
Threads: 1
Joined: Apr 2015
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?
Posts: 1,928
Threads: 88
Joined: Apr 2010
http://mvlcek.bplaced.net/get-simple/multi-level-navigation/nav-top-left
Posts: 6
Threads: 1
Joined: Apr 2015
Ok, and how to translate something from sidebar (it's not menu or nothing, it's just 4 lines of text)?
Posts: 1,928
Threads: 88
Joined: Apr 2010
http://mvlcek.bplaced.net/get-simple/i18n
Posts: 18
Threads: 3
Joined: Jul 2015
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.
I am Web Developer at serverpk
Posts: 305
Threads: 15
Joined: Mar 2014
2015-07-08, 08:31:19
(This post was last modified: 2015-07-08, 08:31:45 by Tyblitz.)
@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.