Setting locale via script to Serbian Latin language

I have a project that requires a Serbian Latin language. I’ve added to translation manager the Serbian Latin language.
If I select Serbian Latin language via Language selector component on the screen or on the login screen it gets correctly selected. And if I check with system.util.getLocale(), it shows locale code ‘sr__#Latn’.

But if I want to set locale in client startup script or via button script with system.util.setLocale(‘sr__#Latn’), I’ll get error: ‘Invalid locale format: sr__#Latn’.

It appears to be a bug… but I don’t know where it is… in Ignition or in my head…:innocent:
Oh, and I’m using the latest version 7.9.9.

I think it’s a bug in either Java or one of the libraries we use. I’ll do a bit of quick research and post the results…

Looks like support for the script variants would be almost impossible to add in Ignition 7.9 because Java 6 doesn’t play well with the string representations of Locales. (The Language Selector works because we don’t use the string representation).

I’ll put in a ticket to have this fixed in 8.

1 Like