Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Support for multilanguage sites, Internationalization (I18N)
Pardon my repost, had this in the wrong thread before....

Is there a way to call a custom field instead of page slug in the i18n navigation? For instance instead of...
get_i18n_navigation(return_page_slug()1,1);
have
get_i18n_navigation(return_custom_field('thumbnail')1,1);

If not, is there a way to grab the custom field data in the xml page via a data path in css to make the background image of the menu style change for each page?

Something like: {background-image: url($page, $thumbnail);}

I'm at the end of my rope on trying to automatically get rows of custom field thumbnails from child pages to show up on the parent page. It seems like it should be easy, but I am obviously over my head with the php and how the functions work. This is my last ditch effort, or I have to either do it manually (lame!) or go back to concrete5 (slow!)

Edit by Connie: I deleted your post in the other thread because this is not a general question ;=)
Reply
Dominic Wrote:If not, is there a way to grab the custom field data in the xml page via a data path in css to make the background image of the menu style change for each page?

What do you want to achieve?
  • a different menu background on each page?
  • an image instead of the text for each menu item?
  • an image additional to the text on each menu item?
  • anything else?
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Hello everyone!
mvlcek, I have a question about i18n function return_i18n_languages() and it's front-end class implementation getLanguages(). The fact is, that this function returns only 2 languages (best on first place), but for my plugin implementation I need all user created languages.
My suggestion is to make another function return_i18n_language_list() or to modify existing return_i18n_languages() so that it would return all languages.
The code could be taken from pages.php file lines ~ 24 - 35.
Reply
I18N version 2.5.4:
  • provides a new function return_i18n_available_languages($slug), which returns the available languages for the page determined by $slug or the whole site, if $slug is not given (@Zorato).
  • fixes the view links in the pages, navigation structure and page edit views in the administration (@intelx86).
  • danish translation (thanks @chrsand)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
mvlcek Wrote:
Dominic Wrote:If not, is there a way to grab the custom field data in the xml page via a data path in css to make the background image of the menu style change for each page?

What do you want to achieve?
  • a different menu background on each page?
  • an image instead of the text for each menu item?
  • an image additional to the text on each menu item?
  • anything else?

An image instead of text for each menu item. The image pulled from the custom field of each individual subpage. I want the effect to be rows of thumbnails that link to that one page's children.
Reply
Hey mvlcek,
For some reason when using FANCY URLS with the language variable, these rewrite rules seems to work.
I would recommend adding them to the documentation on your site.

Code:
RewriteRule ^/?$ en/ [R,L]   # redirect to language of your choice
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(en|de)/(.*?/)?([A-Za-z0-9_-]+)/?$ index.php?id=$3&lang=$1 [QSA,L]
RewriteRule ^(en|de)/?$ index.php?lang=$1 [QSA,L]   # handle index page without 'index'
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
Code:
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^/?$ en/ [R,L] # redirect to language of your choice
RewriteRule ^(en|de)/(.*)$ $2?lang=$1 [QSA,DPI]    # replace with your languages
RewriteRule ^(.*);(\d+)([^\d/][^/]*)?/?$ $1$3?page=$2 [QSA,DPI]  # for use with pagify plugin
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
RewriteRule ^ index.php [L]   # for everything else show home page
Todo arde si le aplicas la chispa adecuada.
Reply
mvlcek Wrote:I18N version 2.5.4:
provides a new function return_i18n_available_languages($slug), which returns the available languages for the page determined by $slug or the whole site, if $slug is not given (@Zorato).
Thanks for quick response and applying changes!
Reply
yurifanboy Wrote:Hey mvlcek,
For some reason when using FANCY URLS with the language variable, these rewrite rules seems to work.
I would recommend adding them to the documentation on your site.
...

Do the rules on my site not work?
Can you tell me, when to use the first set of rules and when the second set?
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
mvlcek Wrote:
yurifanboy Wrote:Hey mvlcek,
For some reason when using FANCY URLS with the language variable, these rewrite rules seems to work.
I would recommend adding them to the documentation on your site.
...

