Page 4 of 9

Re: One more approach to build a multilingual site with the regular CMSMS

Posted: Thu May 22, 2008 7:36 pm
by ZIGRIB
There is no difference with or without quotes.
always the same result :

other_languages=

other_language=

DEBUG:
language_codes=Array ( [0] => )
language_pages=Array ( [0] => )
language_versions=Array ( [] => )

Re: One more approach to build a multilingual site with the regular CMSMS

Posted: Thu May 22, 2008 10:17 pm
by alinome.net
I thought something. I think the content block

Code: Select all

{content block='Other languages' oneline='true' assign='other_languages' wysiwyg='false'}
must be before {language_menu} in the template, because of the "assign" parameter. Check that.

Re: One more approach to build a multilingual site with the regular CMSMS

Posted: Fri May 23, 2008 6:44 am
by ZIGRIB
YES !!!  ;D
it works well now!
thanks a lot of time dedicated to resolve my problem.
Just a last question:
I prefer using flags instead of the name of language, but how to have no flea located in front of the flag and so that it is not underlined?

I think i have found the solution alone  ;)
I just remove all line
        echo '';
        echo '';
      echo '';
      echo '';
      echo '';
in language_menu
for the underline I will modify my stylesheet...

Re: One more approach to build a multilingual site with the regular CMSMS

Posted: Fri May 23, 2008 8:23 am
by alinome.net
ZIGRIB wrote: it works well now!
Good! Don't forget to comment out again all the interesting debug lines  ;)

I changed the implementation guide to clearly explain this point.
ZIGRIB wrote: how to have no flea located in front of the flag and so that it is not underlined?
That depends on the CSS (cascade style sheets). You said you use this code for the menu:

Code: Select all

<div id='langmenu'>{language_menu}</div>
So just add the needed style commands to the stylesheet you associated with your template, e.g.:

Code: Select all

#langmenu ul {
    padding: 0;
    margin: 0;
    list-style: none; /* no fleas */
}
#langmenu ul li {
    margin:0.1em; /* gap between menu options */
}
#langmenu ul li a {
    text-decoration:none; /* no underline */
}
Some commands in that example are optional in your case. I took them, simplified, from a site of mine. If you are not  acquainted with CSS, I recommend you two sites: CSS Tutorial and Learning CSS.

Good luck. Please post a link to your site when it's ready.

Re: One more approach to build a multilingual site with the regular CMSMS

Posted: Fri May 23, 2008 8:29 am
by ZIGRIB
Ok I think your solution is better
Thanks for link I'll read it with attention.
When the site will ready i'll post the link here.

Re: One more approach to build a multilingual site with the regular CMSMS

Posted: Fri May 23, 2008 8:35 am
by alinome.net
ZIGRIB wrote: I just remove all line
        echo '';
        echo '';
       echo '';
       echo '';
       echo '';
in language_menu
Interesting solution :) Well, in your case it works fine because there's only two languages and the current one is not listed in the language menu... So in practice the "list" always has only one item, so you can delete all the list markup as you did. Nevertheless I prefer to use CSS for that kind of things and keep the XHTML untoched.

Re: One more approach to build a multilingual site with the regular CMSMS

Posted: Thu Aug 07, 2008 1:12 pm
by sirphuzz
Hi!

I'm using your method for a bilingual site. I have two questions, though:

1. I would like to put a delimiter between the language buttons in the menu. (I don't use the titles, only buttons.) Where in the code do I put it, so it only goes between the buttons, and not before the first item, or behind the last?

2. What do I do when I add a photo album? There is no content block to add other languages there? Is this simply not supported, or something someone is working on?

Thanks in advance!

Re: One more approach to build a multilingual site with the regular CMSMS

Posted: Thu Aug 07, 2008 4:58 pm
by alinome.net
sirphuzz wrote: 1. I would like to put a delimiter between the language buttons in the menu. (I don't use the titles, only buttons.) Where in the code do I put it, so it only goes between the buttons, and not before the first item, or behind the last?
The solution by Karolis is good. But I always prefer to avoid "hard" delimiters in lists, because of usability. I suggest you to use CSS instead:

Code: Select all

#langmenu ul {
  margin: 0;
  padding: 0;
  display: inline;
  }
#langmenu ul li {
  margin: 0;
  padding: 0 .5em 0 0;
  display: inline;
  list-style: none;
  }
