Our end user operator profiles have different Locales as ‘da_DK’, ‘pl_PL’ and ‘sv_SE’ etc. So the months dropdown value filter in date filer is based on the OperaorID locale ex: August is shown as Sier, Polish language. Please refer to the screenshot attached.
We don’t have requirement for localization in our application so, we have to show everything in English.
To override this we created Filed Values for all the months in baseclass, specific ruleset but, still the month values considered based on the locale.
We don’t want change the locale, for example to: en_DK.
Please suggest if there is any approach to change this.
Thanks in advance!
@SundeepK17193247
To ensure that all month values are displayed in English without changing the locale of the operator profiles, you can temporarily override the locale setting using the setLocale() method. This method allows you to set the locale to English for the duration of the user session or until a later call to the setLocale() method. This way, you can maintain the original locale settings for other purposes while ensuring that the month values are displayed in English.
Here is how you can use the setLocale() method:
-
Call the setLocale() method with the desired locale (e.g., ‘en_US’) at the beginning of the user session or before the month values are displayed.
-
The new locale setting will be valid until the user session ends or until a later call to the setLocale() method.
This approach allows you to keep the operator’s locale settings intact while displaying the month values in English
To display month names in English regardless of the locale, ensure that the field values for the month names are correctly set and referenced in your application. If this approach does not work, consider using a custom control or script to override the month names dynamically based on the user’s locale settings.
This is a GenAI-powered tool. All generated answers require validation against the provided references.
Pega 7.1.9 picks up browser settings for date format rather than default locale s
Localization ruleset not visible in operator’s profile
Internationalization and localization > Locale