Multi-Language Switch -> Page-by-Page

If you have created additional (non official) documentation or tutorials or something like that please post this here
Post Reply
ShyGuy
Posts: 158
Joined: Sat 11. Nov 2006, 15:27
Location: DE-Hannover
Contact:

Multi-Language Switch -> Page-by-Page

Post by ShyGuy »

-
Hello,

In trust of the education level in Germany, I 'll not spend the time to include a German translation.
I used the Multi-Language script from Pepe (many thanks for your assistance) since I begun with PHPWCMS.
But every time I needed to add new pages, I felt the pain with the article aliases each new content needs to get
manually. Then the day arrived, where I decided not to continue with German pages anymore...

Last week the decision has been made to have a multi-lingual site again, but with 4-5 different languages.
When I remembered my personal alias disaster, I started to think about other CMS but I like PHPWCMS very
much and that's why I wanted to give an other idea a chance.

Our current site now uses different installations, stored in their own folders / sub domains - one for each language.
This -hopefully- gives me more advantages than the solution Pepe was providing. But I took the main idea and the
script from Pepe to make what I now have.

I organized my directory as follows:
html/en
html/fr
html/es
html/pt

then I assigned the following subs to them
en.domain.tld
fr.domain.tld
es.domain.tld
pt.domain.tld

In every template, I have links like this

Code: Select all

<li><a href="http://en.domain.tld{PHP:template/inc_script/switch.php}" target="_self">english</a></li>
<li><a href="http://es.domain.tld{PHP:template/inc_script/switch.php}" target="_self">español</a></li>
and the corresponding script in template/inc_script/

Code: Select all

<?PHP
$url = FE_CURRENT_URL;
$search = strpos($url, "domain.tld") + 9;
$urlint = substr($url, $search);
echo $urlint;
?>
This script needs to be modified a bit because the value '9' varies with the length of the domain name I use.
Possibly there's a smarter way to do what I did but I do not have any PHP experiences...

Finally, all I need to do when I want to add a new language, is the following:
- make a database backup from the preferred sub domain. I use our English page
- create a new folder, e.g. ES, FR, PL, ...
- assign a sub domain to the new folder (Confixx, Plesk or whatever), this sometimes needs a while until is has been processed by the system
- copy the complete EN-folder into the ES-folder (http://bfexplorer.sourceforge.net) is an excellent choice if you use a larger amount of storage
- create a new database
- copy the database backup you made from the English page into the new database (I used http://www.mysqldumper.de)
- finally assign the database to the PHPWCMS installation you use in the new folder by changing it in the config.in.php

This can be done within a few minutes but you can imagine how painful it is to make a copy in the tree-view and manually change all aliases !


Now you need to insert / change the links to switch the page somewhere in your template.

I chose this solution because
- my article tree-view was horrible when I tried to manage only two (!) languages in one installation
this often results in changes I made at placed where I don't wanted to make them
- I expect easier management of language specific images, pdf-files and other external content
- I expect easier management of language specific templates
- I'm full of hope to find a way to synchronize two folders / databases, simplifying later changes

I do not have so many experiences but I think it should be possible to find a solution for adequate synchronizing.
If I need to add content to all subs, I would like to modify in the English page first, synchronize the EN-FR folders, synchronize the EN-FR
databases and make the translation in the FR-installation. That's my final target.


Stefan
-
User avatar
informavore
Posts: 1
Joined: Thu 17. Sep 2009, 21:15
Location: Colombes (near ****) France
Contact:

Re: Multi-Language Switch -> Page-by-Page

Post by informavore »

Hello ShyGuy,

My target is to make a new site, visible in several languages.
English and french for the beginning, deutsch, espaniol in the future.

Your idea seems to be good, but when I tried it on your site (using this url) :
http://en.xecro.com/index.php?fork-light-barriers
I cannot see it working.
The links at the right top of the page seems to belong always the same url for the 5 languages, and they don't work.

Could you please explain me how it works ?
Or could somebody else show an example of phpwcms multilanguage site working ?

I tried the solution of pepe, and it works fine. But your solution seems to be better. I hesitate...
Here's the url of my (beginning) site :
http://www.exelen.eu/index.php?en_home-1

Thanks for answer.
Have a good day.
Christian.
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Re: Multi-Language Switch -> Page-by-Page

Post by flip-flop »

Hi Christian,

Example: http://www.isabellathiel.de/de.phtml

Technics: Multilingual

Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
Blokof
Posts: 25
Joined: Tue 2. Mar 2010, 16:41

Re: Multi-Language Switch -> Page-by-Page

Post by Blokof »

Does anybody no the good link to make this multi languege work as the example?
I didnt find any good tutorial for this.

thnx
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: Multi-Language Switch -> Page-by-Page

Post by update »

It is here
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Post Reply