GetSimple Support Forum

Full Version: Support for multilanguage sites, Internationalization (I18N)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
mvlcek,

I've run into a problem here with the I18N-Navigation. If HOME has subpages, clicking a subpage's link won't load it, the home page stays put.

The paths look like www.domain.de/index/subpage which follows the default fancy URL structure %parent%/%slug%/. The installation resides in the root folder for the domain, not a subfolder.

How can I make this work?
polyfragmented Wrote:mvlcek,

I've run into a problem here with the I18N-Navigation. If HOME has subpages, clicking a subpage's link won't load it, the home page stays put.

The paths look like www.domain.de/index/subpage which follows the default fancy URL structure %parent%/%slug%/. The installation resides in the root folder for the domain, not a subfolder.

How can I make this work?

Works for me. Maybe you have custom rewrite rules in your .htaccess?
Are the navigation links correct?
mvlcek Wrote:Works for me. Maybe you have custom rewrite rules in your .htaccess?
Are the navigation links correct?

It works also for me.
Aren't you using any caching plugin maybe ?
Try also with url structure without parent, only %slug%
mvlcek Wrote:Works for me. Maybe you have custom rewrite rules in your .htaccess?
Are the navigation links correct?
Not using any rewrite rules other than the default. Are the navigation links correct? I can only tell you that they follow the default scheme for fancy URLs in the backend. It works for any other top-level navi entry and its children here.

The .htaccess looks like this:

Quote:AddDefaultCharset UTF-8
Options -Indexes

# Added by Thorsten, 20110419-1620
AddHandler php53-cgi .php

# blocks direct access to the XML files - they hold all the data!
<Files ~ "\.xml$">
Order allow,deny
Deny from all
Satisfy All
</Files>
<Files sitemap.xml>
Order allow,deny
Allow from all
Satisfy All
</Files>

RewriteEngine on

# Usually it RewriteBase is just '/', but
# replace it with your subdirectory path
RewriteBase '/'

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]

This is the vanilla default (as far as I can tell) with one addition for PHP CGI mode, but no extra rewrite rules

yojoe Wrote:Aren't you using any caching plugin maybe ?
Try also with url structure without parent, only %slug%
Not using any caching plugin at all. Without %parent% it works, but this is not what I want. I'd like to use the system's default which is %parent%/%slug%/. As mentioned above in reply to mvlcek, it works for any other top-level navi entry and it's children.
Any chance for a linky ?
Or you are developing the website on localhost ?
Moving all pages out of index parent, and adding them again after clearing cache doesn't work ?

btw. i18n plugin caches whole menu Wink
Try to clear i18n_menu_cache.xml, or even delete it.
yojoe Wrote:Any chance for a linky ?
I'm going to send you a link via PM.


yojoe Wrote:Moving all pages out of index parent, and adding them again after clearing cache doesn't work ?
Nope, doesn't do anything. As soon as I move a page outside index and inside any other top-level menu entry, the subpage is being loaded OK though.


yojoe Wrote:btw. i18n plugin caches whole menu Wink
Try to clear i18n_menu_cache.xml, or even delete it.
OK, I wasn't aware of that. I deleted the cache file, to no avail.
mvlcek,

apart from the fact that I'm experiencing problems with domain.tld/index/subpage, is there any chance one can remove the index from HOME subpage links?

domain.tld/subpage for HOME looks cleaner to me.
Is there any way to override the automatic default language selection and setup plugin so, that index page always shows the language that I define?
Joshas Wrote:Is there any way to override the automatic default language selection and setup plugin so, that index page always shows the language that I define?

To ALWAYS show a specific language for the index page, just define the default language version and none else.

To show a specific language version, if the user hasn't selected a language yet: this is not currently supported.
But if you use Apache, you can add a RewriteRule to your .htaccess to rewrite the URL to URL?setlang=en (replace en with the desired language), if the user has no session yet (no cookie PHPSESSID). You must check the Apache documentation for the syntax on how to do it.
Can't find the reason for the /index/subpage situation, trying Connie's server. Sorry for bothering you in your plugin thread.
mvlcek,

