Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Likely subtags #9

Closed
raphlinus opened this issue Apr 3, 2019 · 3 comments
Closed

Likely subtags #9

raphlinus opened this issue Apr 3, 2019 · 3 comments

Comments

@raphlinus
Copy link

I need "likely subtags" for script-aware fallback. ICU has an implementation.

I actually have this pretty well implemented. The question is whether it belongs in fluent-locale-rs or whether it should be in skribo. I estimate that it's in the ballpark of 50k of code and data; I could probably get it down a little.

Also, I haven't implemented the deprecated subtags (for example, the conversion of "sh" to "sr_Latn". I suspect I won't miss them for text rendering, but other applications might want them (for example, so that hyphenation can handle "no-NO"). If I submitted a PR, would you want these?

A "no" answer is fine - it'll just live in skribo.

@zbraniecki
Copy link
Collaborator

Hmm, that's a good question.

We have a poors man version of it - https://github.com/projectfluent/fluent-locale-rs/blob/master/src/negotiate/likely_subtags.rs
Are you talking about including the whole algorithm here? We could make it an optional build flag to include the whole set.

Eventually, I believe this should be part of UNIC.

@raphlinus
Copy link
Author

raphlinus commented Apr 3, 2019

Oh for some reason I missed the version in negotiate. My implementation is more or less the whole algorithm, with data from CLDR, with the exception of the deprecated and grandfathered tags. I'm quite fine putting it under a feature if there's concern about the data size.

raphlinus added a commit to raphlinus/fluent-locale-rs that referenced this issue Apr 12, 2019
Fixes projectfluent#9 and partly fixes projectfluent#10 but has test failures when the
`likely-subtags` feature is enabled, as discussed in projectfluent#10.

This implementation follows the Unicode recommendataions fairly
closely but does not implement deprecated or grandfathered mappings.
@zbraniecki
Copy link
Collaborator

I'm going to close this issue here since we now track it in unic-locale crate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants