Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Support for multilanguage sites, Internationalization (I18N)
I'm sorry to flood like this but I'm desparate right now because I have to translate every product page in 10 languages by manually if I can't find a way to do what I've mentioned above. I saw only one solution with adding language suffix components but I have 40 different words it means I will have 400 components, I don't think get-simple can handle this nor I'd be able to edit those components easily in future. There must be another way to do this, I'm sure. Thanks.
Reply
With ItemManager this is no problem, why don't you try it? Just create for each language (prefix) a category with same slug, so you can use I18N_DEFAULT_LANGUAGE from i18n for determine current language then load your items and display.
Reply
And besides, you can after setting up your categories even automate the importing process from pages to items just with a simple API call ;-)
Reply
I never gave a shot to that plug-in. I'll try it if there'll be no solution only using i18n. Thank you Bigin.
Reply
(2016-06-27, 22:38:29)barknezz Wrote: Hello mvlcek!
This plug-in is really life saver but I was failed to add multi-language php tags to components as you mentioned on this page: http://get-simple.info/wiki/plugins:i18n...uages_i18n

The steps I followed:
1- Added new languages to admin/lang such as de_DE, ru_RU
2- Added <?php i18n("WHOWERARE"); ?> to my footer component.
3- Added "WHOWEARE" => "Who We Are in spesific language?" to all language files that I have.

English version works like charm, however when I set my language to another language on website (not on admin panel), it keep showing me only English version, not other language versions.

I don't really know if I do something wrong. How can I fix this? I will create detailed product pages in 20 different languages so I do REALLY need to know how to fix this :| Thank you very much.

