Appex and Language detection

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Appex and Language detection

Maarten Mostert

Hi,

 

I would like some advise on how to deal with different languages in Appex.

 

What I did now is creating a the following function on the client side:

 

getMessage(selectorName) {

var response = this.messageToServer(selectorName, null, {async: false});
return response.object;

}

 

And on the Client class site I use:

 

Home
      <plainText: 'Home'>

      (self htmlTokenMap at: #languageCode) value = 'fr'
             ifTrue:
                  [^'Acceuil']
             ifFalse:
                   [^'Home']

 

 

Then when building the DOM

 

aHomeA.appendChild( document.createTextNode("Home"));

 

becomes:


aHomeA.appendChild( document.createTextNode(this.getMessage("Home")));

 

 

This works however Chrome now gives me an error:

 

Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.

 

However if I set the messageToServer with async:true   it no longer works.

 

I also wonder if the next is actually fail safe over browsers  (IE <= 10):

 

(self htmlTokenMap at: #languageCode) value = 'fr'

 

 

Ultimately being able to use user messages in an elegant would be perfect.

 

Any advise is welcome

 

Regards,

 

Maarten MOSTERT

 

 

28 Av Alphonse Denis

83400 Hyères, France

+33 676411296 

http://stakepoint.com/

 


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc