Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Support for multilanguage sites, Internationalization (I18N)
mvlcek Wrote:
yojoe Wrote:Mvlcek: is there a way to prevent parent item from being clicked if it contains slugs ?

No, this is not possible.
But you can use the I18N Custom Fields plugin and a custom link field named link to forward the user to a sub page.

@mvlcek
I have menu NEWS and submenu NEWS1, NEWS2 and want to show content NEWS1 if clicked on NEWS.
So, I make the custom link field named link in page NEWS and not in/on NEWS1 ?

Thx again for contributing great plugin I18N, Custom Fields and many others
Reply
Rene Wrote:I have menu NEWS and submenu NEWS1, NEWS2 and want to show content NEWS1 if clicked on NEWS.
So, I make the custom link field named link in page NEWS and not in/on NEWS1 ?

Yes.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
mvlcek Wrote:
Rene Wrote:I have menu NEWS and submenu NEWS1, NEWS2 and want to show content NEWS1 if clicked on NEWS.
So, I make the custom link field named link in page NEWS and not in/on NEWS1 ?

Yes.

Works like a charm! Thx.
Reply
I am having some trouble adding I18N functionality to another plugin I'm using (user-login). I have previously hard-coded messages to the user etc, but would now like to add a language switching capability.

I decided to use I18N for this, and I followed the instructions here to be able to call e.g. i18n_r("user-login/REGISTER_MSG"). This works to a degree, but I am not able to switch between languages.

At first, everything was always English, confirmed by dumping $LANG to the screen. Then I decided to add $LANG = "nb_NO"; To my gsconfig.php file. This made everything Norwegian. The user-login plugin is using the language files I made in user-login/lang/ but I don't understand how to make the ?setlang=en/nb work with it.

Thanks for a great plugin. Hoping for a quick resolution.
Reply
Hi all
I have a question about the usage of a nested dropdown top menu using this great plugin. This using the function call get_i18n_navigation(return_page_slug(),0,2,I18N_SHOW_MENU);
See also http://nvwa.vz52.nl/cannect/ still under constructionSmile
Please try the 4th top menu item 'werkgroepen', then the the bottom dropdown item 'vogelwerkgroep', then a sub item should appear which cannot be reached easily, it disappears too quicly. How do I fix this?
Many thanks,
regards
Frank
Reply
oling Wrote:Hi all
I have a question about the usage of a nested dropdown top menu using this great plugin. This using the function call get_i18n_navigation(return_page_slug(),0,2,I18N_SHOW_MENU);
See also http://nvwa.vz52.nl/cannect/ still under constructionSmile
Please try the 4th top menu item 'werkgroepen', then the the bottom dropdown item 'vogelwerkgroep', then a sub item should appear which cannot be reached easily, it disappears too quicly. How do I fix this?
Many thanks,
regards
Frank

It happens because the sub menu only shows on a:hover and there is a gap between the a and the sub menu, because the a is not the whole width of its own sub menu.
Format the a as display:block and make sure that there is no gap between it and the sub menu (you could even make the sub menu overlap the parent sub menu).
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
great,
thanks, I noticed the gap already.
would you know of an example site to demonstrate this and so I can have a look in its css how this was formatted?

Thanks again

mvlcek Wrote:
oling Wrote:Hi all
I have a question about the usage of a nested dropdown top menu using this great plugin. This using the function call get_i18n_navigation(return_page_slug(),0,2,I18N_SHOW_MENU);
See also http://nvwa.vz52.nl/cannect/ still under constructionSmile
Please try the 4th top menu item 'werkgroepen', then the the bottom dropdown item 'vogelwerkgroep', then a sub item should appear which cannot be reached easily, it disappears too quicly. How do I fix this?
Many thanks,
regards
Frank

It happens because the sub menu only shows on a:hover and there is a gap between the a and the sub menu, because the a is not the whole width of its own sub menu.
Format the a as display:block and make sure that there is no gap between it and the sub menu (you could even make the sub menu overlap the parent sub menu).
Reply
what I need to write the code to show only links from the menu
Code:
<div class="breadcrumbs">
  <a href="<?php echo find_url('index',null); ?>">home</a>
  <?php get_i18n_breadcrumbs(return_page_slug()); ?>
</div>
Reply
Hi mvlcek,
I'm using your multilanguage plugin and it's great! I would know if it would possibile, in future implementation, also to translate the website title (as <title> tag I can found in the theme php main file).
I'm trying to do it acting on the template php but I'm a noob and I cannot do it. Let's have a look at www.zapmobilegames.com. The website title is in italian, but the website is in three languages, already completely translated, but the title.
Thanks!

Zap
Reply
Zapmobilegames Wrote:Hi mvlcek,
I'm using your multilanguage plugin and it's great! I would know if it would possibile, in future implementation, also to translate the website title (as <title> tag I can found in the theme php main file).
I'm trying to do it acting on the template php but I'm a noob and I cannot do it. Let's have a look at www.zapmobilegames.com. The website title is in italian, but the website is in three languages, already completely translated, but the title.
Thanks!

