My web site is available in 2 different languages. I use url rewriting to finally set a php define that contains the current language (ie. "en" or "fr").
How can I dynamically change the blog language (ie. translation of "comments", "posted by"...) ?
I've try without success to add the line: $serendipity['lang']=SMT_LANGUAGE; to the file config.inc.php of the new serendipity theme I've created for my layout.
Does someone has an idea ?
language toggle on the fly
There is a sidebar-plugin for changing the language:
But I can not say, if this is, what you are looking for, because for the moment, I can not install plugins.
Regards,
- Oliver
Code: Select all
Choose Language
Allows visitors to change the frontend interface language
Author: Garvin Hicking; version: 1.0
Regards,
- Oliver
not really
The problem is that the user already has choose its language on my site. I have an url rewriting that convert /fr/ or /en/ hierachy to get the language parameter. And I want to "push" this language in the strings used by Serendipity (the serendipity_lang_en.inc.php file).
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: not really
Look at the "Language autodetection" feature of serendipity. Specifically the function "serendipity_getSessionLanguage" inside include/functions_config.inc.php and search for files calling/Accessing this function.
Have fun,
Garvin
Have fun,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yes but
there is a "strange" comment in this function : "Find a way to let plugins hook into that sequence ".
It' means that for the moment I cannot hook this function. Do you mean I should modified the code (easy but not very good for the future update) ?
It' means that for the moment I cannot hook this function. Do you mean I should modified the code (easy but not very good for the future update) ?
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: yes but
You should be able to get around this by used either the embed function of Serendipity, or by using a PHP auto_prepend directive.
Sadly until now I could not find a way to let plugins hook into the code at that point.
Probably the best way would be to modify the code directly, yes...
Regards,
Garvin
Sadly until now I could not find a way to let plugins hook into the code at that point.
Probably the best way would be to modify the code directly, yes...
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/