Page 1 of 2
Multi-language pages- howto?
Posted: Mon 29. May 2006, 12:14
by Tomasahl
Hello. I hope I am posting this in the right forum.
I found a thread in the documentation forum, and I think it is probably part of the soultion to what I seek.
http://www.phpwcms.de/forum/viewtopic.php?t=6553
I would like to have the possibility for visitors to choose between Swedish and English by clicking on a flag - or a bowl of porridge or whatever

.
But:
1. Do I have to make a extra installation of phpwcms to do that? I mean - do I install all files of v 1.2.6 in one called "sedish" and one called "english" ? The texta and layout and everything wil be the same - I just will make one english version of the swedish pages.
So I will need of course to translate the menu aswell, but so far I can't figure out how to do that without actually making two installations. If so - can they share database?
Posted: Mon 29. May 2006, 12:35
by flip-flop
Hi Tomasahl,
have a look:
http://www.phpwcms.de/forum/viewtopic.php?p=44995
Here you can see an example at my testpage:
Code: Select all
Example: www .mz.ja-nek .de/de.phtml
And there the NAV_LIST_FROM: www .mz.ja-nek .de/test2_2_1.phtml
And the Sitemap: www .mz.ja-nek .de/de_sitemap.phtml
Gruß Knut
Posted: Mon 29. May 2006, 12:43
by velo
No just install 1 version.
All u have to do is to make a swedish and an english structure. In those structures u give the catogories english or swedish names, but the alias of the categories must be the same.
- HOME
-- EN (alias: en_)
--- home (alias: en_home)
--- Ikea (alias: en_ikea)
--- Bread(alias: en_bread)
-- SW(alias: sw_)
--- Home (alias: sw_home)
--- Ikea(alias: sw_ikea)
--- Knäkebrot(alias: sw_bread)
For both languages u make a different template.
read the topic again and follow exactly how it is explained. It works.
http://www.phpwcms.de/forum/viewtopic.php?t=6553
I use it for a site with 3 languages
http://www.southfloridatravel.biz (not ready, but just to give u an idea)
greetings Velo
Posted: Mon 29. May 2006, 12:47
by Klappstuhl28
Posted: Mon 29. May 2006, 14:26
by Tomasahl
Thanks Flipflop, Klappstuhl, Velo and others. I will try your solutions. Thanks for the tips
velo wrote:
--- Knäkebrot(alias: sw_bread)
Cool.. swedish quisine rocks

