In Studio in project properties i added Serbian (sr) locale. Date component render with cyrillic labels which is expected. But I want to use Serbian latin locale. In Java we have sr_Latn code but Studio doesn’t allow to set this format.
I got a folowing message:
Not valid code(sr_Latn) of locale. The code must match the regular expression ‘[a-z]{2}(_[a-zA-Z]{2})?’
What is a correct settings (and where) for Serbina latin locale?
Hi,
Does this look like a Serbian Latin calendar names?
I am afraid that setting up a Serbian Latin locale is impossible in the CUBA at the moment.
Available locales are parsed in the com.haulmont.cuba.core.sys.AvailableLocalesFactory class
and it uses org.apache.commons.lang3.LocaleUtils#toLocale method to extract locale by string.
Looks like this method supports only language, country and variant. But does not support “script” parameter of the Locale which determines the Latin.
I have managed to obtain screenshot above by patching the AvailableLocalesFactory class to use method java.util.Locale#forLanguageTag and set
cuba.availableLocales=…;Serbian|sr-Latn-RS
So the only option for you is to patch and build your own version of CUBA.