Describe the bug
The Method LocalizedString.localValues() returns wrong locale as MapKey if the source values contains not only plain languageTags but combined tag+country as well.
This method works well if you have configured only "2-digit" languages inside the Commercetools UI, but apparently its possible to configure "4-digit+Hypen" languages as well (see screenshots).
To Reproduce
Configure localizedLanguages in Commercetools (e.g. "de-DE" and "de-AT")
Create any Kind of ProductType to call it later via API
call a ProductTypeDraft via API with SDK
Try to access the translations of label of an ProductTypeDraft Attribute via SDK
The Locale has not the correct language and country split, instead it has "de-de" als language (see screenshots)
Expected behavior
The method should return a proper Map of Locales + values where language and country of the locale are separated.
Screenshots/Code snippet
Configuration of languages inside Commercetools
Adapt a ProductType to call it later
Actual value of the LocalizedString
Outcome of the localValues() Method
Stack information (please complete the following information):
Describe the bug The Method LocalizedString.localValues() returns wrong locale as MapKey if the source values contains not only plain languageTags but combined tag+country as well. This method works well if you have configured only "2-digit" languages inside the Commercetools UI, but apparently its possible to configure "4-digit+Hypen" languages as well (see screenshots).
To Reproduce
Expected behavior The method should return a proper Map of Locales + values where language and country of the locale are separated.
Screenshots/Code snippet
Configuration of languages inside Commercetools![image](https://github.com/commercetools/commercetools-sdk-java-v2/assets/7330927/03cedf15-933b-4de5-b5ce-ae34c249ff30)
Adapt a ProductType to call it later![image](https://github.com/commercetools/commercetools-sdk-java-v2/assets/7330927/e358fb1e-5e5a-4cbc-bc92-27d591e5a78d)
Actual value of the LocalizedString![Bildschirmfoto 2023-09-07 um 12 04 34](https://github.com/commercetools/commercetools-sdk-java-v2/assets/7330927/5d5121f3-8b49-493d-bd50-35c00e774a6b)
Outcome of the localValues() Method![Bildschirmfoto 2023-09-07 um 12 06 10](https://github.com/commercetools/commercetools-sdk-java-v2/assets/7330927/7b7db981-04c4-44fe-b5d9-a2d95da81840)
Stack information (please complete the following information):
Additional context
https://github.com/commercetools/commercetools-sdk-java-v2/blame/4c51dff63e55e906f9e0bb42ba78293df0d4dddb/commercetools/commercetools-sdk-java-api/src/main/java/com/commercetools/api/models/common/LocalizedString.java#L75