PDA

View Full Version : Multilanguage using ajax



da_bar
24 Jul 2009, 4:47 AM
Hi.

I have all the translation for various languages in my database, I want to make an ajax request to pick up an language translation and put it in an array, and after that in any place that uses language use a simple function that will change string.
Problem is that page continues to load before I make an array so no page gets translated.
Is there a way to stop page loading and to wait for ajax to complete?
Is this a good way or is there better cause I simply have a translation interface in the backend and I don't want to use file system as a translation holder.

tnx

aconran
24 Jul 2009, 6:14 AM
da_bar -

Take a look at the dutch form example provided in the SDK. This is the best approach to achieve internatiolization in an Ext JS App.

Dynamically generate the language file as standard JS which will eliminate your problem that you have for stopping the page and waiting for your ajax request to complete.

da_bar
24 Jul 2009, 8:41 AM
da_bar -

Take a look at the dutch form example provided in the SDK. This is the best approach to achieve internatiolization in an Ext JS App.

Dynamically generate the language file as standard JS which will eliminate your problem that you have for stopping the page and waiting for your ajax request to complete.

Thanks, that was my idea too if Ajax doesn't work.