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
Hey,

is it possible that my problem above with the missing classes comes from using a static start slug?

<?php get_i18n_navigation('index', 0, 0, I18N_OUTPUT_MENU | I18N_FILTER_MENU, 'mainmenu') ?>

It's the only thing I can think off. Is there a way to get classes in that case or how can I work around the problem?

Thanks a lot for any hints!

Cheers,

Tom
(2013-08-21, 07:01:42)Thomas Helzle Wrote: [ -> ]Hey,

is it possible that my problem above with the missing classes comes from using a static start slug?

<?php get_i18n_navigation('index', 0, 0, I18N_OUTPUT_MENU | I18N_FILTER_MENU, 'mainmenu') ?>

The first parameter should be the current page - if you set it to a fixed value, the plugin assumes that this (here the index page) is the current page and sets the classes accordingly.
Hey mvlcek,

that is good to know.
I think I misunderstood something basic then - somehow I thought I would use a static page as the first parameter when the menu should be page-independent.
In the meantime I found the current page with php by comparing the page slug with the classes the $item returns (which in that case is just the slug of each page).

But now it makes sense. I'll give it a try.

Cheers and thanks!

Tom
Hi Mvlcek,

I had a problem with language cookies mainly when switching languages more than once.

In latest Chrome I got that more than one 'language' cookie was being sent to the page (clearing cookies first).

Don't know why happens but I could solve it by replacing

Code:
setcookie(I18N_LANGUAGE_COOKIE, $_GET[I18N_SET_LANGUAGE_PARAM]);

with

Code:
setcookie(I18N_LANGUAGE_COOKIE, $_GET[I18N_SET_LANGUAGE_PARAM], time()+60*60*24*30, '/', $_SERVER['HTTP_HOST']);

in frondend.class.php

Regards,
Mauro.
Hello all, please help, usage plagin "I18n, i18n_base", on one site I found a way to display all levels of nesting Url in the address bar of the browser,
Quote:admin panel -> settings -> Custom Permalink Structure: = %parents%/%slug%/

and usage menu
Code:
<?php get_i18n_navigation(return_page_slug(),0,5,I18N_SHOW_MENU); ?>

all worked fine until I saw the sitemap
Code:
...
<url><loc>http://domain_name/%parents%/about-us/</loc><lastmod>2013-06-27T11:42:20+00:00</lastmod><changefreq>weekly</changefreq><priority>1.0</priority></url>
...
url must be http://domain_name/about-us/

sorry for my english.
Hi Mvlcek,
I'm having troubles with the submenu (and its links) on the homepage - index.

The URLs created by the submenu look like this
Code:
http://tomasjanecek.cz/index/some-subpage/

However, I need them to be like this
Code:
http://tomasjanecek.cz/home/some-subpage/
or
http://tomasjanecek.cz/some-subpage/

I don't have any subpages somewhere else than on the homepage but I'm planning them, so I can't ruin the structure totally.

So far I redirected the pages with /index/ to the same URL just without the /index/ word, but it's not enought as the links in the menu still include /index/.
Code:
RewriteRule ^index/(.+)$ $1 [R=302,QSA,L]

Is there any way to change the menu URLs (links) on the homepage without making it static on the homepage?

All I need is to remove or change the /index/ from the links in the submenu on the homepage only, nothing more.

