Describe the bug
We are setting language and locale separately, as described here:
https://design.infor.com/code/ids-enterprise/latest/locale#code-example---using-a-different-language-and-locale
When opening a popover / timepicker, the language is changed to the value of locale (possibly due to initialize() being called for sub-content).
Pseudo Example:
Locale.set("fi-FI"); // Finnish
Locale.setLanguage("sv"); // Swedish
In attached GIF below, it's seen that

We also noticed that some texts are always translated based on Locale, and not Language, in some components. Example below is the datepicker (the issue is not due to popover/timepicker being opened, it's like this from the start)

Expected behavior
If using Locale.setLanguage(), that language should be used for translations in all IDS components, and not be changed as a result of automatic plugin initializations.
Version
Adding to 4.22 final and as a possible patch 4.21.3 on request from the home page team.
Steps to reproduce
Locale.currentLanguage confirm it is finishLocale.setLanguage("sv");Locale.currentLanguage -> confirm its swedishLocale.currentLanguage -> confirm its swedishOk nevermind but noting one thing...you should do
Locale.setLanguage("sv"); // Swedish
// Not Locale.setLanguage("sv-SE"); // Swedish
Oh, right. We're doing that, I'll correct it in description!
@volante007 can you test this fix. I pushed it to test in the 4.22 final. But it's a bit more involved that i would like for a 4.21.x patch. I think it should be ok. But adds tiny a bit of risk.
Will patch if still desired when tested and merged by everyone.
Hi, I checked out branch 2982-lang-resets and built the minified bundle. Works OK!
Though it seems like the translations in datepicker are a mix of locale/language still, but perhaps that's a separate issue?
I guess so. It depends whats required for example if you go to:
1) http://localhost:4000/components/datepicker/example-index.html?locale=fi-FI
2) type Locale.setLanguage('sv') in the console
Then the format of the datefield will be in sv as well the calendar information but the rest of the text is fi-FI. The reason is that calendar names ect are part of the locale information not part of the language information. So that makes it a bit wierd. if its needed to use a locale format different than the language then you can just set the language and locale to the same thing and then set the dateFormat setting to finish.
I think to do that so that the locale and calendar is different would need to move the translations out of the locale for the calendar. So seperate new issue? Or critical to patch in 4.21.x? Seems to big to me.
@volante007 maybe ping me on teams and we can discuss how your using this and if that part should change or not. Also if this is fixed your case enough to patch or more work needed now or in the future? As of now with datePicker you can set locale and that makes the most sense. Changing language on that one would give a wierd mix.
As discussed I'll create a separate report for the locale/language mix in the datepicker and we'll leave that out of the patch
I fixed this issue and merged it to both 4.22 final and 4.21.3 as a patch
https://www.npmjs.com/package/ids-enterprise/v/4.21.3
Hope it helps!
http://4220-enterprise.demo.design.infor.com/components/timepicker/example-index.html?locale=fi-FI
http://4220-enterprise.demo.design.infor.com/components/timepicker/test-specific-locale.html
http://4220-enterprise.demo.design.infor.com/components/datepicker/test-two-locales-same-page.html
http://4220-enterprise.demo.design.infor.com/components/monthview/test-specific-locale.html
http://4220-enterprise.demo.design.infor.com/components/monthview/test-specific-locale-lang.html
http://4220-enterprise.demo.design.infor.com/components/calendar/test-specific-locale-lang.html
Passed QA testing in all browsers, moving to Done.