Switch between multi-language sites PAGE TO PAGE

If you have created additional (non official) documentation or tutorials or something like that please post this here

Switch between multi-language sites PAGE TO PAGE

Postby pepe on Tue Apr 12, 2005 19:49

Hallo phpWCMS-Gemeinde,

vor einiger Zeit habe ich mehrere Möglichkeit ausgeknobelt,
mit der man bei mehrsprachige Sites eine Sprachumschaltung Seite zu Seite vornehmen kann :idea:
Also nicht nur zur jeweiligen Indexseite, sondern zur "passenden" Seite der gewünschten Sprache! :idea:
Die folgende Variante bietet sich an, bei Sites, die den kompletten Seitenumfang in den verschiedenen Sprachen besitzen!

Hello phpWCMS community,

I have worked out some possibilities, to switchover within multilingual sites page to page.
Not only to the respective index page but to the page which is "fitting" of the desired language!
The following variant offers its services at sites which have the complete page size in the different languages!



Landesspezifische Umschaltung "Seite zu Seite" bei mehrsprachige Sites
====================================================
Switch multiple-language sites "page to page"
=================================



Voraussetzung:
------------------
Die Bezeichnungen der ALIAS-Namen sind so gewäht, daß sich äquivalente Seiten nur im Prefix unterscheiden!
Als Trenner wird ein "_" verwendet!

Supposition:
--------------
The ALIAS-names of äquivalent pages must have only different prefixes, separated by a "_"!


Beispiel/Example:
de_neuigkeiten = deutsche Seite
en_neuigkeiten = englische Seite
fr_neuigkeiten = französische Seite


Die folgende PHP-Script entfernt das Prefix vom ALIAS-Namen und gibt den Rest zurück:
(Abzuspeichern unter scripts/strip-prefix.php)
The following PHP-script strips the prefix of the alias-name and gives back the rest:
(Save as scripts/strip-prefix.php)


Code: Select all
<?PHP
// copyright by Manfred Peperkorn :: strip-prefix.php
// find alias-name - strip prefix - give back name without prefix
//    alias:    de_aliasname-example
//    strip:    de
//    give back: _aliasname-example

$alias = $GLOBALS['content']['struct'][($GLOBALS['aktion'][0])]['acat_alias'];
$search = "_";
$aliasNOprefix = stristr($alias,$search);
echo $aliasNOprefix;
?>


Du benötigst nun für jede Sprache eine eigene Vorlage, die sich lediglich in wenigen Punkten unterscheidet:
You need a template of your own for every language, which is merely different in few points:



Vorlage DEUTSCH / Template GERMAN
=====================================

- ist mit allen DEUTSCHEN Seiten verbunden
- besitzt in der linken oder rechten Navigationsspalte eine Verknüpfung zur Kategorie DEUTSCH (de)
- enthält einen Link nach dem folgenden Muster:

- Is connected to all German pages.
- Has a connection in the left or right navigation-column to the category German (de).
- Contains a link after the following sample:



Code für Anzeige eines Image-Links:
Code for indication of an image link:

Code: Select all
<!-- Umschaltung/switch -> ENGLISCH -->
&nbsp;&nbsp;
<a href="index.php?en{PHP:scripts/strip-prefix.php}" target="_self">{IMAGE:flaggen/english.gif}</a>



Code für Anzeige eines Text-Links:
Code for indication of an text link:

Code: Select all
<!-- Umschaltung/switch -> ENGLISCH -->
&nbsp;&nbsp;
<a href="index.php?en{PHP:scripts/strip-prefix.php}" target="_self">englisch</a>



Vorlage ENGLISCH/ Template ENGLISCH
=====================================

- ist mit allen ENGLISCHEN Seiten verbunden
- besitzt in der linken oder rechten Navigationsspalte eine Verknüpfung zur Kategorie ENGLISCH (en)
- enthält einen Link nach dem folgenden Muster:

- Is connected to all English pages.
- Has a connection in the left or right navigation-column to the category English(en).
- Contains a link after the following sample:



Code für Anzeige eines Image-Links:
Code for indication of an image link:

Code: Select all
<!-- Umschaltung/switch -> DEUTSCH -->
&nbsp;&nbsp;
<a href="index.php?de{PHP:scripts/strip-prefix.php}" target="_self">{IMAGE:flaggen/deutsch.gif}</a>



Code for indication of an text link:
Code: Select all
<!-- Umschaltung/switch -> DEUTSCH -->
&nbsp;&nbsp;
<a href="index.php?de{PHP:scripts/strip-prefix.php}" target="_self">deutsch</a>


Vies Spass beim Testen :lol:
Last edited by pepe on Wed Apr 13, 2005 12:50, edited 1 time in total.
mfG pepe

Natürlich lese ich hier immer noch mit (ist ja nicht mehr so viel), gespannt darauf, was noch kommen wird... und wann!
Denn phpwcms ist - nach wie vor - ein TOP CMS, welches einen Vergleich nicht scheuen muß!

phpWCMS Installation + Quick-Start + Tuning | some Replacement-Tags | free-X templates (4.000 downloads/anno)
User avatar
pepe
 
Posts: 2815
Joined: Mon Jan 19, 2004 12:46
Location: Mülheim-Ruhr, Germany

Postby dbaron on Wed Apr 13, 2005 06:47

And for people who doesn't understand german?

Thanks :wink:
User avatar
dbaron
 
Posts: 69
Joined: Tue Jan 25, 2005 10:53
Location: France

Re: Switch between multi-language sites PAGE TO PAGE

Postby spirelli on Wed Apr 13, 2005 07:23

dbaron wrote:And for people who doesn't understand german?

Thanks :wink:
pepe wrote:Hello phpWCMS-Community,

Some time ago I developed different possibilities that enables visitors to switch the language of the current page :idea:

This is NOT redirecting to the index page of the other language but to the corresponding page! :idea:

The following solution enablesto have all pages in several languages!



Switch multiple-language sites "page to page"
=================================

Supposition:
------------------
The Alias names are chosen in such a way that corresponding pages differ only in the prefix. Prefix and alias are seperated with "_".


Example:
de_news = German Page
en_news = English page
fr_news = French Page

The following PHP-script strips the prefix of the alias-name and gives back the rest:
(Save as scripts/strip-prefix.php)

Code: Select all
<?PHP
// copyright by Manfred Peperkorn :: strip-prefix.php
// find alias-name - strip prefix - give back name without prefix
//    alias:    de_aliasname-example
//    strip:    de
//    give back: _aliasname-example

$alias = $GLOBALS['content']['struct'][($GLOBALS['aktion'][0])]['acat_alias'];
$search = "_";
$aliasNOprefix = stristr($alias,$search);
echo $aliasNOprefix;
?>


Now, for every page a template is needed that only differs in a few points:

GERMAN template
============

linked to all German pages and has a navigation link to the English version, like this:

Code for image link:
Code: Select all
<!-- switch -> ENGLISCH -->
&nbsp;&nbsp;
<a href="index.php?en{PHP:scripts/strip-prefix.php}" target="_self">{IMAGE:flaggen/english.gif}</a>



Code for text link:
Code: Select all
<!-- switch -> ENGLISCH -->
&nbsp;&nbsp;
<a href="index.php?en{PHP:scripts/strip-prefix.php}" target="_self">englisch</a>


ENGLISH template
================

linked to all English pages and has a navigation link to the German version, like this:

Code for image link:
Code: Select all
<!-- switch -> GERMAN -->
&nbsp;&nbsp;
<a href="index.php?de{PHP:scripts/strip-prefix.php}" target="_self">{IMAGE:flaggen/deutsch.gif}</a>


Code for text link:
Code: Select all
<!-- switch -> GERMAN -->
&nbsp;&nbsp;
<a href="index.php?de{PHP:scripts/strip-prefix.php}" target="_self">deutsch</a>


Enjoy testing :lol:
Last edited by spirelli on Wed Apr 13, 2005 12:54, edited 1 time in total.
spirelli
 
Posts: 996
Joined: Tue Jul 27, 2004 11:37
Location: London

Postby brans on Wed Apr 13, 2005 08:43

sounds cool :-), the only problem is, that the aliases all have to be in one language

ex.: de_produkte => en_produkte

which is very annoying, when using more languages, ex:

de_
nl_
fr_
en_

but nevertheless the best solution I have seen so far.
brans
 

Postby pepe on Wed Apr 13, 2005 12:57

Hi dbaron,

dbaron wrote:And for people who doesn't understand german?

Thanks :wink:


Three possibilities:

1.
Please learn the german language. That's verry easy!
In Germany the little children already speak German :lol:

2.
Use a translater-software.

3.
Read it twice, please THE RED WORDS ARE ENGLISH (i hope :oops: ).
Last edited by pepe on Thu Jun 30, 2005 10:54, edited 1 time in total.
mfG pepe

Natürlich lese ich hier immer noch mit (ist ja nicht mehr so viel), gespannt darauf, was noch kommen wird... und wann!
Denn phpwcms ist - nach wie vor - ein TOP CMS, welches einen Vergleich nicht scheuen muß!

phpWCMS Installation + Quick-Start + Tuning | some Replacement-Tags | free-X templates (4.000 downloads/anno)
User avatar
pepe
 
Posts: 2815
Joined: Mon Jan 19, 2004 12:46
Location: Mülheim-Ruhr, Germany

Postby spirelli on Wed Apr 13, 2005 13:00

.... and I did such a 'nice' translation... :cry:


:wink:
spirelli
 
Posts: 996
Joined: Tue Jul 27, 2004 11:37
Location: London

Postby dbaron on Wed Apr 13, 2005 13:17

Sorry one thousand times :cry:
User avatar
dbaron
 
Posts: 69
Joined: Tue Jan 25, 2005 10:53
Location: France

Postby spirelli on Wed Apr 13, 2005 13:28

don't worry, as far as I can remember the english content was not all there a the time of your posting. And I would have even translated it into French if I could speak it. :D
spirelli
 
Posts: 996
Joined: Tue Jul 27, 2004 11:37
Location: London

Postby dbaron on Wed Apr 13, 2005 14:30

Thanks for your kindness
User avatar
dbaron
 
Posts: 69
Joined: Tue Jan 25, 2005 10:53
Location: France

Postby pepe on Wed Apr 13, 2005 15:17

Hi spirelli,

you are a real friend... and your translation is much, much better than mine....

... i wanted to try it at least, because my schooldays is past many many years :wink:


And spirelli, by the way... You are the bilingual man! Have you tried it? Works?
mfG pepe

Natürlich lese ich hier immer noch mit (ist ja nicht mehr so viel), gespannt darauf, was noch kommen wird... und wann!
Denn phpwcms ist - nach wie vor - ein TOP CMS, welches einen Vergleich nicht scheuen muß!

phpWCMS Installation + Quick-Start + Tuning | some Replacement-Tags | free-X templates (4.000 downloads/anno)
User avatar
pepe
 
Posts: 2815
Joined: Mon Jan 19, 2004 12:46
Location: Mülheim-Ruhr, Germany

Postby spirelli on Wed Apr 13, 2005 16:07

No, sorry. Haven't got a bilingual site to use it with. Maybe I'll use it in future!
Last edited by spirelli on Wed Apr 13, 2005 16:08, edited 1 time in total.
spirelli
 
Posts: 996
Joined: Tue Jul 27, 2004 11:37
Location: London

Postby jscholtysik on Thu Apr 14, 2005 07:28

Deutsch:
***********************************

Hi pepe,


gab es diese Diskussion mit dem Verfassen von Einträgen nicht schon tausend Mal hier im Forum?

Was war denn das für ein blö..r Kommentar:

Three possibilities:

1.
Please learn the german language. That's verry easy!
In Germany the little children already speak German


Was würdest Du davon halten, wenn so ein Kommentar gegenüber Dir fallen würde?

Da dies ein internationales Forum sein soll, sollte man die Sprache verwenden, die international am meisten verwendet wird, und das ist nun mal Englisch.

Das Optimum wäre natürlich, gleich von Anfang an alle Nachrichten mehrsprachig zu schreiben (vielleicht Deutsch und Englisch).

Mal wieder ein kleiner Denkanstoß... :-)


Englisch:
***********************************

Hi pepe,


weren't there many discussions about the writing of messages here in this forum?

What was this for a si..y comment:

Three possibilities:

1.
Please learn the german language. That's verry easy!
In Germany the little children already speak German


How would you feel about such a comment concerning you?

This should be an international forum, so we should use the language that is internationally used the most and this is English.

The optimum would be to start or continue writing multilingual entries (perhaps in German and English).

Just think about it ... :-)




Joachim
User avatar
jscholtysik
 
Posts: 847
Joined: Fri Jan 07, 2005 12:55
Location: Munich

Postby frold on Thu Apr 14, 2005 08:19

http://www.studmed.dk Portal for doctors and medical students in Denmark
frold
 
Posts: 2151
Joined: Tue Nov 25, 2003 21:42

Postby brans on Thu Apr 14, 2005 08:42

brans
 

Postby Kosse on Wed Jun 01, 2005 18:03

Hi pepe,

would be nice to see an example working :P

I live in Belgium and we usually deal with 2 or 3 languages (fr-nl-en/de) when building sites, so as I am to make my first multilingual site, I hesitate between all the solutions you guys presented (frold, brans, fluvio and you... :wink: )

Have you done this somewhere live? could I see a result?
That would help me take the right decision. I like the idea where you go from page_x EN to page_x DE.

But does it work as well without aliases? What about files like 1.0.0.0.0.phtml (if using rewrite) or index.php?id=29,0,0,1,0,0 (if not using rewrite) ???

I would love to use that (but if it's too tricky, I guess I'll cope with a index.php?fr and index.php?nl or even easier: fr/ and nl/)

Thanks, I really appreciate the help you provide around here, all of u!
Congratulations again.

Cheers

PD: I'll check also on StudioZ (Malouin) site, he seems to have manged something...
User avatar
Kosse
 
Posts: 1066
Joined: Thu Sep 09, 2004 10:08
Location: Brussels, Belgium

Next

Return to (unofficial) tutorials & documentation

Who is online

Users browsing this forum: Alexa [Bot] and 0 guests