[Pharo-project] LocalePlugin (was: new Cog VMs uploaded)

David T. Lewis lewis at mail.msen.com
Thu Apr 28 02:02:12 CEST 2011

On Wed, Apr 27, 2011 at 08:43:06PM +0200, Henrik Sperre Johansen wrote:
> On 27.04.2011 20:35, Henrik Sperre Johansen wrote:
> >Also note, primShortDateFormat does nothing with the Locale you specify.
> >
> >All the primitives return values for the current process locale. (Set at
> >startup to system locale rather than C)
> >
> >You'd need to forcibly change the process locale with primSetLocale from
> >ImmX11Plugin (which isn't available in the image, thank God), and hope your
> >linux has that locale installed
> >(Ubuntu f.ex. only comes with a single one installed by default, and
> >switching to anything but that or C will fail)
> >
> >Can't use primGetLocale (not accessible from image either :D ) to check if
> >it's been successful though, as that resets the locale to system locale :)
> >
> >TLDR; What you want to do is impossible with the current implementation.
> >Correcting it is really a waste of time, as something which works correct
> >would be shabby at best.
> >Implementing use of CLDR data is the way to go if you want something that 
> >is
> >both reliable and works.
> >
> >The only bits the Locale plugin is good at (should be used for), is getting
> >the system defined country/language.
> >
> >Cheers,
> >Henry
> >
> >
> Oh wait, I forgot.
> LocalePlugin caches the values for the current locale at startup, so it 
> wouldn't work changing it later anyways.
> Sorry for the noise (except the TLDR part).

If anyone is interested in learning about the VM, writing your own
plugin or improving an existing plugin is a great way to get started.
The LocalePlugin does not get much attention, so if someone has an
interest in improving it, this might make a good small project.


More information about the Pharo-project mailing list