Forum OpenACS Development: Language change in a project

Request notifications

Posted by Juan Carlos on
I need to create the option inside my project so the user can change the language of the program from english to spanish, and viceverse, with just a click. What can I do?
Posted by Antonio Pisano on
One example of such feature you can find in the /acs-lang/www/index page. If, for instance, you go to, there you will have the possibility to switch the preferred locale for you on this website.

Of course your application should have been written with localization in mind, that is, have every UI text as a localized message key (with a proper translation for the languages you want to support).

Hope this helps


Posted by Brian Fenton on
Lots of good docs here

Let me know if you need more specific advice.


Posted by Iuri Sampaio on
Assuming you've read already those 2 posts above, you can easily find the examples using API lang::user::*

You can add whether a link or a form to pass the desired locale, then run the chunk of code bellow.

if {$locale ne ""} {
lang::user::set_locale $locale

ad_returnredirect [ad_conn url]

Best wishes,