Introduce i18n API for the frontend#631
Merged
timja merged 21 commits intojenkinsci:mainfrom Apr 23, 2025
Merged
Conversation
Contributor
Author
|
If there are any other suggestions on approach I would be happy to pivot to that |
Member
Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>
Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>
This reverts commit 4dc0684.
Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>
lewisbirks
commented
Apr 23, 2025
Comment on lines
+13
to
+19
| const YEAR = "Util.year"; | ||
| const MONTH = "Util.month"; | ||
| const HOURS = "Util.hour"; | ||
| const DAY = "Util.day"; | ||
| const MINUTE = "Util.minute"; | ||
| const SECOND = "Util.second"; | ||
| const MILLIS = "Util.millisecond"; |
Contributor
Author
There was a problem hiding this comment.
should these become predefined types?
Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>
timja
reviewed
Apr 23, 2025
timja
reviewed
Apr 23, 2025
timja
approved these changes
Apr 23, 2025
…f that is the case
Signed-off-by: lewisbirks <22620804+lewisbirks@users.noreply.github.com>
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.

Introduce an API to get the internationalised messages to be called and used within the TS frontend. The frontend handles the formatting using the messageformat library, however there is a difference between how it manages plurality. The Java MessageFormat class uses a
choicekeyword whereas the JS library uses they keywordpluralityand has a different parsing logic so I've tried to replicate Java's implementation here as a custom format.Fixes #630
Testing done
Changed browser language to Polish
Before
After
Submitter checklist