Posts: 2,094
Threads: 54
Joined: Jan 2011
Electabuzz Wrote:Hello guys .
This plugin is amazing, however, i found 2 bugzya
The first one is that on the "View All Pages (I18N)" menù, when you click to view a page that is translated (and thus has the lang var) the url comes up as: sum.pin?id=gallery?lang=de while the correct would be sum.pin?id=gallery&lang=de. So it has to check if the link has more parameters and append with & instead of ?.
I'll fix this (I'm using fancy urls and you are the first to find that bug).
Electabuzz Wrote:Another bug, this one really annoys me, is that when you're browsing a page in another language that is not the default, the links doesn't have the lang parameter, so the user is forced to click the language for every link, while the expected behaviour is when the user click a language it should always append the language parameter, even if there's no translated version for the current page, because its up to the i18n loader to determine whether a page doesnt have a translated counterpart and fallback to the default one, but the lang parameter should only stop of being passed when the user clicks the default language, otherwise it should only be passed, and when a page has a translations it's displayed, otherwise it falls back.
It is intentional that there is no language parameter, as the I18N plugin selects the language automatically based on the user's language settings in his browser.
You can let the user permanently (for the session) switch the language by providing links with e.g. ?setlang=de, see my example site http://mvlcek.bplaced.net.
Or you can display a page in a specific language using the parameter ?lang=de (only for that request).
Posts: 524
Threads: 48
Joined: Mar 2011
mvlcek,
Is there a way I can call a (sub) menu starting from a given parent? I didn't find such an option in the documentation. I could use such a custom sub nav for a current project.
-----
I call the top navigation on a site with
Code: <?php get_i18n_navigation(return_page_slug(),0,0); ?>
and, for some reason, I never had a real look at the markup generated for the top menu. I'm now seeing that the complete menu is output with the sub entries being simply commented out. I'm not saying it's a huge increase in page size, but for my site which has quite a few sub pages, the commented out markup amounts to several kB... I'm sure you've got a reason for doing it this way? Just out of interest, what is the reason?
Posts: 2,094
Threads: 54
Joined: Jan 2011
polyfragmented Wrote:Is there a way I can call a (sub) menu starting from a given parent? I didn't find such an option in the documentation. I could use such a custom sub nav for a current project.
If you want to show all children of top-level page my-page, use one of
Code: # all children:
get_i18n_navigation('my-page',1,1);
# whole sub menu tree, all entries shown
get_i18n_navigation('my-page',1,99,I18N_SHOW_MENU);
# sub menu tree, only path to page and children of page shown:
get_i18n_navigation('any-page-in-sub-menu-tree',1,99);
Adjust the second parameter (minimum level), if my-page is not a top-level entry.
polyfragmented Wrote:I'm now seeing that the complete menu is output with the sub entries being simply commented out. I'm not saying it's a huge increase in page size, but for my site which has quite a few sub pages, the commented out markup amounts to several kB... I'm sure you've got a reason for doing it this way? Just out of interest, what is the reason?
Maybe you patched the plugin or have two get_i18n_navigation calls in your template, because the original I18N plugin doesn't output commented out menu entries.
Posts: 524
Threads: 48
Joined: Mar 2011
mvlcek Wrote:If you want to show all children of top-level page my-page, use one of
Code: # all children:
get_i18n_navigation('my-page',1,1);
# whole sub menu tree, all entries shown
get_i18n_navigation('my-page',1,99,I18N_SHOW_MENU);
# sub menu tree, only path to page and children of page shown:
get_i18n_navigation('any-page-in-sub-menu-tree',1,99);
Adjust the second parameter (minimum level), if my-page is not a top-level entry. Thanks!
mvlcek Wrote:Maybe you patched the plugin or have two get_i18n_navigation calls in your template, because the original I18N plugin doesn't output commented out menu entries. D'oh! Nevermind...
Posts: 2,094
Threads: 54
Joined: Jan 2011
I18N version 1.5: - fixes a bug where the view-link did not work with fancy-urls off
- adds helper functions find_i18n_url, return_i18n_lang_url and return_i18n_setlang_url - see here for more information
Posts: 423
Threads: 15
Joined: Mar 2011
Hello,
Using i18n v1.5 (also evident in v1.4).
Following your advice in another thread, I'm having some problems with get_i18n_content().
- get_i18n_content($slug) returns an error (undefined function return_i18n_data() in plugins/i18n_base.php on line 207)
- get_i18n_content($slug,true) works as intended, provided that $slug is a valid slug, otherwise the same error
I'm doing my own file_exists() check before calling get_i18n_content(), in order to provide default content. Can I get get_i18n_content() to give me a known default value if $slug doesn't exist ? (Or is that what return_i18n_data() is supposed to be doing ?)
--
Nick.
Posts: 2,094
Threads: 54
Joined: Jan 2011
hameau Wrote:Hello,
Using i18n v1.5 (also evident in v1.4).
Following your advice in another thread, I'm having some problems with get_i18n_content().
- get_i18n_content($slug) returns an error (undefined function return_i18n_data() in plugins/i18n_base.php on line 207)
- get_i18n_content($slug,true) works as intended, provided that $slug is a valid slug, otherwise the same error
I'm doing my own file_exists() check before calling get_i18n_content(), in order to provide default content. Can I get get_i18n_content() to give me a known default value if $slug doesn't exist ? (Or is that what return_i18n_data() is supposed to be doing ?)
I have to check this.
Posts: 2,094
Threads: 54
Joined: Jan 2011
I18N version 1.5.1 fixes a problem, when the user agent (e.g. RSS client) sends no HTTP_ACCEPT_LANGUAGE header.
Posts: 2,094
Threads: 54
Joined: Jan 2011
I18N version 1.5.2 fixes a bug in get_i18n_content.
The functions get_i18n_content and get_i18n_component now return true if the page or component was found. You can use this to display a default content, if no content was output.
Example: a page might have a custom sidebar, which is stored in the component sidebar-slug, where slug is the slug of the current page. If there is no custom sidebar, display the component sidebar:
Code: <?php get_i18n_component('sidebar-'.return_page_slug()) || get_i18n_component('sidebar'); ?>
Example: a page might have a custom sidebar, which is stored in the content of page slug-sidebar (this way you have a WYSIWYG editor), where slug is the slug of the current page. If there is no custom sidebar, display the component sidebar:
Code: <?php get_i18n_content(return_page_slug().'-sidebar') || get_i18n_component('sidebar'); ?>
Posts: 423
Threads: 15
Joined: Mar 2011
mvlcek Wrote:... fixes a bug in get_i18n_content.
...
... get_i18n_content and get_i18n_component now return true ... Good stuff – timely and effective support once again : thanks!
--
Nick.
Posts: 524
Threads: 48
Joined: Mar 2011
mvlcek,
thanks to your DynPages plugin and this plugin here, I can easily include a complete sitemap into a page. Yet I'm facing a problem with it:
I can't figure out how to only display public pages (not set to 'private').
I've consulted your navigation documentation page and currently have this call:
Code: <?php get_i18n_navigation('index',0,99,I18N_SHOW_PAGES); ?>
which produces a hierarchical sitemap with all children open. That's fine, but private pages still show up.
Suggestions?
Posts: 2,094
Threads: 54
Joined: Jan 2011
polyfragmented Wrote:mvlcek,
thanks to your DynPages plugin and this plugin here, I can easily include a complete sitemap into a page. Yet I'm facing a problem with it:
I can't figure out how to only display public pages (not set to 'private').
I've consulted your navigation documentation page and currently have this call:
Code: <?php get_i18n_navigation('index',0,99,I18N_SHOW_PAGES); ?>
which produces a hierarchical sitemap with all children open. That's fine, but private pages still show up.
Suggestions?
I wondered when this would come up. Currently the navigation ignores the private flag - instead it should ignore the private pages. I will fix it.
Posts: 2,094
Threads: 54
Joined: Jan 2011
I18N version 1.6: - offers an enhanced navigation structure view - you can show/hide a page in the menu and toggle its private flag.
- honors the private flag when showing a sitemap
- can display a sitemap with titles instead of menu texts (use I18N_SHOW_TITLES instead of I18N_SHOW_PAGES)
- new function return_i18n_component($slug)
Posts: 524
Threads: 48
Joined: Mar 2011
mvlcek Wrote:honors the private flag when showing a sitemap Thanks a bunch, that helps if you're setting up a site structure in one go, but content is still missing from some pages. Or a page isn't ready yet and still worked on.
Posts: 35
Threads: 2
Joined: Aug 2009
Hi,
i discovered your very cool module. Thanks for this job.
But i have a little question to made something.
I use a sidebar menu with all page intégrate in menu but in my footer i would like to create a specific like to only one page but with all translation and good link. I don't understand to do that.
Posts: 35
Threads: 2
Joined: Aug 2009
Ok, if i've no reply i think it's not understood.
I would lik to create a link to a specific page like COMPANY but i would like to use the translation system to create a link translate when i change the langage of my site.
Any idea ?
Posts: 2,094
Threads: 54
Joined: Jan 2011
jeckyl Wrote:I would lik to create a link to a specific page like COMPANY but i would like to use the translation system to create a link translate when i change the langage of my site.
You can use return_i18n_page_data($slug) to get the page data in the correct language and then extract the title. The link itself you can get with find_url($slug).
I will add a new function to the next version of the I18N plugin.
Posts: 35
Threads: 2
Joined: Aug 2009
2011-06-14, 17:41:43
(This post was last modified: 2011-06-14, 17:42:04 by bmf.)
mvlcek Wrote:jeckyl Wrote:I would lik to create a link to a specific page like COMPANY but i would like to use the translation system to create a link translate when i change the langage of my site.
You can use return_i18n_page_data($slug) to get the page data in the correct language and then extract the title. The link itself you can get with find_url($slug).
I will add a new function to the next version of the I18N plugin.
Hi,
thanks, but how i can do that ?
$slug is the name i use for url of my page ?
after i retrieved all data about this $slug how i can reach only the title ?
Code: <a href="<?php find_url('company'); ?>"><?php $toto=return_i18n_page_data('company') echo $toto['title'] ?></a>
Posts: 2,094
Threads: 54
Joined: Jan 2011
2011-06-18, 00:37:00
(This post was last modified: 2011-06-18, 07:24:44 by nime.)
I18N version 1.7: - correction of menu/title display, if it contains < or quotes
- new function get_i18n_link($slug) to output a link with the title in the current language as link text (@jeckyl)
- call component with parameters: get_i18n_component($name, $param1, ...) (@bugman)
- optimization when used with I18N Custom Fields - use at least version 1.7 of I18N Custom Fields
Posts: 35
Threads: 2
Joined: Aug 2009
mvlcek Wrote:get_i18n_link
Hi,
a big thanks it's work very well.
Posts: 11
Threads: 2
Joined: Sep 2010
For some reason I can't save my i18n navigation menu and i've made my backup/i18n_navigation field writable.
appears most of my pages on site are set to private, so without being able to save the navigation I can't see most of my pages. Any help anyone can provide is greatly appreciated.
Posts: 2,094
Threads: 54
Joined: Jan 2011
kerry Wrote:For some reason I can't save my i18n navigation menu and i've made my backup/i18n_navigation field writable. backup s/i18n_navigation f old er, I assume ;-)
kerry Wrote:appears most of my pages on site are set to private, so without being able to save the navigation I can't see most of my pages. Any help anyone can provide is greatly appreciated.
Any error messages or warnings? Additional ones, if you switch on debug mode?
Posts: 11
Threads: 2
Joined: Sep 2010
2011-06-21, 16:02:45
(This post was last modified: 2011-06-21, 16:03:46 by FoH.)
Your changes to the navigation structure could not be saved. Make sure that a directory backups/i18n_navigation exists and is writeable.
That is what I get above when I try and save navigation, however that directory has all the permissions set. I just keep getting the same message without being able to save.
Posts: 2,094
Threads: 54
Joined: Jan 2011
kerry Wrote:Your changes to the navigation structure could not be saved. Make sure that a directory backups/i18n_navigation exists and is writeable.
That is what I get above when I try and save navigation, however that directory has all the permissions set. I just keep getting the same message without being able to save.
This error should only show up, if the page files can not be copied to the backups/i18n_navigation directory for backup. If this directory has rights 0777 and there are no files in it, it should work.
I'm assuming of course that the page files are readable and writable - otherwise GS would not work ;-)
Only other idea: do you have non-page xml files in data/pages or files with special characters?
Posts: 11
Threads: 2
Joined: Sep 2010
2011-06-23, 16:45:38
(This post was last modified: 2011-06-23, 16:46:08 by FoH.)
Are there any known conflicts between this plugin and other plugins. I'm testing this on a couple of my sites, and in both for some reason when you click on the M to activate the item in the menu it doesn't toggle visibility.
Also, is there someway to set i18n just to automatically activate the menu rather than having to toggle them on for inclusion to the menu as you add pages.
Thanks for your help, I'm trying to diagnose what I am doing to determine causes for what i'm experiencing...though this is a great plugin regardless.
Kerry
|