Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-11-13 09:09:52

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Is this possible/a good idea for dealing with multi-language sites

I’m interested in TXP’s ability to run multiple sites from the same install, like this…

Main Install – http://mysite.com/ – Table prefix N/A
English site – http://mysite.com/english – Table prefix _en
Spanish site – http://mysite.com/spanish – Table prefix _sp
German site – http://mysite.com/german – Table prefix _gr

What do I need to do to do this?
Will it work well do you think?

Offline

#2 2006-11-14 11:59:22

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: Is this possible/a good idea for dealing with multi-language sites

i am working multilingual over here differently (not with sections)
1. custom php analyses preferred browser language first.
2. articles use category2 to have distinct language assigned (“english”,“deutsch”,“multilingual” – problem arising with services like technorati arising out of this: most tags (in my case) appearing there say “english” or “deutsch” – another approach won’t help it much, though, cause technorati would still list categories as tags instead of certain custom field entries or alike)
3. more custom php selects articles on base browser language referring to the appropriate cat2.

the beauty of this is, that having similar articles for all languages is not necessary.
the non-beauty is, that you’d be forced to run the browser based php all over the place, for each category title, comment form, all navigation titles etc. loadsa waork to get thi sgoing, and not very changeable (becuase you simply leave it like that, when you did it once, otehrwise you run into all this work again…)

just take a look at my site and you’ll know.


A hole turned upside down is a dome, when there’s also gravity.

Offline

#3 2006-12-11 17:37:53

shearstock
Member
From: Dorset, UK
Registered: 2006-01-29
Posts: 18
Website

Re: Is this possible/a good idea for dealing with multi-language sites

Jayrope, I would be interested to see your custom php code – I need to implement a dual language site. Each page will have a version in English and a version in Urdu, what is the best way to implement this? I want the user to be able to select their language and use cookies to do the rest. . . . . but I don’t know where to begin!

Offline

#4 2006-12-11 18:09:18

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: Is this possible/a good idea for dealing with multi-language sites

- preparation: articles (i use cat2) need to be assigned a language (or no language to display them always (or never), regardless of language pref)
- i use a php based browser language detection in a form, the result is stored in a sessionID. detection see here
- if user wants a different language, then he/she can override/replace the sessionID value from a dropdown menu.
- i don’t store this in a cookie. i delete cookies on every browser shutdown, therefore they won’t store anything for longer than one visit. if in question see php.net on storing cookies.
- articles display is handled finally is done with some forms in txp like
<txp:php>
if ($_SESSION['myLanguage'] == 'en') {
echo '<txp:article_custom category="English" />';
}

hope that helps.

oh: WHAT IS URDU??

tooooot

Last edited by jayrope (2006-12-11 18:11:39)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#5 2006-12-11 21:24:06

aba
Plugin Author
Registered: 2004-04-14
Posts: 119

Re: Is this possible/a good idea for dealing with multi-language sites

jayrope wrote:

oh: WHAT IS URDU??

a language that is spoken in pakistan india

Offline

Board footer

Powered by FluxBB