Posted: Mon 29. May 2006, 19:26
by Tomasahl
Oh, btw ...
Pepe writes this as a tip to a user:
Code: Select all
[PHP]
$check_id = $GLOBALS['content']['cat_id'];
while( $GLOBALS['content']['struct'][$check_id]['acat_struct'] <> 0 ) {
$check_id = $GLOBALS['content']['struct'][$check_id]['acat_struct'];
}
echo '{NAV_TABLE_COLUMN:'.$check_id.'}';
[/PHP]
I use NAV ROW instead, does that mean that I change to {NAV_ROW} instead of {NAV_TABLE_COLUMN:' ...}etc
Posted: Mon 29. May 2006, 20:08
by pepe
Hi Thomas,
try it this way:
[PHP]
$check_id = $GLOBALS['content']['cat_id'];
while( $GLOBALS['content']['struct'][$check_id]['acat_struct'] <> 0 ) {
$check_id = $GLOBALS['content']['struct'][$check_id]['acat_struct'];
}
echo "{NAV_ROW:$check_id";
echo ":0}";
[/PHP]
Posted: Mon 29. May 2006, 22:28
by tinoo
velo wrote:
- HOME
-- EN (alias: en_)
--- home (alias: en_home)
--- Ikea (alias: en_ikea)
--- Bread(alias: en_bread)
-- SW(alias: sw_)
--- Home (alias: sw_home)
--- Ikea(alias: sw_ikea)
--- Knäkebrot(alias: sw_bread)
Hm, i did that the same way, but considering navigations and sitemaps, i would like to ask if it could be in this way too:
- INDEX
-- Home (alias: en_)
--- Ikea (alias: en_ikea)
--- Bread(alias: en_bread)
-- Start(alias: sw_)
--- Ikea(alias: sw_ikea)
--- Knäkebrot(alias: sw_bread)
You see the difference? This eliminates the EN and SW structur displaying in breadcrumb, sitemap and so on...
Posted: Tue 30. May 2006, 13:30
by Tomasahl
Hello all, and thanks for your help.
I now managed to do all the things written here, and I have a structure that works partially.
I chose english - EN - as standard template. But nevertheless I have less problems with the swedish one.
So I now wonder:
1. How do I do so when I come to the website I get the english first page that is in "Index/EN/Home/entry" instead of the one swowing now, which is "Index/blank".
2. When I go to "english" and then click on the flag to go to swedish, I come to a page without contents, and the EN/SW text links are in the navbar. However in the "real" pages it is not - and it is not supposed to be either. How do I fix this?
Maybe I am to take away the HOME - dir and put it just under the EN instead?
I just moved some very basic version up to a server so it is possible for you to see.
h[url]ttp://
www.stop-abuse.org/v2/[/url]
Posted: Tue 30. May 2006, 14:14
by pepe
Hi Thomas
make the following changing:
Index <= The index-page is never seen!!!
--
home (en_home) <= this is your
english homepage
---- point1 (en_point1)
-------- point1-1 (en_point1-1)
-------- point1-2 (en_point1-2)
---- point2 (en_point2)
---- point3 (en_point3)
--
hem (sw_home) <= this is your
swedish homepage
---- punkt1 (sw_point1)
-------- punkt1-1 (sw_point1-1)
-------- punkt1-2 (sw_point1-2)
---- punkt2 (sw_point1)
---- punkt3 (sw_point1)
make a redirection inside the article basicinformation of the "real" indexpage to the page
index.php?en_home, so the index is
never seen!!!
If i come to your site, i will start on the english "
homepage"
And... by the way
NEVER put in your complete multilingual navigation first!!!!
Take only one language... make the site readdy to go.
Then copy the complete structure within all the subcategories with one click...
And then... translate the text only...
all other things are just on the right place 
Posted: Tue 30. May 2006, 16:08
by Tomasahl
pepe wrote:
make a redirection inside the article basicinformation of the "real" indexpage to the page index.php?en_home, so the index is never seen!!!
If i come to your site, i will start on the english "homepage"
This is where I get lost .. I have now managed to get something - I have no idea what - to actually work. But how do I get this refresh-thing to work?
I tried several attempts, but noooooo..
This is what i write:
I tried to put it where you say "basicinformation" - but that does not change anything, so I must put it in the wrong place.
Ok, but I have my window open now. Maybe I just throw my computer on the crows instead

Posted: Wed 31. May 2006, 18:46
by Tomasahl
Thanks to Pepe for assisting me in actually getting it to work. Now I have the english version working just as I like, but a strange thing is happening in the swedish version.
In the swedish version not only the swedish menu but also the english is shown. In the left sidemenu.
I have put this that I found in another thread, without any change:
Code: Select all
[PHP]
$check_id = $GLOBALS['content']['cat_id'];
while( $GLOBALS['content']['struct'][$check_id]['acat_struct'] <> 0 ) {
$check_id = $GLOBALS['content']['struct'][$check_id]['acat_struct'];
}
echo '{NAV_TABLE_COLUMN:'.$check_id.'}';
[/PHP]
That is not so good. any way to fix that?
Address to testsite:
http://www.stop-abuse.org/v2
And btw - it does not seem to be that problem inthe horisontal menu at the top , only in the left navbar.
Posted: Wed 31. May 2006, 19:51
by flip-flop
Hi Thomasahl,
I don´t know why you did use these directswitch. In my opinion it is be fit for particular cases. And a SUMA don´t like e.g. "background" for swedish language.
Ok:
1. en-background2 -> en_background2
2. The english version looks good for me.
3. The swedish version works fine but I am missing e.g. sw_background and the other one.
4. PHP code is the right one.
Have you create the corresponding categories like pepe´s hint?
If you switch from the english version e.g. from en_case to sw_casa, the system can´t find this page and is going in a proper way to index.php -> en_homepage.
Gruß Knut
Posted: Wed 31. May 2006, 20:34
by Tomasahl
Hello Flip-Flop/Knut.
flip-flop wrote:Hi Thomasahl,
I don´t know why you did use these directswitch. In my opinion it is be fit for particular cases. And a SUMA don´t like e.g. "background" for swedish language.
I just use it since I found a way to solve my problem that included that solution. I want the visitor to click on a flag or image and come to a language of their choise. This solution seems to do that. Or did you mean the direct reroute to the english version? Well, oterwise it just becomes an empty page -and I have tons ofthose already
3. The swedish version works fine but I am missing e.g. sw_background and the other one.
Yes, I am trying to solve this problem of mine first before I go on. So what I have up now is just a test to learn - the real version will different.
Have you create the corresponding categories like pepe´s hint?
If you switch from the english version e.g. from en_case to sw_casa, the system can´t find this page and is going in a proper way to index.php -> en_homepage.
Gruß Knut
Yes - well - not me, but pepe assisted me yesterday, so it is done correctly.
But if you change to the swedish version you see in the left side menu that the "home" from the english menu is on top, and if you click it the english menu opens. So I actually have two menus there.
And since i am thinking of deleting the horisontal menu i would like to have just one sidemenu per language.
Posted: Wed 31. May 2006, 20:39
by Tomasahl
Huh? And then in some strange way it works. I don't know if i fixed it myself by fooling around with the structure, or if my secret genie pepe fixed it, but at the moment it just looks fine.
maybe it was justthe translations that needed to be completed.
Anyway - fun and cool. I like the idea of phpwcms, so it wil be fun trying to merge my project in to it.
Ok, vielen dank und bis bald
Tomas A
Stop Child Abuse
Stockholm, Schweden