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

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
ZIGRIB
Forum Members
Forum Members
Posts: 20
Joined: Wed Apr 23, 2008 3:31 pm

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

Post 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 ( [] => )
User avatar
alinome.net
Forum Members
Forum Members
Posts: 124
Joined: Thu Jan 25, 2007 2:54 pm
Location: España / Hispanujo / Spain

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

Post 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.
Marcos Cruz
ZIGRIB
Forum Members
Forum Members
Posts: 20
Joined: Wed Apr 23, 2008 3:31 pm

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

Post 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...
  • Last edited by ZIGRIB on Fri May 23, 2008 8:24 am, edited 1 time in total.
    User avatar
    alinome.net
    Forum Members
    Forum Members
    Posts: 124
    Joined: Thu Jan 25, 2007 2:54 pm
    Location: España / Hispanujo / Spain

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

    Post 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.
    Last edited by alinome.net on Fri May 23, 2008 8:26 am, edited 1 time in total.
    Marcos Cruz
    ZIGRIB
    Forum Members
    Forum Members
    Posts: 20
    Joined: Wed Apr 23, 2008 3:31 pm

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

    Post 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.
    User avatar
    alinome.net
    Forum Members
    Forum Members
    Posts: 124
    Joined: Thu Jan 25, 2007 2:54 pm
    Location: España / Hispanujo / Spain

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

    Post 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.
    Marcos Cruz
    sirphuzz
    Forum Members
    Forum Members
    Posts: 18
    Joined: Thu Aug 07, 2008 1:07 pm

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

    Post 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!
    User avatar
    alinome.net
    Forum Members
    Forum Members
    Posts: 124
    Joined: Thu Jan 25, 2007 2:54 pm
    Location: España / Hispanujo / Spain

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

    Post 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
    Last edited by alinome.net on Thu Aug 07, 2008 5:00 pm, edited 1 time in total.
    Marcos Cruz
    sirphuzz
    Forum Members
    Forum Members
    Posts: 18
    Joined: Thu Aug 07, 2008 1:07 pm

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

    Post 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.
    danilski
    Forum Members
    Forum Members
    Posts: 18
    Joined: Sun Oct 05, 2008 10:36 am

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

    Post 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!!!
    User avatar
    alinome.net
    Forum Members
    Forum Members
    Posts: 124
    Joined: Thu Jan 25, 2007 2:54 pm
    Location: España / Hispanujo / Spain

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

    Post 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
    Marcos Cruz
    volcanoboy

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

    Post 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
    Last edited by volcanoboy on Wed Nov 05, 2008 7:55 am, edited 1 time in total.
    User avatar
    alinome.net
    Forum Members
    Forum Members
    Posts: 124
    Joined: Thu Jan 25, 2007 2:54 pm
    Location: España / Hispanujo / Spain

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

    Post 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
    Last edited by alinome.net on Wed Nov 05, 2008 8:55 am, edited 1 time in total.
    Marcos Cruz
    volcanoboy

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

    Post 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' />") );
    volcanoboy

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

    Post by volcanoboy »

    did you have a chance to look at my code?

    Cheers  :)
    Post Reply

    Return to “Tips and Tricks”