Open goldim opened 2 months ago
@hkollmann Fixed.
Just noticed that Intl.Locale
is only supported since 124 version of Firefox and got failed in 123 of Ubuntu. I think to back old implementation of some methods.
Unfortunately, I have no way to test this, as I have almost no experience with localization, and only the most basic of usage of it in my apps. I'm concerned, however, about the list of variants that aren't covered by this change. It's very likely to affect some users. My suggestion is to mark as deprecated, in the upcoming release of 7.x, as many of the things that are known to be issues with the new implementation as possible, and then actually release this change as part of 8.0. Some users will likely encounter non-BC changes that will require altering their code.
Since this PR is marked as "do not merge - v8", I will approve this PR as is. I added the additional "do not merge" tag just in as an added warning, probably not necessary, but doesn't hurt.
@derrell it could be tested with our apps like widget browser for example. To see if the localization works set other locale and see how a datefield calendar is changed. Btw I can not fine an demo application in which you could change locale or country. I remember there were flags of 5 or 6 languages.
This is my first try to move qooxdoo from CLDR to Intl API and not final I think. This allows us to get rid of big dependency which weights too much (500 MB). During migration I encountered bunch of problems, questions and ambiguities which I tried to solve on my own. And that's why I am asking you help me to change some of my solutions if that's required. Also I've created a discussion but didn't see a big involvement. No problem, I think the PR is right place. I've added tests for most methods which have not been tested. I would like to emphasize that some solutions via Intl API are elegant if you look at methods like
getStartWeek
,isWeekend
,getWeekendStart
,getWeekendEnd
and will notice that there are no hardcoded values and exceptions. But Intl API has some disadvantages. There are following moments which I would like to clarify with you:yQ
andyQQQ
. First one has only one exception and I just hardcoded. The second one is much more difficult and has a lot of different variants. I also hardcoded them but didn't count child and parent locale. If it is required I will added them too. For examplede_DE
has a parentde
andde_DE
may have differentyQQQ
format for example.zh
and check what it takes: "Buddhist calendar". To be honest I didn't find a solution to detect what calendar is most suitable for a locale. There is some functionality but it doesn't work in Firefox (getCalendars
function). I would like to just use Gregorian calendar by default and add calendar method argument.cldr_
prefix I decided to leave it because of BC. There is atranslate
method which uses the prefix. I can't remove it but may rename it for example tointl_
.getDateTimeFormat
differ from CLDR implementation. For example foryM
format ofde_DE
there isM/y
but Intl API results onlyMM/y
. I will try to find why it is. Other cases work like in CLDR implementation.de-DE
as argument but qooxdoo methods getde_DE
(dash instead of underline). I introduced a private method in two classes which transforms locale (they are duplications). I would like to get rid of the duplication but don't know what common class or entity will have this method. Maybeqx.locale.Manager
.npm-shrinkwrap.json
. Should I?Intl.Locale
doesn't work in 123 version of Firefox. For BC should be used old implementation.