Topic: Integrating Multiple Languages Into Site/Menu System

FIRST:  I'm a new user to Wolf CMS and I already love everything I'm doing with the software.  It is wonderful.  I've been looking for a CMS like this for so long and it is exactly was I need!  Thank you to all of you that develop and help the project as you are all doing great work.

Now, to my issue.  I have been tinkering around with some different layout options for the site I am working on and I'm having a slight problem figuring out the best way to use 2 or more languages on the site.  This isn't a requirement for, now but it will be down the road and trying to get all the legwork done now so implementation down the road will be easy.  Just a quick un-comment of a snippet or something like that and we're in business wink

Though trial and error I've come up with this solution, and I'm not sure if it is the best solution.  Right now I have the site setup as follows:

Root Home Page (redirects to eng)
|_ eng (English)
|      |_Page 1
|            |_SubPage1
|      |_Page 2
|      |_Blah...
|
|_spa (Spanish)
        |_Page 1
              |_SubPage1
        |_Page 2
        |_Blah...

Essentially Page 1 is the same for eng and spa except they are titled differently appropriately for their language.

The first menu is easy, the one for the languages, as I have those set as childs to the main page.  This menu is just a small text link menu at the top right of the site and works perfectly.

The second menu is where I'm having an issue...   The second menu should be a listing of the childs to the individual languages.  For example, I cannot figure out how to get the childs to eng to list on eng.html and all of its' childs and sub-childs, while the menu changing appropriately when I link to a page that is a child to spa.

I hope I'm making sense here....

The third menu would be for those select pages that have childs on, but I'm not concerned with this as they aren't important if I can't get the second menu working right.

I'm sure someone here knows the answer to my quandary and that the answer is probably staring me in the face in one of the posts here in the forums, but I have been tinkering back and forth for 3 days and am fresh out of ideas...

Thanks for all you do...

Thumbs up

Re: Integrating Multiple Languages Into Site/Menu System

Please, check this one first.
Don't know if you've seen it before.

Wolf CMS Paper Guy
Wolf CMS related blog / journal at Project 79 | Wolf CMS Docs

3

Re: Integrating Multiple Languages Into Site/Menu System

The discussion jackie pointed to is the "motherlode", I think. But if you check SVN, commits 153-157 are for a new "multi_lang" plugin. See its "readme.txt" for more info.

Perhaps worth grabbing the nightly from the Downloads page, and giving it a whirl?

4

Re: Integrating Multiple Languages Into Site/Menu System

Static Geek wrote:

...For example, I cannot figure out how to get the childs to eng to list on eng.html and all of its' childs and sub-childs, while the menu changing appropriately when I link to a page that is a child to spa.

Hi again, SG - I wasn't sure if you have seen this info from the Wiki. That might help to explain why the sub-child find isn't working so well.

Another resource (which you may well have seen already) is the Navigational Cookbook which gives you some recursive options for menus. I'm not sure how well they would apply to your "eng/spa" arrangement. Worth a look in any case, I expect.

Re: Integrating Multiple Languages Into Site/Menu System

I download Wolf from SVN with  "multi_lang" plugin and there is a question...
How to use a multilanguage in modules when I view pages in language what are different from main.. Example, main language for frontend is russian and I add english version of a page...
Comments in a english version of a page uses russian language file instead to use english language file... And so on for other modules...

Last edited by PhantomUA (2010-03-22 15:34)

Thumbs up

Re: Integrating Multiple Languages Into Site/Menu System

Well, the multi_lang plugin is intended to help out... it doesn't do everything. (yet maybe?)

Currently it only serves up alternative content for a page based on language choice. It doesn't (at all) touch other plugins or dynamically created content.

If you're checking what language a user want's by way of the preferred language setting in the browser, you could get that with:

<?php
use_helper('I18n');
$langs = I18n::getPreferredLanguages();
?>

You can then include different snippets of information based on language preference.

Wolf CMS founder and lead developer
Please always check the Support forums and Wiki before asking. (My Ohloh account.)
Like Wolf CMS? Consider making a financial contribution.

Re: Integrating Multiple Languages Into Site/Menu System

mvdkleijn wrote:

Well, the multi_lang plugin is intended to help out... it doesn't do everything. (yet maybe?)

Would be great to support changing plugin language based on the current page language

How can I get current page language (not preffered) ? Example, /ru/about.php or /en/about.php - give me ru or en in result

Last edited by PhantomUA (2010-03-23 00:35)

Thumbs up

Re: Integrating Multiple Languages Into Site/Menu System

PhantomUA wrote:

How can I get current page language (not preffered) ? Example, /ru/about.php or /en/about.php - give me ru or en in result

Phantom -

You should be able to get that by just parsing the URI with a single line of code embedded in the page.

<?php
// PHP 4 or PHP 5
list($one, $two, $three) = explode('/', $_SERVER["REQUEST_URI"]);
?>

If your url is http://www.example.com/ru/page/page.html then $one will be null $two will = "ru" and $three will be the rest.  The domain name itself should be ignored.

Thumbs up