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:
which translates to /de/slug (or similar depending on your fancy URL setting).Code:<a href="<?php echo htmlspecialchars(return_i18n_setlang_url('de')); ?>">deutsch</a>
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.