Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Landing Page. Fallback from non main language to non default language
#1
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
Reply
#2
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 ?
Addons: blue business theme, Online Visitors, Notepad
Reply
#3
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.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#4
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 :-)
Reply
#5
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 :-)
Reply




Users browsing this thread: 1 Guest(s)