Forums
> Content Management
> phpWebSite
> multi language
The ad will go away if you log in.
| New Topic
| Reply
 |
Quazy |
“multi language” |
#1 |
|
Member[3] |
2006-04-14 15:04 |
|
|
Hi, I can see at your site "multi.kiesler.at", that your visitors can change the sites language. I would really like this feature on my own phpws. Is there any chances to get an "step by step" guidance, or an "manual" to add this feature to my own site? I am not an PHP programmer, and have small knowledge about PHP, but with som guidance, I think I should manage it.... (hopefully..
Quazy
|
|
|
Quote
|
 |
rck |
“Re: multi language” |
#2 |
|
Admin[1999] from Korneuburg |
2006-04-17 14:29 |
|
|
Hi Quazy, the way I did it probably won't help you too much. :-( I've learned that the next big version of Fallout will support multi-language, so will the next big version of Article Manager. Both of course in a different way (I presume).
What I did was simply duplicate all fields with a content that could be translated. Announcements got a "body" and a "body2" for example, the author has to fill out both fields if he/she wants to have multiple content.
Then, I've added a language choose that essentially switches the language of the current session to the one the visitor likes.
Well, I'm afraid it's only a proof of concept at the moment.
|
|
--- 200 channels and... nothing but cats.
|
Quote
|
 |
dionysus |
“Re: multi language” |
#3 |
|
Activator[18] |
2006-05-02 19:20 |
|
|
Hi there I have see your multi-language site and seems to work very well from the demo. I have also been working on developing a multi-language site for a phpws 0.10.2. I have been making use of the underused dynamic translation and I have hacked the necessary modules (menuman, pagemaster, article manager etc. If you are interested in the hacks I'll send you them. I will post everything once all is complete). Now when a user changes their language all the content and titles change as well. I now want it to be possible for non registered to choose their language. Would you be interested sharing the language switch functions you created with me? Much appreciated.
James
|
|
|
Quote
|
 |
rck |
“Re: multi language” |
#4 |
|
Admin[1999] from Korneuburg |
2006-05-02 22:40 |
|
|
Hi Dionysus, welcome to my forums. And thanks for writing! I've put you into my "Forum Poweruser" group and made you admin. You can now create documents as well as Photo Albums on my site.
Regarding the language switch code. It is a very ugly hack, but I'll share it never the less. Maybe you can improve it?
In the master index.php, find the "foreach ($includeList" loop and add this:
[code]$current_mod_file = NULL;
foreach ($includeList as $mod_title=>$current_mod_file) {
if (in_array($mod_title, $GLOBALS['ALWAYS']) || (isset($_REQUEST['module']) && ($_REQUEST['module'] == $mod_title))) {
if (DEBUG_MODE) {
$PHPWS_Timer->setMarker("Begin $mod_title Execution");
}
$core->current_mod = $mod_title;
/* ---- language switcher ------ */
if($mod_title='user') {
if($_REQUEST['switch_lang'] == 'en')
$_SESSION['translate']->setUserLanguage('en', false);
elseif($_REQUEST['switch_lang'] == 'de')
$_SESSION['translate']->setUserLanguage('de', false);
}
/* rck, 2006-28-02 ------------- */
[/code]
...if you don't do this, the language switch only works after the second refresh, because the language module is loaded too late. Wasn't able to fix this with the priority-settings so there you go.
Then, add this to your theme.php:
[code] $lang=$_SESSION['translate']->current_language;
$THEME['LANG']=$lang;
if($lang == 'en')
$THEME['LANG_SWITCH'] = 'Deutsch';
else
$THEME['LANG_SWITCH'] = 'English';
[/code]
and put the LANG_SWITCH variable in your theme. That's it... :-)
|
|
--- 200 channels and... nothing but cats.
|
Quote
|
 |
dionysus |
“Re: multi language” |
#5 |
|
Activator[18] |
2006-05-03 08:12 |
|
|
Hi rck,
Thank you for your warm welcome to the site and thanks for posting the coding you did. I'm going to play around with it and I'll let you know if I make any changes.
Cheers, James
|
|
|
Quote
|
 |
rck |
“Re: multi language” |
#6 |
|
Admin[1999] from Korneuburg |
2006-05-03 19:28 |
|
|
Hi James, thank you for writing in the first place. Please do post, any time you feel the urge to do so. Be it about phpWebSite, php, databases, movies, music or anything at all. I'll do my best to support you, maybe others like to join the discussions as well?
|
|
--- 200 channels and... nothing but cats.
|
Quote
|
 |
johnson4 |
“Re: multi language” |
#7 |
|
Member[6] |
2006-09-17 01:09 |
|
|
Count me in!!
I'd love to hear more about your progress on multi language. And is there anything I can help with, I think it's a great addition to phpws.
|
|
|
Quote
|
 |
rck |
“Re: multi language” |
#8 |
|
Admin[1999] from Korneuburg |
2006-09-18 14:20 |
|
|
Actually, I stopped working on multi language support soon after releasing the prototype. My approach would need every module to have an additional table attribute containing the other language. As far as I know, there are already attempts to make phpWebSite multi language that work directly with the core. That makes a lot more sense...
|
|
--- 200 channels and... nothing but cats.
|
Quote
|
 |
johnson4 |
“Re: multi language” |
#9 |
|
Member[6] |
2006-09-18 20:30 |
|
|
do you know where I could find this? or is this only in the development of 1.0?
|
|
|
Quote
|
 |
Quazy |
“Re: multi language” |
#10 |
|
Member[3] |
2007-02-13 13:19 |
|
|
Is there any more information on this new release 1.0 regarding multilanguage? I have downloaded and tried the new release 1.0, but it does not look like it support multiple languages the way I see it. Is there anyone that have some info/experiense with this??
Best Regards
Quazy
|
|
|
Quote
|
 |
johnson4 |
“Re: multi language” |
#11 |
|
Member[6] |
2007-12-29 07:20 |
|
|
dionysus, I would like to see your work on multi-language, maybe rck already has it and could forward it to me. Thanks for any help
|
|
|
Quote
|
 |
dionysus |
“Re: multi language” |
#12 |
|
Activator[18] |
2008-01-02 12:17 |
|
|
I have two websites using PHPWS 10.2 with a multi language hack provided by rck.
www.tintolav.com
www.englishpower.co.uk
both work like a dream. Please contact me if you need any more info
|
|
|
Quote
|
 |
mathijs |
“Re: multi language” |
#13 |
|
Member[6] |
2008-01-02 14:46 |
|
|
Is there a way to translate the content of a pagemaster web page in the same way the other modules translate their text? Perhaps use dynamic translations? Now I only see Help and Blockmaker as modules for dynamic translations, is there a hack to include pagemaster in this list too?
Thanks in advance,
-Mathijs
|
|
|
Quote
|
 |
johnson4 |
“Re: multi language” |
#14 |
|
Member[6] |
2008-01-02 22:14 |
|
|
thanks for the reply dionysus
I was also wondering about adding Pagemaster to the list of modules that are in the dynamic translation section. Have you done this or are you using blockmaker exclusively?(on the tintolav.com site)
|
|
|
Quote
|
 |
dionysus |
“Re: multi language” |
#15 |
|
Activator[18] |
2008-01-03 19:56 |
|
|
I've modified pagemaster, fatcat, menuman so they are all registered with dynamic translation.
|
|
|
Quote
|
 |
mathijs |
“Re: multi language” |
#16 |
|
Member[6] |
2008-01-04 00:22 |
|
|
Can you supply us with the code for that, is it like a hack?
I've just added pagemaster to the dynamic translations db and this seems to work for me.
|
|
|
Quote
|
 |
dionysus |
“Re: multi language” |
#17 |
|
Activator[18] |
2008-01-04 17:01 |
|
|
Mathijs, i've sent you a note in the control panel with my email address. Please check and I'll send you the files.
Thanks
|
|
|
Quote
|
 |
johnson4 |
“Re: multi language” |
#18 |
|
Member[6] |
2008-01-04 18:02 |
|
|
could you share that with me as well? Thanks so so muc if your able to help!
|
|
|
Quote
|
 |
dionysus |
“Re: multi language” |
#19 |
|
Activator[18] |
2008-01-04 18:19 |
|
|
Hi johnson4, I have contacted you through notes in the control panel with my email address.
|
|
|
Quote
|
 |
dionysus |
“Re: multi language” |
#20 |
|
Activator[18] |
2008-01-04 18:32 |
|
|
I've also hacked the dynamic translation so that you can use a text editor. In fact I went one further and hack it so all text areas in phpWS use the TinyMCE text editor unless you tell is not to. TinyMCE has pros and cons.
Pros: you have a graphical interface for adding all kinds of additional symbols, text effects etc.
Cons: it can add a lot a meaningless code which bumps up your band width which produce no text effects.
Dynamic translation has great potential, but is let down by it's poor user interface. Finding particular pieces of text you want to translate is a nighmare as they are indexed using the database ID field rather something meaningful. I'm currently working improving the dynamic translation interface.
|
|
|
Quote
|
| Reply
|
|