Zap

If you want to use the title of the current page, you can use <title><?php get_page_clean_title(); ?></title>.
If you want the same title for all pages, create components title, title_en and title_fr with the title in the corresponding language and use <title><?php get_i18n_component('title'); ?></title>.

You can also use a combination of those, e.g. on mvlcek.bplaced.net the code is <title><?php get_page_clean_title(); ?> | <?php get_site_name(); ?>, <?php get_i18n_component('tagline'); ?></title>.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
I'm sorry mvlcek, your sentence "create components title, title_en and title_fr with the title in the corresponding language" sounds hard for me. I did it as I create a new page, using your plugin, but I'm maybe doing something wrong because the title don't appear.
I've created a page called "title", I used the Slug/URL: "title" (and title_fr and title_it), the model is my template php.
Where's my mistake?
Reply
Zapmobilegames Wrote:create components

Backend menu: Theme - edit components - add component
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
mvlcek Wrote:
Zapmobilegames Wrote:create components

Backend menu: Theme - edit components - add component
Oh! Great!! Thank you!!!
Reply
Hi and good 2012! I'm new to GS and I18N-plugins (small experience with some other FOSS-PHP-MYSQL-CMS, good experience with HTML and CSS). I try to rebuild some static sites (SSI-Pages) with this interesting flatfile-CMS. So far everything described here seems to work. Multilanguage is crucial to me and I want to have the same URLs as before with the static sites.
Example sitemap (Menutext and URL) with primary language DE - secondary EN - third IT:
  • Startseite (/) - Home (/en/) - Inizio (/it/)
  • Reisen (/reisen/) - Travels (/travels/) - Viaggi (/viaggi/)
  • Fotoalben (/fotoalben/) - Photo Gallery (/photo-gallery/) - Galleria foto (/galleria-foto/)
This seems impossible to realize actually with GS 3.0 and I18N 2.5.1. There is no way to change the slug for the secondary languages. Is there a way to do this with not to much coding now or is this a feature on the roadmap for some of the next releases?
Advanced HTML5 & CSS3 coder. Simple JS & PHP hacker (not enough for new function coding). Build one webpage with GS (late 2012). Focusing on Theme customizing/Template files. Experience with WP.
Reply
ChriS Wrote:Hi and good 2012! I'm new to GS and I18N-plugins (small experience with some other FOSS-PHP-MYSQL-CMS, good experience with HTML and CSS). I try to rebuild some static sites (SSI-Pages) with this interesting flatfile-CMS. So far everything described here seems to work. Multilanguage is crucial to me and I want to have the same URLs as before with the static sites.
Example sitemap (Menutext and URL) with primary language DE - secondary EN - third IT:
  • Startseite (/) - Home (/en/) - Inizio (/it/)
  • Reisen (/reisen/) - Travels (/travels/) - Viaggi (/viaggi/)
  • Fotoalben (/fotoalben/) - Photo Gallery (/photo-gallery/) - Galleria foto (/galleria-foto/)
This seems impossible to realize actually with GS 3.0 and I18N 2.5.1. There is no way to change the slug for the secondary languages. Is there a way to do this with not to much coding now or is this a feature on the roadmap for some of the next releases?

No, it's not possible to have different slugs for different languages, as the slug is ID and filename and the matching of different language versions is done with this slug.
Currently this is not on the roadmap, although it might be possible with GS 3.1's metadata caching for pages.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
mvlcek Wrote:No, it's not possible to have different slugs for different languages, as the slug is ID and filename and the matching of different language versions is done with this slug.
Currently this is not on the roadmap, although it might be possible with GS 3.1's metadata caching for pages.
Thank you for making this clear. Looking in the \data\pages\*.xml files I found no ID, so as I understand the GS core actually provides no method to make a solution.
However it is a long search for me to find a multilanguage CMS that can do every URL (Slug) for every language, while having a simple edit structure in the backend. Of course providing this way maybe complicates and bloats code and for every way there are advantages and disadvantages (see also solution for I18N language in URL).
  • "Open URLs (Slugs)": Flexibility (no limits in the URL structure), rebuild existing pages structure, easy to understand URLs for users of every language, Search engine optimization
  • slug is ID: simple ;-), easy to admin/edit, URLs (without language code) to use in multilanguage environments (print, signatures, etc.)
So probably I have to choose now if GetSimple is the CMS to stick with (I really like it until now), but I still think Open Slugs for every language would be a very useful option for the future and gives important basical improvement to the CMS possibilities.
Advanced HTML5 & CSS3 coder. Simple JS & PHP hacker (not enough for new function coding). Build one webpage with GS (late 2012). Focusing on Theme customizing/Template files. Experience with WP.
Reply
<?php if ($language == 'en') { ?>&nbsp;All rights reserved. All images belong to their
respective owners.<?php } ?>
<?php if ($language == 'es') { ?>&nbsp;Todos los derechos reservados. Todas las imágenes son propiedad de sus respectivos autores.<?php } ?>

