Repository navigation
Conversation
The validator only allows unaccented letters a-z/A-Z, digits and the separators . _ - @, and rejects separators at the start or end or two in a row. The message only mentioned the length and the separators, so users with names like "josé" got no hint why their username was invalid. The separators are now passed as an interpolated value: with a literal `_` in the string, the i18n extractor split the message at the underscore and put a truncated msgid in en.pot. Implements LIBS-637 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
alexcpn
force-pushed
the
LIBS-637/username-validation-message
branch
from
December 4, 2026 13:44
d394639 to
cc2aad8
Compare
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Implements LIBS-637
Description
dhis2Usernameonly accepts unaccented lettersa-z/A-Z, digits and the separators. _ - @, and it rejects a separator at the start or end or two separators in a row. The error message only said:So a user typing
josé.silvaor a Cyrillic or Japanese name got no hint about what was wrong. The new message is:The validation rule itself is unchanged.
Side fix, i18n extraction: with a literal
_in the string, the extractor treated the text after_as a context.en.pottherefore hadmsgctxt " - or @"and a truncatedmsgidending inseparated by ., which is what translators saw on Transifex. The separators are now passed as an interpolated value ({{separators}}, the same pattern as the other validators in this folder), soen.potgets the full message with nomsgctxt.en.potwas regenerated withd2-app-scripts i18n extract.How it was tested
masterand pass with this change.josé.silva,пользовательanduser nameto the rejected-characters cases.dhis2Usernametests pass.eslintandprettier --checkare clean.Known issues
msgidchanged, existing translations of this message will show English until they are re-translated on Transifex.Checklist
No props changed. This is a validator message, so there's no API doc or Storybook change.
AI disclosure
This change was written and tested by an AI model, Claude Opus 5.5 (via Claude Code), and submitted by a human contributor.
#T4G (tokens for good project)
🤖 Generated with Claude Code