views:

51

answers:

2

User selects a new language from English to German. Currently the page has to refresh each time to change the text to the language selected. This is fine for IE but on firefox it always asks the user and a bad user experience. Plus if user is in the middle of typing something then has to refresh the text is all gone. So is it possible to load new language text without a refresh? Since this is a user content site there is a lot of content per page. Backend is PHP codeigniter & MySQL.

A: 

I'm assuming by changing languages, you mean you have a drop-down or something in your web app that lets users select a language. If so... Are you using something like jQuery? You can assign a style to every span/element that has display text, and when the language is changed, cycle through all spans with that style, and update whats displayed - loading the new display text via an ajax call. This is very similar to how many desktop applications handle translation.

GrandmasterB
A: 

Usually you use only one language when you browse, so when your user will select one, you just have to find a way to remember it.

Even if it's a "bad user experience", it will always be better than having a ton of javascript and all the locales changed with javascript.

I don't say it isn't possible, but just think about it, does it really worth it ?

Colin Hebert