CMS Made Simple Forums
https://forum.cmsmadesimple.org/

One more approach to build a multilingual site with the regular CMSMS
https://forum.cmsmadesimple.org/viewtopic.php?f=4&t=19099
Page 5 of 9

Author:  alinome.net [ Fri Oct 31, 2008 11:54 am ]
Post subject:  Re: One more approach to build a multilingual site with the regular CMSMS

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

volcanoboy \volcanoboy:
\$1:
  $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

Author:  volcanoboy [ Tue Nov 04, 2008 11:37 am ]
Post subject:  Re: One more approach to build a multilingual site with the regular CMSMS

Hi,

this is how i call it in my template:
\$1:
<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

Author:  volcanoboy [ Tue Nov 04, 2008 11:40 am ]
Post subject:  Re: One more approach to build a multilingual site with the regular CMSMS

btw...if you want i can make a admin account for you if that's easier  ???

Author:  alinome.net [ Tue Nov 04, 2008 12:26 pm ]
Post subject:  Re: One more approach to build a multilingual site with the regular CMSMS

volcanoboy \volcanoboy:
this is how i call it in my template:
\$1:
<div id="languagewrapper">{language_menu}</div>



There's nothing wrong there.

volcanoboy \volcanoboy:
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:

\$1:
 $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

Author:  alinome.net [ Tue Nov 04, 2008 12:29 pm ]
Post subject:  Re: One more approach to build a multilingual site with the regular CMSMS

volcanoboy \volcanoboy:
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

Author:  volcanoboy [ Tue Nov 04, 2008 12:51 pm ]
Post subject:  Re: One more approach to build a multilingual site with the regular CMSMS

alinome.net \alinome.net:
volcanoboy \volcanoboy:
this is how i call it in my template:
\$1:
<div id="languagewrapper">{language_menu}</div>



There's nothing wrong there.

volcanoboy \volcanoboy:
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:

\$1:
 $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.

Author:  alinome.net [ Tue Nov 04, 2008 5:44 pm ]
Post subject:  Re: One more approach to build a multilingual site with the regular CMSMS

volcanoboy \volcanoboy:
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

Author:  danilski [ Thu Nov 13, 2008 1:20 pm ]
Post subject:  Re: One more approach to build a multilingual site with the regular CMSMS

alinome.net \alinome.net:
danilski \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!!!


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

Author:  alinome.net [ Thu Nov 13, 2008 2:11 pm ]
Post subject:  Re: One more approach to build a multilingual site with the regular CMSMS

danilski \danilski:
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 \danilski:
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

Author:  danilski [ Fri Nov 14, 2008 8:05 am ]
Post subject:  Re: One more approach to build a multilingual site with the regular CMSMS

\$1:
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 :)

Author:  alinome.net [ Fri Nov 14, 2008 12:32 pm ]
Post subject:  Re: One more approach to build a multilingual site with the regular CMSMS

danilski \danilski:
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 \danilski:
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

Author:  danilski [ Fri Nov 14, 2008 3:05 pm ]
Post subject:  Re: One more approach to build a multilingual site with the regular CMSMS

danilski \danilski:
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.

Author:  danilski [ Thu Nov 27, 2008 3:45 pm ]
Post subject:  Re: One more approach to build a multilingual site with the regular CMSMS

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

Author:  dung [ Tue Jan 06, 2009 4:46 pm ]
Post subject:  Re: One more approach to build a multilingual site with the regular CMSMS

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

Author:  alinome.net [ Tue Jan 06, 2009 5:28 pm ]
Post subject:  Re: One more approach to build a multilingual site with the regular CMSMS

dung \dung:
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

Page 5 of 9 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/