Jump to content

Current best way for a dual-language site?


Godfrey
 Share

Recommended Posts

Hi everyone,

I just wanted to get some advice on what's the current best known way(s) and page structuring methods to create a simple dual language site.

Sorry if this may seem to be a bit repetitive of a topic because of all the past posts on language. But I've been reading a lot of these past posts, and some of them seem they may be outdated as they refer to "coming-soon" methods. I was wondering if there were new features of 2.3 I should be utilizing. 

For example, a lot of threads point to the localized URL, but now that module says there is a new feature I should rely on LanguageSupportPageNames, though I can't seem to find that in 2.3. 

Anyway, I'm simply looking to create two versions of the front-facing site. I don't care so much about creating two different language versions for the PW administration system, which I think is what some multi-language support modules in PW help with? (ex multi-language and language-alternate fields?)

So what are some of the methods you guys find works really well? And what are the modules/field-types you would use for each method?

Not sure if these are good methods, but for example maybe:

  1. Have two versions of each field in each page, one in English and one in the other language. Then, setup a URL system and depending on the URL detected (/en/ or /ch/), output the appropriate field (e.g. body_english).
  2. Have a whole separate tree for the other language. Though I'm not sure how I would have one template be used for both languages, and have the "home" link go to the respective homes pages. 

Thanks for any input!

update: I also realized that I can implement method #1 with Language-Alternate Fields. But I'm wondering if I would use javascript to change the user's language ($user->language = ...... ) upon the click of a link, and have that page refresh automatically and display the clicked language. Or how I could insert a URL segment (go from site.com/en/page.php to site.com/ch/page.php) ?

Link to comment
Share on other sites

Thanks for pointing me in the right direction, dragan! I can't believe I missed multi-language urls. I'm trying it out, and so far yes it is seems to work like magic.

Though one little thing is (not quite related), should the version # at the bottom of the admin panel should still read "2.3.0" even after upgrading?

Link to comment
Share on other sites

Though one little thing is (not quite related), should the version # at the bottom of the admin panel should still read "2.3.0" even after upgrading?

Mine reads 2.3.3...Not sure whether you need to clear some cache, etc? 

Try this on a template file:

echo "<h3>The installed PW Version is: <strong>{$config->version}</strong></h3><hr>"; //system version

That will tell you the PW version installed.

  • Like 1
Link to comment
Share on other sites

Oh woops, it says 2.3.0. Thanks for pointing that out kongondo. Being klutzy with Github, I realized installed the master 2.3.0 version. Strange that multi language urls still seemed to work though. Got it fixed now!

They work in 2.3.0 too, it's just that they are a whole lot farther along in 2.3.4 than in 2.3.0 (and more stable too). So if you are building a site around multi-language URLs, it's worth the risk of using a dev branch (IMO) relative to the benefits you get in this aspect. 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...