1
fla-ts
Menu languages
  • 2014/3/16 15:22

  • fla-ts

  • Friend of XOOPS

  • Posts: 204

  • Since: 2005/1/4 1


Hello everyone, it's been a long time I was here.

I have the following. On dutch speaking part of my website is a Dutch menu item, the same item is also in the English version (in English) with the entry in the description 'under construction', although this will never be made. Now I would really know how I can change this so that it is no longer visible on the English menu this.

It may be that I've already been asked in the past, my apologies, anyway I cannot find it.
Btw started this as a new topic, hope that’s okay

2
Mamba
Re: Menu languages
  • 2014/3/16 19:04

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


Try to remove the English translation. I guess, if there is no English text, the user could not click on it.

[EDIT] I went to you site, but I don't see anything "Under Construction"
Where is it?
[/EDIT]
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

3
fla-ts
Re: Menu languages
  • 2014/3/17 7:45

  • fla-ts

  • Friend of XOOPS

  • Posts: 204

  • Since: 2005/1/4 1


Indeed , I had changed to a long time ago:
“METAL PROFILES”
“Sorry only available in Dutch at this moment, please contact if needed in Englisch”
You solution seems best to me, I'll try it later because I expect a number of visitors to the site today. I let you know.

I’l have another issue, but that's for later, I'll try it myself first

4
fla-ts
Re: Menu languages
  • 2014/3/19 17:35

  • fla-ts

  • Friend of XOOPS

  • Posts: 204

  • Since: 2005/1/4 1


Hi, I have tried as you suggested, and now I get on the English menu a small button that can still be selected, after selection I come in the Dutch content.
Any idea?

Someone recently asked me to make a French version of an application.Thiswould really start giving it a problem to announce it on my website.
If those buttons just stand there without name that is not so bad as long as they can’t be selected, if you know what I mean

5
Mamba
Re: Menu languages
  • 2014/3/20 0:10

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


I talked to Bleekk and he agreed that it might be possible to do it by checking if the text is empty, and if yes then not display the menu item.

This way it should work for you. I hope, he'll test it soon and release a new version of MyMenus incorporating it.

Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

6
fla-ts
Re: Menu languages
  • 2014/3/20 7:13

  • fla-ts

  • Friend of XOOPS

  • Posts: 204

  • Since: 2005/1/4 1


Good morning.
that's great, please, keep me informed, meanwhile I will restore my website as it was.
If Beekk succeeds, it might be a major update for many

7
Mamba
Re: Menu languages
  • 2014/3/21 7:15

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


OK, it is done and seems to be working now. I set a test on your Website, so you can check it out - it's only visible for Webmasters, so don't worry about other people seeing it. It works for Dutch language, but in English the empty space is not visible anymore. Now, how it was done? Let's assume that you had as a starting point this link Title in MyMenus:
[nl]Dutch link[/nl][en]English link[/en]
And then decided that you want only a menu for the Dutch users. So you would remove the English part and leave like this:
[nl]Dutch link[/nl]
That would show fine in Dutch, but in English, XOOPS was still rendering the menu structure, it was just leaving it empty, because xLanguage didn't have anything for English. I was going to check for an empty string in the Link Title because I assumed the in English it will be empty. But the problem was that xLanguage kicks in at the browser level, so at the code level the value of the Title was still something like:
[nl]Dutch link[/nl]
i.e. it was not empty. I was thinking that I'll need to somehow get to xLanguage and test the value of the link against the language, but Bleekk suggested to test it at the Smarty level, and it was the right suggestion What XOOPS has is a Smarty variable
<{$xoops_langcode}>
which shows the code of the current language. So if I am in English, the value would be "en", and it Dutch "nl" So what I did was to test for that value of the current language in the link Title, and if the value was there (for example, for Dutch it would be "[nl]"), I would let MyMenus render the menu, otherwise it would stay empty. So in the Smarty template I've added this check:
<{assign var=myStr value="["|cat:$xoops_langcode|cat:"]"}>

<{if 
$menu.title|strstr:$myStr}>
1) Basically we create a string "myStr" with the language tag for the current language, so for Dutch it would be [nl] 2) Then we check if this language tag is in the link's Title. Assuming that the Title is:
[nl]Dutch link[/nl]
it will show the link only when we have selected Dutch as the current language It is actually a pretty simple solution that will work for any language. I'll add it to the SVN, so the next release of MyMenus will have this feature as a standard Once again thanks to Bleekk who redirected my thinking to a Smarty solution, which in the end was much simpler than what I was considering in the first place
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

8
fla-ts
Re: Menu languages
  • 2014/3/21 10:12

  • fla-ts

  • Friend of XOOPS

  • Posts: 204

  • Since: 2005/1/4 1


Works fine,did the test, thanks for the detailed explanation.
Unfortunately, the items on the menu downloads are gone, hope I've done nothing wrong, do not think so, did not do anything at the download menus.

9
Mamba
Re: Menu languages
  • 2014/3/21 11:22

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


Don't worry, it's all good

The issue is that you use language tags in some menus, and not in the others. So we need to change it so it will recognize if there are language tags at all (then it will check for the current language), but if there are no language tags at all, then it will do nothing.

Right now is all back to the way it was before, but at least you've seen how it will work once we finish it

Trabis also recommended to take into consideration that some people won't use text but instead they use images. Hopefully, we'll be done with it this weekend...
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

10
fla-ts
Re: Menu languages
  • 2014/3/21 11:28

  • fla-ts

  • Friend of XOOPS

  • Posts: 204

  • Since: 2005/1/4 1


Okay, I'll wait, or do I have do something

Login

Who's Online

326 user(s) are online (168 user(s) are browsing Support Forums)


Members: 0


Guests: 326


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits