Poor man's multilanguage enhancement v2.0 - enhanced

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
User avatar
Fulvio Romanin
Posts: 394
Joined: Thu 4. Dec 2003, 11:12
Location: Udine, Italy
Contact:

Poor man's multilanguage enhancement v2.0 - enhanced

Post by Fulvio Romanin »

Ok, i felt the urge for a more easy way to do multilanguage sites. Having 5-6 pages for the same subject in different languages was painful (lots of wrong cross-linking, etc.), and impossible with news systems (300 miles long pages).
So, i asked my friend Luca (http://www.malisan.it) and he made up a script for phpwcms. All you have to do is just include the script like shown in the instructions (3 mins of work, maybe, and NO PHPWMCS FILES TO MODIFY) and, in the wysiwyg editor, include your languages (including images, or whatever you want to) inside of simple but specific tags like {IT}testo{/IT} or {EN}text{EN}.

Yes, it's all. Yes, it is so simple. It's not perfect, it's not the best solution in life, but it works ;)

You can see a rolling demo here (it won't be here forever, so go look now)
http://www.rototomsunsplash.com/index.php?id=25

You can find the instructions and the code for v1.0 here
http://www.fulvioromanin.it/phpwcms/

the code for v2.0 is on a post following right in this thread

You can also consider donating ONE euro with the link at the bottom of the doc page if you like the script. Its free for you, but it has costed me something to develop it, so... ;)
Last edited by Fulvio Romanin on Wed 7. Sep 2005, 16:29, edited 1 time in total.
Completeness is reached through subtraction, not through addition
rushclub
Posts: 915
Joined: Tue 17. Feb 2004, 18:52

Post by rushclub »

nice. is it also working in the navigation?

cheers
rush
3 (!) Jahre warten reichen mir. Ich bin erst mal weg.
User avatar
Fulvio Romanin
Posts: 394
Joined: Thu 4. Dec 2003, 11:12
Location: Udine, Italy
Contact:

Post by Fulvio Romanin »

i'm not using conventional navigation - so i can't test it - you try and tell us :D

(it should, imho...)
Completeness is reached through subtraction, not through addition
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

For some reason when I load: http://www.rototomsunsplash.com/index.php?id=25

I first get the code - both the italian and english text - and after a while I just get the text from one lang.....

It's like the .js file load to late and that not user friendly.

Another issue: If you have 12 lang then it would cause a heavy server loader always loading all the 12 lang even when the user just need 1 lang.

But again the system work and easy to use. :D
http://www.studmed.dk Portal for doctors and medical students in Denmark
User avatar
Fulvio Romanin
Posts: 394
Joined: Thu 4. Dec 2003, 11:12
Location: Udine, Italy
Contact:

Post by Fulvio Romanin »

i wrote it needs to be fixed - a solution will be done in the next days.
Of course it's just for not-so-huge pages and not 200-languages. Oliver is working on a different solution, so it might be good in the meanwhile...
Completeness is reached through subtraction, not through addition
brans

Post by brans »

I just developed another solution, without any Javascript and files to add, only your template has to be modified.

Disadvantage: Your articles become very unovervieable when using many languages.

I`m currently using it with 4 languages (no demo available, as only German is finished until now) with no problems.

--...--/index.php/topic,117.0.html

___________________________________

There are 3 advantages of this method:
  • no extra files, no code editing

    CSS is loaded before the rest => no poping up of the other languages content

    only the text is loaded and no images, where the style is display:none, which shouldn`t actually produce a high traffic
Last edited by brans on Sat 7. May 2005, 14:01, edited 1 time in total.
cchhita
Posts: 54
Joined: Sun 14. Nov 2004, 23:54

Post by cchhita »

Hi Brans!
I really like your idea of the CSS switch for the Multilanguage support!
Has anyone else here tried this solution?
I would like to see a working site in action and how it all went.

Thanks
brans

Post by brans »

I have added this mod to the dev forum:
--...--/index.php/topic,117.0.html

you can find a demo link there.
ndtoan13
Posts: 29
Joined: Wed 16. Mar 2005, 05:11
Contact:

Post by ndtoan13 »

I see you just change the interface's language, not the content so if someone want english interface with english content and german interface with german content what will they do??
brans

Post by brans »

try this:
http://www.symposium-lp.ch.vu/index.php?slp&lang=de

is the only section where I applied the hack to the content.
ndtoan13
Posts: 29
Joined: Wed 16. Mar 2005, 05:11
Contact:

Post by ndtoan13 »

Can you tell me why the address does not change

Code: Select all

http://www.symposium-lp.ch.vu/index.php?slp&[color=blue][b]lang=de[/b][/color]
but the language has changed?? Do you modify database (e.g add another field...)?
brans

Post by brans »

No the trick is the following:

When using this inside your url: &lang=de , then a session variable will be set that tells phpwcms to make only the german part visible. You only have to do this once and therefore this is very good for SEO, because all other links but the language link can stay the same.

Maybe have a look at the tutorial --...--/index.php/topic,117.0.html and see what is done with the variable string. There won't be anything to change, only some stuff to add into your template and thats all.
ndtoan13
Posts: 29
Joined: Wed 16. Mar 2005, 05:11
Contact:

Post by ndtoan13 »

brans wrote:No the trick is the following:

When using this inside your url: &lang=de , then a session variable will be set that tells phpwcms to make only the german part visible. You only have to do this once and therefore this is very good for SEO, because all other links but the language link can stay the same.

Maybe have a look at the tutorial --...--/index.php/topic,117.0.html and see what is done with the variable string. There won't be anything to change, only some stuff to add into your template and thats all.
I see, so I have said you just change the interface language!!
Because, if someone want an interface with only german lang and german content and another interface with only enlish lang and enlish content (they are independance) this mod is not suittable.
Fexxx
Posts: 36
Joined: Fri 10. Jun 2005, 15:20

Post by Fexxx »

Does it works only with the content?

{LANG:de}Ihr deutscher Text{/LANG}
{LANG:en}Your english text{/LANG}

How can I change the navigation ? Have I write it in the site structure (category title:), like this:

{LANG:de}Home{/LANG}{LANG:de}Startseite{/LANG}

???
User avatar
Fulvio Romanin
Posts: 394
Joined: Thu 4. Dec 2003, 11:12
Location: Udine, Italy
Contact:

Post by Fulvio Romanin »

well, you just add the call before the navigation :D

version 2.0 is on the way... :)
Completeness is reached through subtraction, not through addition
Post Reply