#langmenu ul li+li {
  padding-left: .5em;
  border-left: 1px solid grey; /* vertical line to separate buttons */
  }
That's an example. The delimiter will be a vertical line you can configure. It will appear at the left of every button but the first. CSS provides ways to create any delimiter, text or image. This one is the simplest.
sirphuzz wrote: 2. What do I do when I add a photo album? There is no content block to add other languages there?
I don't understand what you mean. I never used a photo album with CMSMS. I think you have to do the same: one album for every language, as regular pages. But if the photo descriptions are stored in the database then there's no easy way to make them bilingual. Is that your problem?

Cheers,

Marcos

Re: One more approach to build a multilingual site with the regular CMSMS

Posted: Thu Aug 07, 2008 10:27 pm
by sirphuzz
Hi!

Thank you both for fast and good answers.

Right now my site is in some kind of maintenence (thank you, one.com!) so I can't try your suggestions, but I'm pretty sure the delimiters will work, I also like to use css when possible.

My second questions was how to make the other content types bilingual. Right now, I only get the content block to add other languages when I create a "Content" page.

I worked around the photoalbum by creating a content page and then manually adding the cms_module tag for the album module. This worked fine, but now I wanted to add a catalog.

So I created a category page, and a item page, and I can't make a content block for these types.

I tried adding the content block tag to the category template, but it didn't work.

What I want is to be able to create my category pages and item pages and use the same system to make them bilingual.

Is there any way to add the correct code that assigns the "en=alias;sv=alias" string to the $other_languages variable, in these content types? Can it be placed in the metadata field?

I would be really grateful if this could be made to work.

Re: One more approach to build a multilingual site with the regular CMSMS

Posted: Fri Oct 10, 2008 3:14 pm
by danilski
HI, I just want to thank the developers that created this approach to multilingual sites. I started to implement it on my site and it works like charm. Thanks a lot guys!!!

Re: One more approach to build a multilingual site with the regular CMSMS

Posted: Sat Oct 11, 2008 11:03 am
by alinome.net
danilski wrote: HI, I just want to thank the developers that created this approach to multilingual sites. I started to implement it on my site and it works like charm. Thanks a lot guys!!!
Happy that it's useful for you. Maybe you can post a link to your page after implementing it.

Regards,

Marcos

Re: One more approach to build a multilingual site with the regular CMSMS

Posted: Thu Oct 23, 2008 1:25 pm
by volcanoboy
Hi,

thanks for nice little multilingual fix. Good job :-)
I'm having one issue with an extra quote around my language links: LINK REMOVED

How do i get rid of them?

Cheers

Jon

Re: One more approach to build a multilingual site with the regular CMSMS

Posted: Thu Oct 23, 2008 8:56 pm
by alinome.net
volcanoboy wrote: I'm having one issue with an extra quote around my language links: [...]
How do i get rid of them?
It depends on why they appear [:-)]. This is your page's XHTML:

Code: Select all

<ul>
<li><a href="http://www.handelshusetmartinsen.no/huvudsida-se" title="Huvudsida" hreflang='se'>'<img xml:lang='se' src='/uploads/images/sitePics/se.gif' alt='Svenska' />'</a></li>
<li><a href="http://www.handelshusetmartinsen.no/home-en" title="Home" hreflang='en'>'<img xml:lang='en' src='/uploads/images/sitePics/gb.gif' alt='English' />'</a></li>
</ul>
The quotes are inside the links, outside the images. Please post the code you use to create your flag buttons (the $languages array definition) and I'll take a look. I suspect the quotes are there.

Cheers,
Marcos

Re: One more approach to build a multilingual site with the regular CMSMS

Posted: Thu Oct 23, 2008 10:51 pm
by volcanoboy
Hi marcos,

I copied the code from your example:

Code: Select all

  $languages = array(
  "no" => array("Hovedside-no", "<img xml:lang='no' src='/uploads/images/sitePics/no.gif' alt='Norsk' />"),
  "se" => array("huvudsida-se", "<img xml:lang='se' src='/uploads/images/sitePics/se.gif' alt='Svenska' />"),
  "en" => array("home-en", "<img xml:lang='en' src='/uploads/images/sitePics/gb.gif' alt='English' />") );

Re: One more approach to build a multilingual site with the regular CMSMS

Posted: Tue Oct 28, 2008 11:51 am
by volcanoboy
did you have a chance to look at my code?

Cheers  :)