I'm currently trying to output an info text when a secondary navigation has no entries (no subpages available). My code works on pages without subpages and the info text is output. On pages with subpages the submenu is displayed and my info text is as well. It shouldn't be. Where's/What's the flaw in my PHP?

Code:
<?php
    if (!get_i18n_navigation(return_page_slug(),1,10)) {
        
        echo 'Es gibt in diesem Bereich keine Unterseiten.';
                
    } else {
                
        get_i18n_navigation(return_page_slug(),1,10);
                
        }
?>

I tried some variants of the comparison as checking for '' or FALSE, same behaviour here...
polyfragmented Wrote:mvlcek,

I'm currently trying to output an info text when a secondary navigation has no entries (no subpages available). My code works on pages without subpages and the info text is output. On pages with subpages the submenu is displayed and my info text is as well. It shouldn't be. Where's/What's the flaw in my PHP?

Code:
<?php
    if (!get_i18n_navigation(return_page_slug(),1,10)) {
        
        echo 'Es gibt in diesem Bereich keine Unterseiten.';
                
    } else {
                
        get_i18n_navigation(return_page_slug(),1,10);
                
        }
?>

I tried some variants of the comparison as checking for '' or FALSE, same behaviour here...

I think, get_i18n_navigation returns an empty array in this case, try count(return_i18n_menu_data(...)) == 0

In general, if you are not sure, what a function returns, include code like the following to find out:
Code:
$myresult = return_i18n_menu_data(...);
print_r($myresult);

Edited: use return_i18n_menu_data instead, get_i18n_navigation outputs the menu and returns nothing.
Got it!
Code:
<?php
     // Check whether the return_i18n_menu_data array has no elements for the submenu
    // 'return_page_slug(),1,10' is the same as in 'get_i18n_navigation(return_page_slug(),1,10);'
    // to call up the submenu

    if (count(return_i18n_menu_data(return_page_slug(),1,10)) == 0) {

        echo 'Es gibt in diesem Bereich keine Unterseiten.';

    } else {

        get_i18n_navigation(return_page_slug(),1,10);

    }
?>

Now works, thanks for the hint.
I18N Version 1.4:
  • adds the css classes "open" or "closed" to menu items with children. This allows you to style menu items with children differently than those without.

This update is an answer to a request of snooze.
Hello,
I tried a lot of CSS but by now I can't give an other color to active links, I tried to give define the "current" class but it didn't work. So my question is: what's the CSS tag to call the "current" style? (.current? li .current? , ...)

p.s. the plugin works really great and is a great help for me, thanks a lot!
Hey,

danielec Wrote:I tried a lot of CSS but by now I can't give an other color to active links, I tried to give define the "current" class but it didn't work. So my question is: what's the CSS tag to call the "current" style? (.current? li .current? , ...)
Since you are trying to style links with your CSS, you must target hyperlinks, not the parent li element itself:

Code:
li.current a {your-styles-here;}
Hello everyone
I gotta confused upon trying to generate full human-readable sitemap. I've got the multilingual navigation plug-in installed but unable to output the whole site structure. No sub-level links are shown, only the root level. I tried using all of the examples listed in this topic but nothing helped.
I'm using GetSimple v3.0 and I18N Navigation v1.3
Got any ideas?
I currently use this:
Code:
<?php get_i18n_navigation(return_page_slug(), 0,99, showall); ?>
reff Wrote:Hello everyone
I gotta confused upon trying to generate full human-readable sitemap. I've got the multilingual navigation plug-in installed but unable to output the whole site structure. No sub-level links are shown, only the root level. I tried using all of the examples listed in this topic but nothing helped.
I'm using GetSimple v3.0 and I18N Navigation v1.3
Got any ideas?
I currently use this:
Code:
<?php get_i18n_navigation(return_page_slug(), 0,99, showall); ?>

