Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I18N - setting a default language
#1
I've installed the I18N plugin and have it about 80% working. I am unable, however to set a default language. When I click my site's navigation links it jumps from a German page to an English page or from an English page to a German page.

The default language is "de" and the English pages have the same base page name in the slug but end in "_en"

I cannot find get_component(id) to replace with get_i18n_component(id). Maybe this is the problem? I've done a search of the default templates and do not find any get_component(id).

I am able to click a link to change an English page to a German page and vice-versa but cannot get the navigation to stay English or stay German only.

[Image: ayurvedish.gif]
[Image: i18N-RL.gif]


Attached Files Thumbnail(s)
       
Reply
#2
(2013-08-16, 04:48:58)j*z Wrote: I've installed the I18N plugin and have it about 80% working. I am unable, however to set a default language. When I click my site's navigation links it jumps from a German page to an English page or from an English page to a German page.

See Problem Solving on http://get-simple.info/forums/showthread...1221#p8812

If this doesn't help, please specify more details: how is I18N setup (language in URL?)? Does this happen immediately or only after you try to switch the language? What is your language switching link? What is the default language you have set in your browser? Does it happen with all browsers or just with on (e.g. Chrome)?
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#3
I reviewed your support page and tried some variations in hopes that I might get it to work. I also tested it with the Innovation theme but had the same problems.

>>how is I18N setup (language in URL?)?
"Language of all pages with URLs without language code (like "index"), e.g. "de":" is set to "de"
Live links look like this:
http://rightfulliving.com/yoga/
http://rightfulliving.com/yoga/?setlang=de


>>Does this happen immediately or only after you try to switch the language?
The home page loads in English (default is Deutsch). This can be changed to a German page with a link "?setlang=de" or "<?php echo htmlspecialchars(return_i18n_setlang_url('de')); ?>"

After switching the language by clicking a link, the pages return to either German or English. It seems 9 times out of 10 the pages will be either German or English. They do not randomly change. There is a yoga page that came up 5 times in German (using Chrome), and 2 times in English (using Internet Explorer).

>>What is the default language you have set in your browser?
English
English US

>>Does it happen with all browsers or just with on (e.g. Chrome)?
Yes, all browsers, but they behave slightly differently. Chrome almost always shows the same page in the same language (i.e. German) where Internet Explorer may show it in the same language (i.e. English).

(2013-08-16, 06:24:15)mvlcek Wrote:
(2013-08-16, 04:48:58)j*z Wrote: I've installed the I18N plugin and have it about 80% working. I am unable, however to set a default language. When I click my site's navigation links it jumps from a German page to an English page or from an English page to a German page.

See Problem Solving on http://get-simple.info/forums/showthread...1221#p8812

If this doesn't help, please specify more details: how is I18N setup (language in URL?)? Does this happen immediately or only after you try to switch the language? What is your language switching link? What is the default language you have set in your browser? Does it happen with all browsers or just with on (e.g. Chrome)?
Reply
#4
I turned off the Fancy URL feature and it is working now.

Thanks again for your help.
Reply
#5
(2015-07-02, 22:21:30)dcistudiosltd Wrote: I am trying to set the default language to FR.

I have set the "Language of all pages with URLs without language code:" to fr ,



and added the code below to my theme,

<?php if (!isset($language)) {
$language == 'fr';
} ?>

but the default language when the site first loads, is still english. I can switch without problems to french when clicking the language link "?setlang=fr".

The default language is that of the pages without language code, as set in the pages view in the administration.
When the theme is shown/executed the language has already been determined by the plugin.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
#6
(2015-07-07, 20:37:24)dcistudiosltd Wrote:
(2015-07-03, 05:38:09)mvlcek Wrote: The default language is that of the pages without language code, as set in the pages view in the administration.
When the theme is shown/executed the language has already been determined by the plugin.

So are you saying that in order to have french as default language, i should have set "en" in the language of all pages with URLs without language code? 

No, if you want french to be default, it is correct to have the pages without language code to be the french ones and the language code on the pages view set to "fr".
So, if you don't get the french page, it might be that in your browser settings you have english as first language. The plugin tries to find the best language based on the user's language settings. So you should get french, if you prefer french over english according to your settings or if you have neither french nor english in the settings.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply




Users browsing this thread: 1 Guest(s)