-
Notifications
You must be signed in to change notification settings - Fork 120
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
Use 2 letter language codes #975
Use 2 letter language codes #975
Conversation
if country_candidate: | ||
country_result = _normalize_country_code(country_candidate) | ||
if country_result is None: | ||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This matches the previous behavior, but I'm now wondering if it's better to keep the language code rather than dropping it on an invalid country code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we have something like name:en="Foo", name:en_XY="Bar"
do we want the name:en_XY
to normalise to name:en
and potentially clash with the other entry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. We can set it up so that we'll only set the language code if one doesn't already exist in this scenario, but the added complexity might not be worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed the behaviour in 4df4863 to keep the most specific language code. At the moment, that just means that any with an omitted country are less specific and won't overwrite a code without a country, e.g: en
always beats en_NOEXIST
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea with priorities! ⚡ My first thoughts were also to just return a more complex value object, but just whether the country code was invalid or not. The priority notion is a better generalization of that.
…iority to the result, so that we can keep the most specific match.
👍 |
1. `name:de` German | ||
1. `name:gr` Greek | ||
1. `name:it` Italian | ||
1. `name:jp` Japanese |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be ja
instead of jp.
Use ISO 639-1 two letter language codes for WOF & OSM rather than ISO 639-3 3 letter codes. This partially reverses changes made for #418.
Connects to #972.
@rmarianski could you review, please?