Posts: 2,094
Threads: 54
Joined: Jan 2011
angelazou Wrote:Thanks for the info. Well, the thing is, I have finished my Chinese pages, and it works correctly, except that the menu text is still in English (I have set the Chinese menu text). I also would like to know how to translate for the component section, I know this is probably already listed in your website, but like I said, I'm seeing your website in ads only. I've attached a screen shot, not sure what is happening.
Regards,
Angela
Make sure, you use get_i18n_navigation in your template, not get_navigation.
Name your components mycomp and mycomp_zh and use get_i18n_component('mycomp') to include it.
No screenshot attached.
If this does not help, please post a link to your site.
Posts: 54
Threads: 10
Joined: Mar 2011
So if I have a component called contact, I should create a new one called contact_zh and it would automatically map that? If so, great; I will give it a try now. Also, when I visited your website earlier (when it was still functional from my end; I have attached a screen shot of your website with its ads; hope it shows up this time), I saw that you have two buttons on the top right with language selections. How was that done?
Thanks,
Angela
PS: sorry about these extra posts, I wouldn't be asking if I can access your site directly.
Posts: 2,094
Threads: 54
Joined: Jan 2011
angelazou Wrote:I have attached a screen shot of your website with its ads; hope it shows up this time
If I remember correctly, I had this phenomen once, too (it's free hosting, after all). Try to refresh or even clear the browser cache.
angelazou Wrote:I saw that you have two buttons on the top right with language selections. How was that done?
Here's the full code:
Code: <div class="language">
<?php
$fullurl = $_SERVER["REQUEST_URI"];
if (strpos($fullurl,'setlang=') !== false) $fullurl = substr($fullurl, 0, strpos($fullurl,'setlang=')-1);
$fullurl .= strpos($fullurl,'?') === false ? '?' : '&';
?>
<a href="<?php echo $fullurl; ?>setlang=de">deutsch</a>
<a href="<?php echo $fullurl; ?>setlang=en">english</a>
</div>
Posts: 8
Threads: 1
Joined: Jan 2011
Hello! Big thanks for your plugin. I just updated to 3.0, and instead of re-implementing my core-edited version of language switching I decided to use yours instead as it's more programming- and user-friendly. There were some similarities in our methods (already had pages end with -fin for Finnish etc. and used $lang to set language) so the installation was pretty easy.
One question, however. I have not gone through all your code, perhaps I could find a solution, but: Is it possible to show a page in the menu, and be able to visit it, if it's only available in a non-standard language? As of now, I have one page that exists only in the second language, and it does not show up in the menu.
Posts: 7
Threads: 1
Joined: Jan 2011
Thanks for the plugin, mvlcek, it's very functional. I've made a Polish translation for you and everybody in return. See attachment.
I've got a little problem though. I would like to display a submenu in the sidebar component if the current page has subpages, or display a differerent menu otherwise. I just can't code it.
Here's my try, all within the sidebar component:
Code: <?php if (get_i18n_menu_data(return_page_slug(), 1, 2, haschildren) == true) ?>
<ul><?php get_i18n_navigation(return_page_slug(), 1, 2); ?></ul>
<?php else echo 'XYZ'; ?>
Posts: 2,094
Threads: 54
Joined: Jan 2011
2011-05-06, 16:21:23
(This post was last modified: 2011-05-06, 16:21:57 by nime.)
vinta9e Wrote:I've got a little problem though. I would like to display a submenu in the sidebar component if the current page has subpages, or display a differerent menu otherwise. I just can't code it.
Here's my try, all within the sidebar component:
Code: <?php if (get_i18n_menu_data(return_page_slug(), 1, 2, haschildren) == true) ?>
<ul><?php get_i18n_navigation(return_page_slug(), 1, 2); ?></ul>
<?php else echo 'XYZ'; ?>
Try
Code: <?php
$pages = return_i18n_pages();
if (@count(@$pages[return_page_slug()]['children'])) {
?>
<ul><?php get_i18n_navigation(return_page_slug(), 1, 2); ?></ul>
<?php
} else {
?>
<p>Here is something else.</p>
<?php
}
?>
Documentation of the available functions is in the top of the plugin file.
Posts: 3,491
Threads: 106
Joined: Mar 2010
2011-05-08, 19:07:05
(This post was last modified: 2011-05-08, 19:17:47 by fotothink.)
@mvlcek
I've tested this plugin in localhost (XAMPP). At the backend, for View all pages (I18N) and Edit Navigation Structure do not render the view ('#') links properly. I found that it's because I haven't PHP short tags enabled ("<?" instead of "<?php"), and you are using them in several places:
i18n_base/pages.php lines 88, 89, 124, 159
i18n_navigation/structure.php line 219
I read that short tags are not recommended, for server compatibility.
Posts: 2,094
Threads: 54
Joined: Jan 2011
Carlos Wrote:@mvlcek
I've tested this plugin in localhost (XAMPP). At the backend, for View all pages (I18N) and Edit Navigation Structure do not render the view ('#') links properly. I found that it's because I haven't PHP short tags enabled ("<?" instead of "<?php"), and you are using them in several places:
i18n_base/pages.php lines 88, 89, 124, 159
i18n_navigation/structure.php line 219
I read that short tags are not recommended, for server compatibility.
Thank you, Carlos, for pointing this out.
I never intended to use the short tags, but I must have forgotten the php once and by copy-and-paste distributed it throughout the plugins (found it in I18N Search and I18N Custom Fields, too).
I18N version 1.4.1: fixes usage of short php tags <? instead of <?php
Posts: 161
Threads: 6
Joined: Jan 2010
2011-05-11, 13:43:14
(This post was last modified: 2011-05-11, 13:43:40 by kuba.sanitrak.)
Could custom fields be easily included as attributes in the array returned by 'return_i18n_menu_data' for example? I'm guessing it would be expensive, a bit of a minor feature request but thought I'd put it past you anyway @mvlcek.
Posts: 2,094
Threads: 54
Joined: Jan 2011
sal Wrote:Could custom fields be easily included as attributes in the array returned by 'return_i18n_menu_data' for example? I'm guessing it would be expensive, a bit of a minor feature request but thought I'd put it past you anyway @mvlcek.
Why do you need this? What do you want to do?
Posts: 161
Threads: 6
Joined: Jan 2010
mvlcek Wrote:sal Wrote:Could custom fields be easily included as attributes in the array returned by 'return_i18n_menu_data' for example? I'm guessing it would be expensive, a bit of a minor feature request but thought I'd put it past you anyway @mvlcek.
Why do you need this? What do you want to do? I'm looking to output a section menu that would involve sections having a representative image and thought if I use custom fields to save an image against each child page I could just output a custom menu structure and include this custom image field as part of the output.
I've actually asked a question in the Custom Fields thread that might be a more beneficial feature request to that plugin that would solve the same problem I'm facing.
Posts: 1,204
Threads: 30
Joined: Jun 2010
sal Wrote:I'm looking to output a section menu that would involve sections having a representative image and thought if I use custom fields to save an image against each child page I could just output a custom menu structure and include this custom image field as part of the output.
I've actually asked a question in the Custom Fields thread that might be a more beneficial feature request to that plugin that would solve the same problem I'm facing.
How are you going to add such images ? As an additional option in page's options ?
If not, I don't see the reason why not using css to stylize menu even with images.
Although whole site structure would have to be known during development.
Addons: blue business theme, Online Visitors, Notepad
Posts: 2
Threads: 0
Joined: May 2011
This looks a really good plugin, and exactly what I want for 'nested' menus but I'm just not seeing the sub-pages. Here's what I've done:
1) I installed the plugin
2) I adjusted the template, replacing get_navigation(return_page_slug()) with get_i18n_navigation(return_page_slug()) and get_component(id) with get_i18n_component(id). I also put get_i18n_navigation(return_page_slug()) in the sidebar.
3) I have a page, 'Robert Fata', which shows as having 'Performers' as a parent, and 'Add to Menu' is also checked.
However:
http://gator727.hostgator.com/~jmclenna/...nment.com/
Only displays the top level menu of Home and Performers, both across the top and on the sidebar.
I'm sure there is something obvious I am missing/not doing, but I can't work out what! Thanks in advance for any suggestions...
Posts: 423
Threads: 15
Joined: Mar 2011
AZ SnakePit Wrote:I also put get_i18n_navigation(return_page_slug()) in the sidebar. That only gives you top level menu entries. Change the sidebar to get_i18n_navigation(return_page_slug(),0,99), for example.
See the author's site (link in his signature) for full working examples.
--
Nick.
Posts: 5
Threads: 0
Joined: Apr 2011
First of all, I think there should be a separate forum for the I18N plugin.
My issue with the I18N plugin, is that I need to have a different template on some of my pages.
More specific, I need some of my pages to have a minimal template, with no header/footer or sidebar.
I have created this minimal template, and it worked fine until I started using the I18N plugin. Is there any (simple) way around this?
Posts: 2,094
Threads: 54
Joined: Jan 2011
crusher88 Wrote:First of all, I think there should be a separate forum for the I18N plugin.
A complete support forum? I hope that this topic is enough ;-)
crusher88 Wrote:My issue with the I18N plugin, is that I need to have a different template on some of my pages.
More specific, I need some of my pages to have a minimal template, with no header/footer or sidebar.
I have created this minimal template, and it worked fine until I started using the I18N plugin. Is there any (simple) way around this?
This is definitely not a problem of the I18N plugin. It does not in any way limit your usage of different templates. On http://mvlcek.bplaced.net I use several templates - for the demonstrations of top and pulldown menus and a minimal one for the gallery demonstration of the gallery type supersized.
Posts: 346
Threads: 27
Joined: Sep 2010
2011-05-19, 04:31:46
(This post was last modified: 2011-05-20, 15:54:34 by logonsf.)
Just out of curiosity, is it possible for the navigation menu that this plugin generates to be 'open' for all pages, instead of only showing 'openning' the sections that are currently being accessed? I am wondering this because I wanted to see if GS could have a definitive, dynamic drop-down or fly-out menu structure that can be styled with CSS (and is consistent for all pages it is displayed on).
~~edit~~
Realised that the sitemap function performs this task. Forget my request and thanks for the functionality!
Posts: 5
Threads: 0
Joined: Apr 2011
mvlcek Wrote:crusher88 Wrote:My issue with the I18N plugin, is that I need to have a different template on some of my pages.
More specific, I need some of my pages to have a minimal template, with no header/footer or sidebar.
I have created this minimal template, and it worked fine until I started using the I18N plugin. Is there any (simple) way around this?
This is definitely not a problem of the I18N plugin. It does not in any way limit your usage of different templates. On http://mvlcek.bplaced.net I use several templates - for the demonstrations of top and pulldown menus and a minimal one for the gallery demonstration of the gallery type supersized.
Hmm... when I select the minimal template on a page with the primary language, I still get the "default" template on the secondary language page. I can't find any way of changing the template on the secondary language page. I want it to be the same as the primary language.
Posts: 2,094
Threads: 54
Joined: Jan 2011
crusher88 Wrote:Hmm... when I select the minimal template on a page with the primary language, I still get the "default" template on the secondary language page. I can't find any way of changing the template on the secondary language page. I want it to be the same as the primary language.
Now I understand the problem.
It's intentional that you can't change the template on the secondary page, but it's a bug that the default template is used - it should use the same template as configured for the primary page.
Thank you for pointing it out.
I18N version 1.4.3 fixes that bug: - Non-default-language pages now use the same template as the default-language-page.
Posts: 5
Threads: 0
Joined: Apr 2011
mvlcek Wrote:Now I understand the problem.
It's intentional that you can't change the template on the secondary page, but it's a bug that the default template is used - it should use the same template as configured for the primary page.
Thank you for pointing it out.
I18N version 1.4.3 fixes that bug:- Non-default-language pages now use the same template as the default-language-page.
Thanks a lot for your prompt solution, it works!
Posts: 2
Threads: 0
Joined: May 2011
hameau Wrote:AZ SnakePit Wrote:I also put get_i18n_navigation(return_page_slug()) in the sidebar. That only gives you top level menu entries. Change the sidebar to get_i18n_navigation(return_page_slug(),0,99), for example.
See the author's site (link in his signature) for full working examples. Perfect. Knew there was something obvious! Thanks a bunch.
Posts: 1,928
Threads: 88
Joined: Apr 2010
Thanks, it works now in all browsers
Posts: 135
Threads: 10
Joined: Aug 2010
2011-05-20, 17:30:06
(This post was last modified: 2011-05-20, 17:35:22 by spiderz.)
Great, great plugin!
Question: when choosing item from submenu the corresponding mainmenu item lose class="current'.
Did I misread your (excellent btw) instructions?
~~ EDIT ~~
Nevermind ... I see there is a class called "currentpath" !
Posts: 2,094
Threads: 54
Joined: Jan 2011
Rene Wrote:Great, great plugin!
Thanks :-)
Rene Wrote:Question: when choosing item from submenu the corresponding mainmenu item lose class="current'.
Did I misread your (excellent btw) instructions?
Yes, this is intended, but instead it has the class currentpath, which you can use to style it.
Posts: 7
Threads: 3
Joined: May 2011
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 ?.
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.
Thank you for such a incredible plugin.
|