Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Support for multilanguage sites, Internationalization (I18N)
mvlcek Wrote:
Draxeiro Wrote:However instead of just showing the actually existing pages in German, it shows the german pages PLUS the default Dutch ones that aren't available in German.

Subsequently clicking on a German page WILL then show only the actually available German pages but I cannot seem to make the language switch point to the just-german pages.

Do you include the language in the URL? like /de/slug?

If you use fancy URLs with %language% or %nondefaultlanguage%, setlang won't have an effect, as you have to use a specific language URL instead, i.e. a link /nl/slug?setlang=de would be translated by your .htaccess to /index.php?id=slug&lang=nl&setlang=de, which will show the dutch page and dutch navigation (but maybe with german menu texts?)

Just use the following link instead:
Code:
<a href="<?php echo htmlspecialchars(return_i18n_setlang_url('de')); ?>">deutsch</a>
which translates to /de/slug (or similar depending on your fancy URL setting).

I'm not using any kind of fancy url setting (didn't know that was possible actually), so I was and am literally using /?setlang=de or index/?setlang=de (makes no difference I think) as the link to the German language pages.

Did that on another site too, but there I used your regular menu code instead of the call for using a pulldown (so <?php get_i18n_navigation(return_page_slug(), 0, 100, I18N_SHOW_LANGUAGE); ?> as the menu call), and there it works like a charm: only shows the available pages in that language.

But here, so far no dice, also while using your <a href="<?php echo htmlspecialchars(return_i18n_setlang_url('de')); ?>">deutsch</a> link. That yields the same result as the /?setlang=de link: showing all the pages INCLUDING the german ones. And if I then click on one of the german pages only those are left.

From that previous site I just mentioned and your answer I know this should be possible but I cannot really understand what is going wrong...

By the way, if I would want to use %language% or %nondefaultlanguage%? Should that be set up in the permalink field or rather somewhere in the htaccess file? Tried it in the permalink field but then it couldn't find the pages with the _de addition anymore.
Reply


Messages In This Thread
rewrite language problem - by tomkop - 2013-03-27, 06:34:44
Enhancement suggestion - by hameau - 2013-05-12, 04:17:12
Enhancement request - by hameau - 2013-06-14, 20:02:07
RE: Enhancement request - by mvlcek - 2013-06-14, 22:04:12
RE: Enhancement request - by hameau - 2013-06-14, 23:01:36
Duplicate language cookies bug - by enzy - 2013-08-20, 07:03:26
RE: Duplicate language cookies bug - by ohayo - 2013-08-20, 18:12:25
Plugin is not shown - by tosho - 2013-09-15, 12:10:37
1000 pages limit in i18n_navigation - by titus - 2014-10-13, 21:58:36
Bug found - by lbarsov - 2014-10-17, 03:41:53
Menu with picture - by Dimi - 2015-04-28, 16:05:45
Rendering Menu in Component - by Alexander_ - 2016-05-04, 23:06:51
Meta desc for different languages - by Alexander_ - 2017-02-14, 20:29:32
Hierarchical Menus - by celextel - 2019-07-26, 16:41:47
Ri18n_navigation - by celextel - 2021-02-19, 16:07:48
Support for multilanguage sites, Internationalization (I18N) - by Draxeiro - 2012-05-05, 03:56:36



Users browsing this thread: 12 Guest(s)