hibernate-orm icon indicating copy to clipboard operation
hibernate-orm copied to clipboard

HHH-14032 Parse Locales with scripts properly in LocaleTypeDescriptor.fromString

Open kilink opened this issue 5 years ago • 2 comments

Locales with scripts (e.g. zh-Hant-HK) were not parsed properly by LocaleTypeDescriptor, causing the script part to get lost.

kilink avatar May 19 '20 00:05 kilink

Sorry for the delay with this. I've gone with a different approach here that does not use a loop or switch statement at all. One caveat is that I decided not to attempt to parse extensions at all, as that is its own little rabbit hole; this PR strictly adds support for parsing scripts. I am not sure how prevalent bcp47 extensions are in practice, but I am assuming that script is more widely used and important. Extensions could be tackled in a follow up, as the way the code is rewritten would allow it to be extended fairly trivially.

kilink avatar Jan 24 '21 20:01 kilink

Thanks for your pull request!

This pull request appears to follow the contribution rules.

› This message was automatically generated.