I can't seem to get the php conditionals to work so that I can use them to translate pieces of my template when I use the language switcher:
Code:
<div id="lang">
<a href="<?php echo htmlspecialchars(return_i18n_lang_url('es')); ?>">
<img src="" alt="es" /> Espa&ntilde;ol</a>
&nbsp;
<a href="<?php echo htmlspecialchars(return_i18n_lang_url('en')); ?>">
<img src="" alt="us" /> English</a>
</div>
Todo arde si le aplicas la chispa adecuada.
Reply
yurifanboy Wrote:<?php if ($language == 'en') { ?>&nbsp;All rights reserved. All images belong to their
respective owners.<?php } ?>
<?php if ($language == 'es') { ?>&nbsp;Todos los derechos reservados. Todas las imágenes son propiedad de sus respectivos autores.<?php } ?>

I can't seem to get the php conditionals to work so that I can use them to translate pieces of my template when I use the language switcher:

If you use this code directly in the template file, it should work. However, if you use this within a function, you need to tell PHP it's a global variable first:
Code:
global $language;
...
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
mvlcek Wrote:
yurifanboy Wrote:<?php if ($language == 'en') { ?>&nbsp;All rights reserved. All images belong to their
respective owners.<?php } ?>
<?php if ($language == 'es') { ?>&nbsp;Todos los derechos reservados. Todas las imágenes son propiedad de sus respectivos autores.<?php } ?>

I can't seem to get the php conditionals to work so that I can use them to translate pieces of my template when I use the language switcher:

If you use this code directly in the template file, it should work. However, if you use this within a function, you need to tell PHP it's a global variable first:
Code:
global $language;
...
Thanks, I guess the .htaccess caching 0_o that I had was causing the changes not to appear instantly. Still you are awesome as always! As a suggestion, on your website, it might be a good idea to mention these conditional tags considering there is often footer text or other text outside of the WYSIWYG editor, which doesn't automatically get translated.
Todo arde si le aplicas la chispa adecuada.
Reply
yurifanboy Wrote:As a suggestion, on your website, it might be a good idea to mention these conditional tags considering there is often footer text or other text outside of the WYSIWYG editor, which doesn't automatically get translated.

Thanks for the suggestion.
I added a chapter language dependent content to the page with the three possibilities components, pages and conditions.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Hi,

I have a question:
I would like to include

Code:
<?php get_i18n_navigation(return_page_slug(),1,99); ?>

in a file located in plugins/.

But this doesnt work. No navigation is shown.
How can i fix that?
Reply
SlazZe Wrote:Hi,

I have a question:
I would like to include

Code:
<?php get_i18n_navigation(return_page_slug(),1,99); ?>

in a file located in plugins/.

But this doesnt work. No navigation is shown.
How can i fix that?

If you post this file, I might be able to look at it and help you.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
it's the user_login plugin by Mike Henken.

this is the code:

Code:
function welcome_message_login()
{
    global $welcome_box_css;
    global $site_url;
    global $the_page_slug;
    
    if(isset($_SESSION['LoggedIn']))
    {
        //Get Username Of Logged In User
        $the_username = $_SESSION['Username'];
        $the_username = ucfirst($the_username);
        
        //Display Welcome Message
        $welcome_box = ' <div class="s_title">Sei gegr&uuml;&szlig;t, '.$the_username.'.</div>';

        
        //Display Logout Link
        $logout_link = '<ul class="subnav">
                            <li><a href="'.$site_url.'index.php?id='.$the_page_slug.'&logout=yes">Abmelden</a></li>
                            <li><a href="'.$site_url.'intern/">Interner Bereich</a></li>
                            <li><a href="'.$site_url.'admin/">Administration</a></li>
                        </ul>';
        echo $welcome_box_css.$welcome_box.$logout_link;
        
        echo '<div class="s_title" style="margin-top: 16px;">Navigation</div>';
        echo '<ul class="subnav"><?php get_i18n_navigation(return_page_slug(),1,99); ?></ul>';
        
        
    }
}

Regards,
SlazZe.
Reply
SlazZe Wrote:
Code:
echo '<ul class="subnav"><?php get_i18n_navigation(return_page_slug(),1,99); ?></ul>';

You are echoing the string <?php ... ?> literally instead of calling the function. It should be
Code:
echo '<ul class="subnav">';
get_i18n_navigation(return_page_slug(),1,99);
echo '</ul>';
or
Code:
?><ul class="subnav"><?php get_i18n_navigation(return_page_slug(),1,99); ?></ul><?php
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
wow, that was all? :o
thank you so much Smile
Reply




Users browsing this thread: 16 Guest(s)