GetSimple Support Forum
Landing Page. Fallback from non main language to non default language - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Landing Page. Fallback from non main language to non default language (/showthread.php?tid=2788)



Landing Page. Fallback from non main language to non default language - lbordas - 2012-02-21

Hi everybody.

I'm finishing up a site with 3 main languages (es, en, ca). I'm using I18N plug-in and default language is Spanish (es).

Also, I have to publish two additional versions of the home page, in German and Swedish. Problem is that when user reaches the German or Swedish pages I need to keep the text of the menus in German or Swedish (only home page has those languages versions) while the user navigates the site through the menu, but I need to fallback to the English version (which is not default) on the rest of the pages, unless the user returns to the home page where it will be shown again in German or Swedish.

In short, the idea is to have, additionally to the main languages, German and Swedish versions of the home page, and fallback to the English version for the rest of the pages, keeping the menu texts in German or Swedish.

Is there anybody who can give me some ideas on how to accomplish this?

Thanks in advance
Luis


Landing Page. Fallback from non main language to non default language - yojoe - 2012-02-21

Invoking menu with I18N_SHOW_MENU directive should show all menu items in respective language, and when a page isn't translated, it should be shown in default language.

Did you try that ?


Landing Page. Fallback from non main language to non default language - mvlcek - 2012-02-21

lbordas Wrote:I'm finishing up a site with 3 main languages (es, en, ca). I'm using I18N plug-in and default language is Spanish (es).

Also, I have to publish two additional versions of the home page, in German and Swedish. Problem is that when user reaches the German or Swedish pages I need to keep the text of the menus in German or Swedish (only home page has those languages versions) while the user navigates the site through the menu, but I need to fallback to the English version (which is not default) on the rest of the pages, unless the user returns to the home page where it will be shown again in German or Swedish.

In short, the idea is to have, additionally to the main languages, German and Swedish versions of the home page, and fallback to the English version for the rest of the pages, keeping the menu texts in German or Swedish.

Is there anybody who can give me some ideas on how to accomplish this?

The "easy" way is just to create the german and swedish pages and copy the english content.

Another solution, where you don't need to copy the content:
  • Install the DynPages plugin
  • Create a component named english with the following content:
Code:
<?php
  global $url;
  get_i18n_content($url.'_en',true);
?>
  • Create the german and swedish pages with title and menu text and put the following in the content:
Code:
{% english %}
This will only work, if the english page does not contain any place holders itself, e.g. {% ... %} or (% ... %).
If the english page does contain place holders, e.g. a gallery, you need to copy the content to the english and german versions.


Landing Page. Fallback from non main language to non default language - lbordas - 2012-02-22

mvlcek Wrote:
lbordas Wrote:I'm finishing up a site with 3 main languages (es, en, ca). I'm using I18N plug-in and default language is Spanish (es).

Also, I have to publish two additional versions of the home page, in German and Swedish. Problem is that when user reaches the German or Swedish pages I need to keep the text of the menus in German or Swedish (only home page has those languages versions) while the user navigates the site through the menu, but I need to fallback to the English version (which is not default) on the rest of the pages, unless the user returns to the home page where it will be shown again in German or Swedish.

In short, the idea is to have, additionally to the main languages, German and Swedish versions of the home page, and fallback to the English version for the rest of the pages, keeping the menu texts in German or Swedish.

Is there anybody who can give me some ideas on how to accomplish this?

The "easy" way is just to create the german and swedish pages and copy the english content.

Another solution, where you don't need to copy the content:
  • Install the DynPages plugin
  • Create a component named english with the following content:
Code:
<?php
  global $url;
  get_i18n_content($url.'_en',true);
?>
  • Create the german and swedish pages with title and menu text and put the following in the content:
Code:
{% english %}
This will only work, if the english page does not contain any place holders itself, e.g. {% ... %} or (% ... %).
If the english page does contain place holders, e.g. a gallery, you need to copy the content to the english and german versions.

Thanks a lot mvlcek... your second solution with the DynPages plugin works perfectly :-)


Landing Page. Fallback from non main language to non default language - lbordas - 2012-02-22

yojoe Wrote:Invoking menu with I18N_SHOW_MENU directive should show all menu items in respective language, and when a page isn't translated, it should be shown in default language.

Did you try that ?

Hi yojoe,

Yours is a solution when the fallback option is to the default language, but this is not my case... thanks anyway :-)