The function call syntax has changed:
Code:
<?php get_i18n_navigation(return_page_slug(), 0, 99, I18N_SHOW_PAGES); ?>
Greatest thanks, this worked perfectly!
polyfragmented Wrote:Hey,
Since you are trying to style links with your CSS, you must target hyperlinks, not the parent li element itself:

Code:
li.current a {your-styles-here;}

Hello,
thanks for your fast answer.
But the problem still remains with this code, the current page links does change color... I really don't understand why it does work.

p.s. if it helps the link to the website: http://www.concordia-forio.it/
danielec Wrote:But the problem still remains with this code, the current page links does NOT change color... I really don't understand why it does NOT work.

p.s. if it helps the link to the website: http://www.concordia-forio.it/

CSS styles are more important the more specific they are. You have:
Code:
#footer .menu ul li a { ... }
li.current a { ... }

Basically the longer the expression the more important, thus your style for "current" items is never used. Change it to
Code:
#footer .menu ul li a { ... }
#footer .menu ul li.current a { ... }
and it will (most probably) work.
Hello mvlcek,
thanks a lot for the explanation and answer!
It works really well! After three days trying you saved my mind! Thanks so much! It's really nice to you guys to help so fast and so good!
First of all, this is a great plugin and hats off for your efforts. I was wondering if this plugin can help me translate the name of the site. I need to set up a Chinese version of the site, so I assume I will be using 'zh', not exactly sure of its language code. I also noticed the menu title for a page has not changed, is there an option to do so?
And one more thing, I tried the links to your website at mvlcek.bplaced.net, but it just contains ads? What happened to the site and its contents?

Regards,
Angela
angelazou Wrote:First of all, this is a great plugin and hats off for your efforts. I was wondering if this plugin can help me translate the name of the site. I need to set up a Chinese version of the site, so I assume I will be using 'zh', not exactly sure of its language code. I also noticed the menu title for a page has not changed, is there an option to do so?

I don't understand.
You create two pages, e.g. default "my-page" in english and my-page_zh" in chinese. For each of these two versions you can enter a title and a menu text. The menu (called with get_i18n_navigation from your template) shows the menu text in the relevant language and the title in the title-Attribute of the link. If no menu text is set, the title in the relevant language is also used as menu text.

angelazou Wrote:And one more thing, I tried the links to your website at mvlcek.bplaced.net, but it just contains ads? What happened to the site and its contents?

http://mvlcek.bplaced.net/ still works perfectly for me - there are NO ads.
Do you use a bad proxy?
mvlcek Wrote:
angelazou Wrote:First of all, this is a great plugin and hats off for your efforts. I was wondering if this plugin can help me translate the name of the site. I need to set up a Chinese version of the site, so I assume I will be using 'zh', not exactly sure of its language code. I also noticed the menu title for a page has not changed, is there an option to do so?

I don't understand.
You create two pages, e.g. default "my-page" in english and my-page_zh" in chinese. For each of these two versions you can enter a title and a menu text. The menu (called with get_i18n_navigation from your template) shows the menu text in the relevant language and the title in the title-Attribute of the link. If no menu text is set, the title in the relevant language is also used as menu text.

angelazou Wrote:And one more thing, I tried the links to your website at mvlcek.bplaced.net, but it just contains ads? What happened to the site and its contents?

http://mvlcek.bplaced.net/ still works perfectly for me - there are NO ads.
Do you use a bad proxy?


Thanks for the info. Well, the thing is, I have finished my Chinese pages, and it works correctly, except that the menu text is still in English (I have set the Chinese menu text). I also would like to know how to translate for the component section, I know this is probably already listed in your website, but like I said, I'm seeing your website in ads only. I've attached a screen shot, not sure what is happening.

Regards,
Angela
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43