Skip to content

CLDR-18798 bad locales: call out bad locales in user list #4878

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

Merged
merged 1 commit into from
Jul 16, 2025

Conversation

srl295
Copy link
Member

@srl295 srl295 commented Jul 16, 2025

  • we are already normalizing away 'bad' (invalid or missing locales) from the user list
  • this code preserves anything that was normalized away and presents it in the user list
  • error can be corrected by calling 'set locales' and changing the locales, as the 'set locale' function will overwrite the locales list and does not allow invalid or missing locales to be set.

CLDR-18798

  • This PR completes the ticket.

ALLOW_MANY_COMMITS=true

image

- we are already normalizing away 'bad' (invalid or missing locales) from the user list
- this code _preserves_ anything that was normalized away and presents it in the user list
- error can be corrected by calling 'set locales' and changing the locales, as the 'set locale' function will overwrite the locales list and does not allow invalid or missing locales to be set.
Copy link
Member

@btangmu btangmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvements! Ideally, locales would be private, accessed only with getLocales, setLocales. Minor quibble: TODO comment should reference a ticket

@@ -451,6 +451,7 @@ private void putShownUser(JSONArray shownUsers, UserSettings u) throws JSONExcep
boolean havePermToChange = me.isAdminFor(user);
boolean userCanDeleteUser = UserRegistry.userCanDeleteUser(me, user.id, user.userlevel);
VoteResolver.Level level = VoteResolver.Level.fromSTLevel(user.userlevel);
// TODO: why doesn't this use u.toJSONObject()?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"TODO" comment should include a ticket number

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good. i'll update this in a followon

@srl295 srl295 merged commit 94a3f6d into unicode-org:main Jul 16, 2025
15 of 16 checks passed
@srl295 srl295 deleted the cldr-18798/drop-msg-bad-locales branch July 16, 2025 20:25
@macchiati
Copy link
Member

I ran across two other locale codes that should not occur — nobody should be able to vote in them.

Norwegian Bokmål nb → should be no
Portuguese (Brazil) pt_BR → should be pt

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 this pull request may close these issues.

3 participants