Ok, here's the How to use language files with the I18N plugin:
  • create a directory /plugins/texts/lang (a dummy plugin for your site's texts)
  • add language files to this directory, with the two-letter language codes used by the I18N plugin, e.g. de.php
Code:
<?php
$i18n = array(
  'TEXT1' => "Deutscher Text"
);
  • add the following code to the top of your template file (try to load language files according to the user's language preference, the default language as defined on the I18N Pages view in the administration and English as last fallback):
Code:
<?php
$preferedLanguages = return_i18n_languages();
foreach ($preferedLanguages as $l) {
    i18n_merge('texts', $l);
}
i18n_merge('texts', return_i18n_default_language());
i18n_merge('texts', 'en');
?>
  • add <?php i18n('texts/TEXT1'); ?> whereever you want a localized text ('texts/', because your keys are in the texts plugin, here with key 'TEXT1') in your template.
If you have pages that are the same in all languages except some terms, you can use placeholders in the default language page instead of creating pages for all languages:
  • install the DynPages plugin
  • create a component text with the following content:
Code:
<?php global $args; i18n('texts/'.$args[0]); ?>
  • use {% text TEXT1 %} (here with key 'TEXT1'), whereever you need in your default language pages, e.g. the following content for a product specification:
Code:
Notebook 1503X:
{% text processor %}: Core I5
{% text speed %}: 2.5MHz
{% text size %}: 30cm x 20cm x 2cm
...
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Whether it is possible to make the reference count on first level the menu? I want to use it in the menu class.
Reply
hello, I have a problem with a site I'm using I18N.

The site is in Italian, i installed the plugin and created pages in English and put them in the menu, but the english link go to italian site... i don't know why

the site:
Italian: http://www.tecenergysrl.it/test/?lang=it
English: http://www.tecenergysrl.it/test/?lang=en
Reply
PHP 7.0.9-1~dotdeb+8.1
Code:
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; I18nNavigationItem has a deprecated constructor in /home/u915147/getsimple-themes.ru/basket/plugins/i18n_navigation/frontend.class.php on line 349
Reply
Hey again,
My website's default language is English and all the default pages such as "index" "products" are in English (en), yet when I enter the website, I see Turkish versions of it. I have to switch language manually to see it in English. I did try with incognito mod, nothing has changed. Also I'm on localhost, there should not be a way that the script detects my IP and redirect me to Turkish website. How to solve this problem? Thanks
Reply
Hello! I found bug with work special pages and multilanguage site.


When I create Item for spesial page "News",  page with no default languages don't see his parent.

If I go to Configure I18N Special Pages and click to "Save Special Page Type" at my "News", all News pages get his parents.

In an attachment, step by step screenshots
https://habrastorage.org/files/c2c/94f/c...6bb57c.png
https://habrastorage.org/files/77f/250/9...239707.png
https://habrastorage.org/files/fd9/8f8/f...a7c8fa.png
https://habrastorage.org/files/3e2/35a/c...67eb86.png
https://habrastorage.org/files/cd9/300/5...075166.png
https://habrastorage.org/files/36b/ca8/7...304893.png
https://habrastorage.org/files/d3e/515/9...ee98d1.png
https://habrastorage.org/files/be0/b8e/8...9b5af5.png
https://habrastorage.org/files/c4f/7c7/a...ab91fb.png
Reply
another bug here,

when I create nested special pages (_special_gallery), menu structure in i18n get's corrupted. When I want to open parent to see newly added child page, it hides all links below instead of showing links inside the parent. When I click on "Show all pages", I can see newly added page, but under random special page. In frontend everything seems OK, but in backend it's a mess.

so I did 3 screenshots of menu manually opened, show all pages and navigation structure (website behaves like navigation structure, but editing special pages is confusing as it doesn't show up correctly in Pages)

[Image: i18n_bug.gif]
Reply
Thumbs Up 
... I wish this plugin had it's own category on the forum, can't possibly read through 39 pages ...

Anyway, my issue:

My site has two languages, I created the page structure for both. But I currently use only one (German), the other language pages (English) are all empty. The language selector is hidden in the frontend, and default language is all set to 'de'. But still, sometimes when opening the site, a page in English comes up. Perhaps the browser is set to English, I don't know, and it doesn't matter, because it should work for all visitors, whatever their browser setting.

Is there a simple way to disable one language? Ideally there'd be a way to disable individual pages, so a page where one language is disabled comes up in the default language.

Thanks!

EDIT: The below solution by morvy did it. Thank you!
Reply
I use this in gsconfig:

define('I18N_SINGLE_LANGUAGE',true);
define('I18N_IGNORE_USER_LANGUAGE',true);
Reply
I am facing an issue with Navigation Structure.
I have a simple structure Parent -> Children, only 1 level deep. Every time I open and edit Child page the structure brakes and this Child page jumps on the Parent level.
I can put it back manually via Navigation Structure but next time I edit this page - situation repeats.
Reply
Hello! How is it possible to make some menu elements not a link but only holder for lower levels links.
See screenshot:

   

Navigation code for menu looks like this:
PHP Code:
                        <!-- Nav -->
                            <
nav id="nav">
                                <
ul>
                                    <?
php if (function_exists('get_i18n_navigation'))
                                    {echo(
get_i18n_navigation(return_page_slug(),0,2,I18N_SHOW_MENU));}
                                    else { 
get_navigation(return_page_slug()); }  ?>
                                </ul>
                            </nav> 
Reply
Maybe this is helpful for you:

http://get-simple.info/extend/plugin/ts-nolink/780/
Reply
Heh I didnt know php even did that...
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
(2016-10-12, 07:24:07)smsHH Wrote: Maybe this is helpful for you:

http://get-simple.info/extend/plugin/ts-nolink/780/


Works like a charm! Thank You!!
Reply
Your home page on i18n installation appears to be mangled where it mentions the string (twice as far as I can see)
|Wink\s*language= RewriteRule ^(.*)? $1?lang=en [QSA,DPI]
Reply
(2016-09-17, 01:17:13)morvy Wrote: I use this in gsconfig:

define('I18N_SINGLE_LANGUAGE',true);
define('I18N_IGNORE_USER_LANGUAGE',true);

I added that, and at first it seemed to work. But now, on another PC, I get the wrong language again. What else can I try? Thanks!
Reply
guys is there a way to combine news manager plugin and i18n plugin to post news in different languages? news manager plugin has only 1 page in its config (page to display news) so all languages would end up there.
Reply
you can try to use tags plugin News Manager
Pages output by tags (useful for multilanguage sites)
in component
<?php global $args; nm_show_tag($args[0]); ?>

on the page (ispolzovt plugin DynPades:
{% name_component tag %}
Reply
(2016-09-02, 17:25:09)morvy Wrote: another bug here,

when I create nested special pages (_special_gallery), menu structure in i18n get's corrupted. When I want to open parent to see newly added child page, it hides all links below instead of showing links inside the parent. When I click on "Show all pages", I can see newly added page, but under random special page. In frontend everything seems OK, but in backend it's a mess.

so I did 3 screenshots of menu manually opened, show all pages and navigation structure (website behaves like navigation structure, but editing special pages is confusing as it doesn't show up correctly in Pages)

[Image: i18n_bug.gif]

Hi morvy,

i am facing the same issue. Did you manage to find a solution?

Thanks!
Niki
Reply
(2016-12-05, 02:00:22)neden Wrote:
(2016-09-02, 17:25:09)morvy Wrote: another bug here,

when I create nested special pages (_special_gallery), menu structure in i18n get's corrupted. When I want to open parent to see newly added child page, it hides all links below instead of showing links inside the parent. When I click on "Show all pages", I can see newly added page, but under random special page. In frontend everything seems OK, but in backend it's a mess.

so I did 3 screenshots of menu manually opened, show all pages and navigation structure (website behaves like navigation structure, but editing special pages is confusing as it doesn't show up correctly in Pages)

[Image: i18n_bug.gif]

Hi morvy,

my nav structure seemed to be messed up, too. I clicked on the filter options above (By Title, Hierarchical) and it all showed up right again. Is this the same for you?

Niki
Reply
Hi neden,

no solution here, only a workaround - click on "Hierarchical" and then click it again .. it will resort all items in correct order
Reply




Users browsing this thread: 1 Guest(s)