Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Support for multilanguage sites, Internationalization (I18N)
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
Reply
(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.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
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
Reply
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.
Reply
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.
Reply
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
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply
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
Reply
Are you using exactly the codes you have posted?
If so, PHP opening tags should be <?php, not <? php (without the space)
Reply
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?
Reply
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
Reply
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.
Reply
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
Reply
(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.
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply
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.
--
Nick.
Reply
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
Reply
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.
Reply
(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 )
Reply
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
Reply
(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)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
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)
Reply
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.
Reply
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?
Reply
hmm, I don't have that problem, looking at your site and every english menu item shows english page, same for DE
Reply
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)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
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
Reply




Users browsing this thread: 6 Guest(s)