Page 2 of 3

Re: Babel: Menu not showing

Posted: Sun Dec 19, 2010 5:53 pm
by solodok
Talked to plger (admin of project), he is planning to update module soon, great news! :)

Mr. Dude: What redirection method you are using? I have problems with hierarchy method, never tried second one with assigning..

Re: Babel: Menu not showing

Posted: Sun Dec 19, 2010 6:55 pm
by M@rtijn
Since the content for my website is not the same in both languages, i use the "Marcos Cruz's definition solution"

First line of my page template is

Code: Select all

{content block='languages' label='Other Languages' oneline='true' assign=other_languages wysiwyg='false'}
which gives me an extra content block when creating or editing a page. There you have to specify the url of the page in the other language. The user-redirection is the same for this method as the hierarchy solution (with the auto-redirect settings in babel).
I do not have '{babel action="assign"}' in the page-template, only the call above.

Awesome news by the way that Pierré is updating this module again!  8)

Re: Babel: Menu not showing

Posted: Tue Dec 21, 2010 2:16 pm
by plger
solodok wrote: Talked to plger (admin of project), he is planning to update module soon, great news! :)
I've made changes to Babel so that it supports cmsms' newer versions. Before I release it, however, I would like to test it a bit more. Anybody interested in testing it in the next few days can download it from the SVN or at www.plger.net/babel-0.4.zip

Plger

Re: Babel: Menu not showing

Posted: Tue Dec 21, 2010 2:44 pm
by M@rtijn
Dr.CSS wrote: I find it best to keep block names as one word then use label='Which lets You add all kinds of info to it'...
You're totally right!
I copied this from my sandbox whilst not really paying attention to the exact call. On my main website it uses a label.
Having spaces in the block name can indeed cause problems on some installations (I have experienced it with a block with 'extra keywords', which wasn't working, where 'keywords' did work)

I've edited the post! Thanks for your correction!

Re: Babel: Menu not showing

Posted: Tue Dec 21, 2010 6:17 pm
by M@rtijn
plger wrote: I've made changes to Babel so that it supports cmsms' newer versions. Before I release it, however, I would like to test it a bit more. Anybody interested in testing it in the next few days can download it from the SVN or at http://www.plger.net/babel-0.4.zip

Plger
Pierre,

I've installed your update to test it and have some bad news...  ::)

On my (sandbox)install the update causes problems. I'm using the Marco Cruz direction method, so when adding a page which has a 'brother', the other language is specified in a block with either 'en_GB=enhome' or 'nl_NL=home'. Works like a charm when you do not have the same page tree for both languages. Or actually, was working like a charm  ;D

I have a custom template which looks like this:

Code: Select all

   <div id="lang">
{foreach from=$languages item="language"}
{if $language->is_current}
      <img src="http://img.website.tld/{$language->name}.png" class="flag" height="17" width="24" title="{$language->name}" alt="{$language->name}"/>
{else}
      <a href="{$language->url}"><img src="http://img.website.tld/{$language->name}.png" class="flag" height="17" width="24" title="{$language->name}" alt="{$language->name}"/></a>
{/if}
{/foreach}
   </div>
HTML output on the English (marked as default language) part of the website is:

Code: Select all

   <div id="lang">
      <a href="http://www.website.tld/nl/home"><img src="http://img.website.tld/Nederlands.png" class="flag" height="17" width="24" title="Nederlands" alt="Nederlands"/></a>
      <img src="http://img.website.tld/English.png" class="flag" height="17" width="24" title="English" alt="English"/>
   </div>
All is well, but...

... when I go to the Dutch page, the HTML output is:

Code: Select all

   <div id="lang">
      <img src="http://img.website.tld/English.png" class="flag" height="17" width="24" title="English" alt="English"/>

   </div>
Notice that there is no image for the current page and the link around the image to the English part is gone.
The html output for that Dutch page should be:
<div id="lang">
<img src="http://img.website.tld/Nederlands.png" class="flag" height="17" width="24" title="Nederlands" alt="Nederlands"/>
<a href="http://www.website.tld/en"><img src="http://img.website.tld/English.png" class="flag" height="17" width="24" title="English" alt="English"/></a>
</div>
When I set the default language in Babel to Dutch, those pages are working perfect and the links to the English pages are screwed.

It seams that fixing the problems for the hierarchy method is now killing the marco cruz method.

Does this give you enough information to find the bug? If you need anything, let me know!

$page_lang not set correct

Posted: Wed Dec 29, 2010 1:18 pm
by Freight
plger wrote: Anybody interested in testing it in the next few days can download it from the SVN or at www.plger.net/babel-0.4.zip
Thanks for the update. Babel is very useful!

However there is a problem: After upgrading to 0.4 the $page_lang-Variable is not set correct any more. It always shows the default language.

any ideas?

Thanks a lot!

Re: $page_lang not set correct

Posted: Wed Dec 29, 2010 3:50 pm
by Freight
Freight wrote: After upgrading to 0.4 the $page_lang-Variable is not set correct any more.
I have found the problem.
// I just don't know why, but between 1.8.x and 1.9 hierarchy levels just dropped of 1...
I am using CMSms 1.9.2 and it seems, that the hierarchy levels are not dropped.

So in babel.module.php:604 of version 0.4 I changed from

Code: Select all

while( isset($currentNode) && $currentNode->getLevel() > ($post19?-1:0) ){
back to

Code: Select all

while( isset($currentNode) && $currentNode->getLevel() > 0 ){
And all is fine :-)

Re: Babel: Menu not showing

Posted: Wed Dec 29, 2010 4:10 pm
by M@rtijn
Freight,

Awesome! That also solved my problem!

Thank you for thinking with Pierre!

Re: Babel: Menu not showing

Posted: Thu Jan 06, 2011 12:13 am
by solodok
Freight, big thanks, also helped me.

But i found another one bug:
I have more than 10 sub categories in both languages,
and when I'm on 1.2.1 page, second language link is pointed to 2.2.10 not to 2.2.1.
And it is in both ways (2.2.10.x = 1.2.1.x in second language)
Maybe there is solution for such situation? 8)
Using CMSMS 1.9.2.
Updated Babel 0.4 + Freight fix
URL - http://gira.e-move.lv
Thank you :)

Re: Babel: Menu not showing

Posted: Wed Jan 12, 2011 10:47 pm
by plger
solodok: just to make sure (I'm quite sure I know the problem), I suppose you're using the unofficial version linked above?

Re: Babel: Menu not showing

Posted: Thu Jan 13, 2011 10:45 am
by solodok
plger: Yes, you're right!
Downloaded from www.plger.net/babel-0.4.zip

Re: Babel: Menu not showing

Posted: Fri Jan 14, 2011 7:27 pm
by plger
I've updated the SVN and the www.plger.net/babel-0.4.zip file. You're invited to test it. I'll release as soon as it has been tested enough...
Plger

Re: Babel: Menu not showing

Posted: Sun Jan 16, 2011 9:23 pm
by solodok
Thanks, problem now is solved! :)

But returned old one (that one that was solved by Freight).. English is showing as actual language in both versions.

Re: Babel: Menu not showing

Posted: Mon Jan 17, 2011 10:33 am
by plger
I think the version just released in the forge should solve both problems.

Re: Babel: Menu not showing

Posted: Sat Jan 22, 2011 1:13 pm
by solodok
Plger: Thank you! :) Updated, now it works fine! ;)