Language setting and return from snapshot

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

Language setting and return from snapshot

Vincent Lesbros-2
Hi list !

My app will run in more than one language.
So, in the interface I enable the user to select his language and I set the choice by sending
a #setSystemLocaleTo: to Locale.

But, if I save the image,  and restart it, the setting is lost.
So I create a Shared variable in a class of my model to store the user choice.
And I define a method in SystemEventInterest  with the pragma : 

<triggerAtSystemEvent: #returnFromSnapshot>

to set the Locale back when I return from snapshot.

It doesn't work. but the method is called. Perhaps the system changes the Local after triggering returnFromSnapshot ?

Est-ce que quelqu'un a déjà eu ce type de problème ?

Vincent



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Language setting and return from snapshot

Kooyman, Les
The system locale is meant to mirror that of the operating system and to be a read-only resource. It is determined by a primitive in the VM which accesses the operating system locale and provides that information to the image  (where it is set).
 
You could use a per-process locale (create a new process to do your work and set its locale to that of your choice with the #locale: method it provides), or set the locale of the operating system to be that which you want the system locale to mirror. Since you want to set this dynamically, it would be better to use a per-process locale and do all work for that user in that process. This is described in the Internationalization Guide.
 
Les Kooyman
Cincom Smalltalk Development


From: Vincent Lesbros
Sent: Tue 3/26/2013 1:16 PM
To: [hidden email]
Subject: [vwnc] Language setting and return from snapshot

Hi list !

My app will run in more than one language.
So, in the interface I enable the user to select his language and I set the choice by sending
a #setSystemLocaleTo: to Locale.

But, if I save the image,  and restart it, the setting is lost.
So I create a Shared variable in a class of my model to store the user choice.
And I define a method in SystemEventInterest  with the pragma : 

<triggerAtSystemEvent: #returnFromSnapshot>

to set the Locale back when I return from snapshot.

It doesn't work. but the method is called. Perhaps the system changes the Local after triggering returnFromSnapshot ?

Est-ce que quelqu'un a déjà eu ce type de problème ?

Vincent



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