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.
Post Reply
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 »

Sorry for the delay. Usually I receive an email when someone posts to this thread, but it seems it didn't work.

volcanoboy wrote:

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



Everything seems OK...

I've taken a look into the code that builds the language menu and everything seems OK with quotes...

Do you call {language_menu} with parameters? If so, what? Post that line. That could help to trace the issue.

I see you made a little change in the code: the quotes. In theory it doesn't matter but... Please use single quotes for PHP parameters in the language array definition (they are faster because they don't intepret variables inside) and double quotes for XHTML parameters. That's how the original code did. Change them and tell me what happens.

Cheers,
Marcos
Last edited by alinome.net on Fri Oct 31, 2008 11:56 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,

this is how i call it in my template:

Code: Select all

<div id="languagewrapper">{language_menu}</div>


I also tried to replace my code with the one you pasted, but i still get a single quote around my imagelinks.

Thanks

Jon
volcanoboy

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

Post by volcanoboy »

btw...if you want i can make a admin account for you if that's easier  ???
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:this is how i call it in my template:

Code: Select all

<div id="languagewrapper">{language_menu}</div>



There's nothing wrong there.

volcanoboy wrote:I also tried to replace my code with the one you pasted, but i still get a single quote around my imagelinks.


But the code in my last message was yours quoted, unchanged. I suggested to change the quotes, but I didn't. Try this:

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


In theory it makes no difference, but let's see.

Marcos
Marcos Cruz
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:btw...if you want i can make a admin account for you if that's easier  ???


Try to change the quotes first. If nothing changes, send me a private message with a count and I'll investigate the problem. It's very strange.

Marcos
Marcos Cruz
volcanoboy

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

Post by volcanoboy »

alinome.net wrote:
volcanoboy wrote:this is how i call it in my template:

Code: Select all

<div id="languagewrapper">{language_menu}</div>



There's nothing wrong there.

volcanoboy wrote:I also tried to replace my code with the one you pasted, but i still get a single quote around my imagelinks.


But the code in my last message was yours quoted, unchanged. I suggested to change the quotes, but I didn't. Try this:

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


In theory it makes no difference, but let's see.

Marcos



What do you know..this worked perfectly  :)
Thanks again for this fix. It really did save me alot of hassle on this project.
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:What do you know..this worked perfectly  :)
Thanks again for this fix. It really did save me alot of hassle on this project.


Great! But I still don't understand why those quotes appear in the XHTML when single and doubles quotes are changed in the array content...  Anyway the quotes are the "right way" in the installation guide. Now we know we should not touch them [ :)].

Marcos
Marcos Cruz
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 »

alinome.net wrote:
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



Sure, Marcos - the site is for Diode-pumped solid-state lasers by Cutting Edge Optronics, Russian office. The site is bi-lingual. I think I made reference logic very convenient: the aliases for Russian pages are the same as for English ones with the prefix "ru-". This way you can switch between pages without introducing special field responsible for giving a correct counterpart to a particular page.

Cheers,

Dan
Last edited by danilski on Fri Nov 14, 2008 6:35 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 »

danilski wrote:Sure, Marcos - the link is http://ceolaser.ru/home.html - the site is dedicated to representation of Cutting Edge Optronics in Russian Federation.


Looks great, good job, Dan.

danilski wrote:I think I made reference logic very convenient: the aliases for Russian pages are the same as for English ones with the prefix "ru-". This way you can switch between pages without introducing special field responsible for giving a correct counterpart to a particular page.


I used a similar system in the first versions of the code (still found at the start of this thread). Then I improved it to allow different page names in every language (what has some usability and SEO advantages), but the code allows both methods. Your system is easier for the webmaster and the content editor, I think, but maybe for Russian visitors it would be nicer to see Russian URLs in the Russian pages.

Cheers,

Marcos
Marcos Cruz
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 »

I used a similar system in the first versions of the code (still found at the start of this thread). Then I improved it to allow different page names in every language (what has some usability and SEO advantages), but the code allows both methods. Your system is easier for the webmaster and the content editor, I think, but maybe for Russian visitors it would be nicer to see Russian URLs in the Russian pages.


Marcos - very good point for the languages that use Roman alphabet. Advantages: SEO and user convenience.
However, I could not use Russian (cyrilic) letters in URLs. In fact, whenever I inserted Russian letters in the alias, they were ignored by CMSMS, and I could see nothing in browser.... Of course, I could use Russian words transliterated into English, but this way it should not help SEO with Russian spiders that much (I doubt they index transliterated Russian words).

And by the way, did not mean to take away credit from you for using aliases for switching pages: I probably just missed your posts on this matter or simply forgot about it by getting to the bottom of this long trend :)
Last edited by danilski on Fri Nov 14, 2008 8:11 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 »

danilski wrote:However, I could not use Russian (cyrilic) letters in URLs.


I suspected that. I hope in the future it will be easier (I think not only about CMSMS but all programs and the URLs in general). The problem is similar for Latin letters that don't belong to the English alphabet. Though in theory it's possible to use them in URLs, in practice it's not safe yet. I myself use Spanish URLs with English letters (á -> a, ñ -> n...). It looks strange but it's the only way to avoid problems.

danilski wrote:And by the way, did not mean to take away credit from you for using aliases for switching pages: I probably just missed your posts on this matter or simply forgot about it by getting to the bottom of this long trend :)


I didn't think about credit :D, I just wondered if you had used an old version or had hacked the final code to make it work like the old one!

Cheers,
Marcos
Marcos Cruz
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 »

danilski wrote:I just wondered if you had used an old version or had hacked the final code to make it work like the old one!


I hacked the final code.
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 »

It is interesting, by the way, is it possible to force CMSMS work with two or more subdomains for separate languages, i.e.

fr.yourdomain.com - for French
ru.yourdomain.com - for Russian
en.yourdomain.com - for English
...etc

If anyone knows if it's possible to configure CMSMS this way, I'd greatly appreciate the advice how exactly to do this.

Thanks,

Dan
dung
New Member
New Member
Posts: 8
Joined: Wed Dec 31, 2008 2:47 pm

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

Post by dung »

Dear Marcos,

Thank you for your effort and support about this approach for mutlilangual site.
I tried to implement all the codes you gave.
It must working, but I have a problem to display the menu (a hroizontal one).

When I did this step :

Step 4: Create the content menu
How do you show in your navigation menu only the pages in the current language?
You can use the {menu} tag with the parameter start_element, to select the root section header of the language
.

You wrote : select the root section header, but this root section is hidden (not displayed in the menu in the step 1) !

So how can I see all the sections under this language ?

Thank you in advance for your support.

dung
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 »

dung wrote:It must working, but I have a problem to display the menu (a hroizontal one).

When I did this step :

Step 4: Create the content menu
How do you show in your navigation menu only the pages in the current language?
You can use the {menu} tag with the parameter start_element, to select the root section header of the language
.

You wrote : select the root section header, but this root section is hidden (not displayed in the menu in the step 1) !

So how can I see all the sections under this language ?


Hi dung, I'm glad this program is useful to you.

Yes, the root section is hidden because it's used only to organize the pages. But if you select it with start_element you will get all pages under it. I don't remember all the parameters of the {menu} tag. In step 4 I mentioned start_element and start_level, but in my site I used start_page. It depends on what you need. Read the help of the menu module to learn how to use all its parameters and try them.

Hope this helps.

Cheers,

Marcos
Marcos Cruz
Post Reply

Return to “Tips and Tricks”