Do the rules on my site not work?
Can you tell me, when to use the first set of rules and when the second set?
I'll test it later and get back to you on what happens.
Todo arde si le aplicas la chispa adecuada.
Reply
Spanish language for I18N available in Extend (base and navigation)
Reply
Carlos Wrote:Spanish language for I18N available in Extend (base and navigation)
Si no estuviera perezoso, traduciría get-simple también. No hay mucho tiempo para mi. :p
Todo arde si le aplicas la chispa adecuada.
Reply
mvlcek Wrote:
yurifanboy Wrote:Hey mvlcek,
For some reason when using FANCY URLS with the language variable, these rewrite rules seems to work.
I would recommend adding them to the documentation on your site.
...

Do the rules on my site not work?
Can you tell me, when to use the first set of rules and when the second set?

I believe these two sets of .htaccess rules are something you provided earlier in this thread.
mvlcek Wrote:
dizarter Wrote:Thanks for the fix, but, switching languages on the index page still doesn't work.

You are probably missing a rule in .htaccess. Try this:
Code:
RewriteRule ^/?$ en/ [R,L]   # redirect to language of your choice
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(en|de)/(.*?/)?([A-Za-z0-9_-]+)/?$ index.php?id=$3&lang=$1 [QSA,L]
RewriteRule ^(en|de)/?$ index.php?lang=$1 [QSA,L]   # handle index page without 'index'
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
or that:
Code:
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^/?$ en/ [R,L] # redirect to language of your choice
RewriteRule ^(en|de)/(.*)$ $2?lang=$1 [QSA,DPI]    # replace with your languages
RewriteRule ^(.*);(\d+)([^\d/][^/]*)?/?$ $1$3?page=$2 [QSA,DPI]  # for use with pagify plugin
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
RewriteRule ^ index.php [L]   # for everything else show home page

dizarter Wrote:Now, another question - how to make visiting example.com auto-redirect to example.com/de/index?

See the examples above.
The default rules provided on your website when using %language%/%parent%/%slug%/ as a permalink structure switch the language code in the URL and the content switches languages on most pages. However, it doesn't work on the index page. Which returns a 404 when you use the language changer function: <a href="<?php echo htmlspecialchars(return_i18n_lang_url('de')); ?>">In deutsch</a>
I am using the rules from your site here. http://yuritopia.info/t/en/hello-world/
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(en|de)/(.*?/)?([A-Za-z0-9_-]+)/?$ index.php?id=$3&lang=$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
Thus, it might be a good idea to provide this on your website. In terms of the difference between the first set and second set, I cannot say for sure. I am using this set on my site and it works fine for the index page:
Code:
RewriteRule ^/?$ en/ [R,L]   # redirect to language of your choice
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(en|es)/(.*?/)?([A-Za-z0-9_-]+)/?$ index.php?id=$3&lang=$1 [QSA,L]
RewriteRule ^(en|es)/?$ index.php?lang=$1 [QSA,L]   # handle index page without 'index'
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
Todo arde si le aplicas la chispa adecuada.
Reply
Would it be possible to allow the url structure of the GS site to reflect the navigation structure of the I18N plugin?
page1
-page1-1
--page1-1-1 (http:www.site.com/page1/page1-1/page1-1-1)
Todo arde si le aplicas la chispa adecuada.
Reply
yurifanboy Wrote:Would it be possible to allow the url structure of the GS site to reflect the navigation structure of the I18N plugin?
page1
-page1-1
--page1-1-1 (http:www.site.com/page1/page1-1/page1-1-1)

No. The find_url function of GetSimple can't be overwritten and the alternative would be to patch GetSimple and all plugins that use URLs to pages. I don't think there is a practicable way to do it.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Hi,

i'm very sorry to come back here, but i can't change to another language on one of my site.

http://www.spce-peche-mauritanie.fr/

i create translation for index page and for http://www.spce-peche-mauritanie.fr/cgv/

you can click on en in the footer but nothing happen.

