openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

ResourceBundle normalize/replace from sr to sh

Open mkueng1 opened this issue 8 years ago • 3 comments

OpenUI5 version: 1.50 (actually any)

Steps to reproduce the problem:

  1. go to the console: sap.ui.getCore().getConfiguration().setLanguage("sr")

What is the expected result? the framework loads the i18n resources for sr

What happens instead? the framework loads the i18n resources for sh

Any other information? In jquery.sap.resources.js when a Bundle is created "normalize()" is called for the locale which replaces sr to sh due to the definition M_ISO639_NEW_TO_OLD. As sh has been deprecated in 2000 (see ISO 639-2 Changes and search for [-sh]) My translation process delivers *_sr.properties files which of course fails as the framework tries to load *_sh.properties. I think it would be proper to remove the replacement and if the content of the ui5 *_sh.properties files is serbian and not croatian rename the files.

mkueng1 avatar Mar 14 '18 07:03 mkueng1

Hello mkueng1,

Thank you for sharing this finding. I've created an internal incident 1870047793. The status of the issue will be updated here in GitHub.

Best regards, Bozhko (GitHub dispatcher)

bozhkotodorov avatar Mar 14 '18 14:03 bozhkotodorov

We can't simply change this due to compatibility reasons. A change would break all existing applications / libraries that provide texts in an 'sh' file. The currently used locale suffixes are motivated by internal processes that initially produced 'sh' initially.

There's a feature discussed for the future (no target release yet) which would allow to configure a) the supported languages per component / library (using the app descriptor) and b) as a side effect would allow the framework to pick the right suffix for legacy/updated locales like he/iw or sr/sh.

But for now, the mapping can't be changed.

codeworrior avatar Mar 29 '18 11:03 codeworrior

Would it be a solution to just copy the sh resources to sr and remove the hard coded replacement. Any legacy application will work (but I cannot imagine a browser supported by OpenUI5 that sends a sh language code) and all applications based on OpenUI5 can have proper translation files matching the browsers language.

mkueng1 avatar Apr 05 '18 07:04 mkueng1