Thank you
Help,
can `t deal with navigation

when writing:
Code:
<? php get_i18n_navigation (return_page_slug ());?>
Nothing appears
when writing:
Code:
<? php get_i18n_navigation (return_page_slug (), 1,99);?>
too
recording only
Code:
<? php get_i18n_navigation (return_page_slug (), 0,0);?>
menu appears on the upper level, but if the menu is in another language, it still sends the page to the language of the system
example
if there are two languages ​​EN and _DE, then the top entry on the menu language _DE get on EN

and I want to output a second level menu
record
Quote:
<? php get_i18n_navigation (return_page_slug (), 1,1);?>
does not work
Are you using exactly the codes you have posted?
If so, PHP opening tags should be <?php, not <? php (without the space)
Hi,

I just downloaded, unzipped and placed the plugin in the plugin folder, but it does not show up in GetSimple "plugins" page.
If I change get_navigation, get_component, and get_header to the i18n versions, I will simply get a "not found" .

The plugin directory looks like this:

Code:
i18n (DIR)
  +-- i18n_base (DIR)
  +-- i18n_base.php
  +-- i18n_navigation (DIR)
  +-- i18n_navigation.php

What's wrong?
Those files and folders should be directly unzipped into the plugins directory, not inside a i18n folder. Like this:

Code:
yoursite
  +-- plugins (DIR)
        +-- i18n_base (DIR)
        +-- i18n_base.php
        +-- i18n_navigation (DIR)
        +-- i18n_navigation.php
Thanks a lot, Carlos,

I thought that the whole directory had to be be copied into the plugins directory as with my other two plugins.
Help me, please

I cant solve a problem with multilanguage:
My site has 2 languages, basic (en) and additional (de). Basic fancy urls must be without any suffix(for example http://mysite.com/page/), additional - with suffix "/de" (for example http://mysite.com/de/page/). If user's browser language is the same that basic, it's OK, but if not, all pages without suffix transform in german.
It's because urls has "lang" parameter only if i switch language. Modrewrite transforms urls without this parameter to default browser language. How to make urls to include "lang" parameter always? In this case it will be possible to set unique url to each language version
(2013-09-17, 01:15:54)anvold Wrote: [ -> ]Help me, please

I cant solve a problem with multilanguage:
My site has 2 languages, basic (en) and additional (de). Basic fancy urls must be without any suffix(for example http://mysite.com/page/), additional - with suffix "/de" (for example http://mysite.com/de/page/). If user's browser language is the same that basic, it's OK, but if not, all pages without suffix transform in german.
It's because urls has "lang" parameter only if i switch language. Modrewrite transforms urls without this parameter to default browser language. How to make urls to include "lang" parameter always? In this case it will be possible to set unique url to each language version

I have already made a website with the same scenario you are after.
http://ubytovanisetek.cz/ - the default language is Czech and it's Czech until you switch to English. Then, it stays English until you switch back. When the site's in English, there's "/en/" in the URL. When it's in Czech, there is no parameter.

In the website's settings, I use this custom permalink structure:
Code:
%nondefaultlanguage%/%parent%/%slug%/

And the .htaccess part for this setting (you have to replace the original RewriteRules with this one)
Code:
RewriteRule ^/?$ cs/ [R,L]   # optional
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(cs|en)/(.*?/)?([A-Za-z0-9-]+)/?$ index.php?id=$3&lang=$1 [QSA,L]
RewriteRule ^(cs|en)/?$ index.php?lang=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*?/)?([A-Za-z0-9-]+)/?$ index.php?id=$2&lang=cs [QSA,L]

Try it, it should work.
Hello,

The sitemap generator in I18N Base gives a confusing message on completion, when GSDONOTPING is defined: "Sitemap Created, however there was an error pinging one or more of the search engines".

See this thread.
I know Connie has asked this question but I've gone through writing up some code...with some help. I'm hoping I don't have to rewrite. I need some of the top most menu items not to have a link. I'm using custom rendering to do this for some of the child menu items.

Currently I have a component called links

PHP Code:
<li class="<?php echo $item->classes; ?>">
    <?
php
          
if ($item->nopage == 'noLink') {
                  echo 
htmlspecialchars($item->text);
                
          }
          elseif (
$item->nopage == 'hasLink') { ?>
             <a href="<?php echo htmlspecialchars($item->link); ?>">
                <?php echo htmlspecialchars($item->text); ?>
              </a>
        
          <?php }
          
          else { 
?>
             <a href="<?php echo htmlspecialchars($item->link); ?>">
                <?php echo htmlspecialchars($item->text); ?>
              </a>
      <?php }?>
          
        <?php if ($item->isOpen) { ?>
 
                <ul class="sub-menu"><?php $item->outputChildren(); ?></ul>
          <?php ?>
</li> 

I'm using this in the navigation to print out the main li and its children in a div

PHP Code:
<li><?php get_i18n_link('investment-strategies'); ?>
                <div class="menu_dropdown_block full_width">
                    <ul><?php get_i18n_navigation('investment-strategies',1,100,I18N_SHOW_MENUlinks); ?></ul>
                </div>
        
            </li> 

I really need investment strategies - the parent not to be a link

I know I'm using the get_i18n_link but what else is there??

Not sure where to begin with this Please HELP this php noob!!!Smile
Is there a way to to alter the url in the navigation? Right now all the navigation links are to the pages in the local server (localhost:8888).

When I upload the pages to the remote server, it keeps the links to my local server). So I can't get it to work from the remote server.
(2013-10-02, 16:53:05)belotte Wrote: [ -> ]Is there a way to to alter the url in the navigation? Right now all the navigation links are to the pages in the local server (localhost:8888).

When I upload the pages to the remote server, it keeps the links to my local server). So I can't get it to work from the remote server.

try to flush cache / delete cache files (but be sure that you have new url set in settings Wink )
As always the plugins mvleck develops truly rock!

Is there a way to turn of the name generator and keep the canonical url?

if I set the get_il8n_header(FALSE); it removes both generator and canonical.

Last question. Is that ?lang-en on the end of the canonical url proper? Do I need it?

many thanks

Lance
(2013-10-10, 00:50:09)lnickel Wrote: [ -> ]As always the plugins mvlcek develops truly rock!

Thank you.

(2013-10-10, 00:50:09)lnickel Wrote: [ -> ]Is there a way to turn of the name generator and keep the canonical url?

if I set the get_il8n_header(FALSE); it removes both generator and canonical.
[

No, but you can remove line 219 in plugins/i18n_base/frontend.class.php (echo '<meta ...).


(2013-10-10, 00:50:09)lnickel Wrote: [ -> ]Last question. Is that ?lang-en on the end of the canonical url proper? Do I need it?

If you have multiple languages and the language is not included in the URL itself, you would need it.
If the URL includes the language, there should be no lang parameter.

If you have only one language, you can include in gsconfig.php:
Code:
define('I18N_SINGLE_LANGUAGE',true);
(which should remove the language parameter)
do you feel ashamed by that generator ? Smile you can comment it in source code btw

the lang parameter in canonical url is needed when the page is multilingual. I don't understand why it's there even with multilanguage turned off in gsconfig

EDIT: I see that you are faster mvlcek, but I have multilanguage turned off on my page and I see that parameter in url :/ (on multiple sites, but not all, I don't understand this behaviour)
hahaha! no I'm not ashamed LOL!!! thanks morvy and mvleck for the responses!!!

Yeh I only have one language which is english. LOL!!! Smile

EDIT** Perfect both solutions work.
Hi @ll,

i have problem with the I18N Plugin.
Now I´ve create a multilanguage site with DE & EN content.

First of all okay (menue shows "DE" => DE entries) and if (menue shows "EN" => EN entries)

But as soon as i switch between the menue entries i got a problem.
Some pages are "DE" shown and some in the De Menue shows EN sides the same in the other direction
(EN --> shows DE)

Have a look here side

Anyone has a idea whats wrong?
hmm, I don't have that problem, looking at your site and every english menu item shows english page, same for DE
I18N version 3.2.4:
  • fixes a bug that prevents correct language switching - the language cookie is now always set to the root of the domain (@phpman)
  • adds a new parameter to get_i18n_header($full, $omit), where $omit is an array with the tags to omit, e.g. get_i18n_header(true,array('generator')) will omit the generator meta tag (@lnickel)
Hi,

thank for the fix but another issue we have like a bug ?

I´ve open another thread for this and if i use the new fixed file from the last posting see here it works.
Did you fix this too ? posting fix

Harald
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