can you help me ?
Reply
jeckyl Wrote:i'm very sorry to come back here, but i can't change to another language on one of my site.

http://www.spce-peche-mauritanie.fr/

i create translation for index page and for http://www.spce-peche-mauritanie.fr/cgv/

you can click on en in the footer but nothing happen.

can you help me ?

You seem to redirect each URL to the URL without parameter (click on the language link and the page displayed will have no ?lang=en), so probably the language parameter never reaches GetSimple.
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
mvlcek Wrote:
jeckyl Wrote:i'm very sorry to come back here, but i can't change to another language on one of my site.

http://www.spce-peche-mauritanie.fr/

i create translation for index page and for http://www.spce-peche-mauritanie.fr/cgv/

you can click on en in the footer but nothing happen.

can you help me ?

You seem to redirect each URL to the URL without parameter (click on the language link and the page displayed will have no ?lang=en), so probably the language parameter never reaches GetSimple.

It's correctied :

just don't activate
Code:
# Enable Canonical Redirects?
#define('GSCANONICAL', 1);
Reply
Hi, I'm trying to re-write output for i18n navigation to match it with bootstrap structure:

Code:
<ul class="nav">
  <li class="dropdown">
    <a href="#"
          class="dropdown-toggle"
          data-toggle="dropdown">
          Account
          <b class="caret"></b>
    </a>
    <ul class="dropdown-menu">
      ...
    </ul>
  </li>
</ul>

I'm no php-programmer and can't figure how to alter output of the parent link without messing with sub-menu links. For example, if I change line 358 in i18n_navigation.php from this:

Code:
$html .= '<li class="' . $classes . '"><a href="' . $href . '" title="' . htmlspecialchars(html_entity_decode($title, ENT_QUOTES, 'UTF-8')) . '">' . $text . '</a>';

To this:

Code:
$html .= '<li  class="' . $classes . '"><a class="dropdown-toggle"
          data-toggle="dropdown" href="' . $href . '" title="' . htmlspecialchars(html_entity_decode($title, ENT_QUOTES, 'UTF-8')) . '">' . $text . ' <b class="caret"></b></a>';

All links, parent and children, get altered.

Any advice how to re-write default output for navigation?

Again, I don't know php, so any help would be greatly appreciated. Thanks.
Reply
I18N version 2.6:
  • adjusted for GetSimple 3.1 (cosmetic issues)
  • hides the "View Pages" sidebar item
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Hi, just installed this new version and spotted the below error?

[Image: gs004.jpg]

Is the menu options moving the other options down and making it look like that, as at the moment its restricting the width of the edit area a fair bit?
Pete

Chefbyte Services
Reply
chefbyte Wrote:Hi, just installed this new version and spotted the below error?

This seems to be a problem of the Frontend users plugin (?)
Probably it has to be adjusted for 3.1
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Hi,

donation made because it's a great plugin and a great support.

thanks for your job.
Reply
jeckyl Wrote:donation made because it's a great plugin and a great support.

Thank you very much!
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply
Hi,

I discover the beauty getsimple and one of the things is a simple implementation language version of the article as well as components, etc. Non English very well so I do not know if that's somewhere in this thread overlooked, but not how to resolve the translation page as well as a reference.

The SEO and search I find it better if I have contacts, such as pages for the English and Czech version of the url will look like this

www.site.com/cs/kontakt - for Czech or better yet just www.site.com/kontakt
www.site.com/en/contact - for English or better yet just www.site.com/contact
Reply
Hello everybody.
I spotted that sitemap.xml contains malformed addresses like:

Code:
http://www.example.com/gs/%language%/subcat/simplepage/
http://www.example.com/gs/%language%/simplepage2_de/
http://www.example.com/gs/%language%/index_fr/
http://www.example.com/gs/

instead of
Code:
http://www.example.com/gs/en/subcat/simplepage/
http://www.example.com/gs/de/simplepage2/
http://www.example.com/gs/fr/
http://www.example.com/gs/en/
Reply




Users browsing this thread: 8 Guest(s)