-
Notifications
You must be signed in to change notification settings - Fork 67
Update index.js #131
base: master
Are you sure you want to change the base?
Update index.js #131
Conversation
Fix problem on Safari with short codes for some languages e.g. pl-pl
@zbraniecki Can you take a look at this please? |
That's not how we want to solve it. We want to do the proper language negotiation. With We can't just remove '-' because it often will mean we end up with different/wrong locale ('zh-TW' can't be shortened to |
@zbraniecki Yes, but |
I'm arguing that the solution to your problem is to provide proper language negotiation, not a dummy one. Proper one requires locale canonicalizations and the API in question is being implemented for other browsers and we may have to polyfill it for a while. |
OK, I understand that you are talking about algorithm for finding the parent locale https://github.com/rxaviers/cldrjs/blob/master/src/bundle/parent_lookup.js#L7-L26 |
@zbraniecki Sorry, but I am too short for this. I used If I run |
@zbraniecki What do you think about this #132 ? |
same as the original [0] language negotiation strategy - that we're not ready to inflate the bundle size that much to carry it with us. What we could do is a naive implementation that does:
That would give you a reasonable language negotiation that covers your need without inflating our library too much. [0] https://github.com/l20n/l20n.js/blob/v1.0.x/lib/l20n/intl.js |
@zbraniecki thank you very much :) [0] is a wonderful example of the 'RFC 4647, section 3.4.' implementation - I was looking for something like this! I have only one questions to you: why you wrote 'to lower case (instead of full canonicalization)'? What you mean? E.g. if I get 'en-US' that I should change it to the 'en-us'? |
Because the full canonicalization requires a lot of regexp code that I'd prefer not to ship with our bundles at the moment.
That would be my idea. Alternatively, you can make it so that the second token is always capitalized, and the first is always small caps and leave it at it. |
OK - I will try to do this. |
@zbraniecki Please look at #136 and #137. Sorry but I am fresh and I don't know how to combine 2 commits in a one pull request :-/ |
Hi, any updates on this? |
Fix problem on Safari with short codes for some languages e.g. pl-pl