8000 Convert LinkExpirationFormatterMethod to Java's ChoiceFormat pattern by ahus1 · Pull Request #21888 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Convert LinkExpirationFormatterMethod to Java's ChoiceFormat pattern - #21888

Merged
hmlnarik merged 1 commit into
keycloak:mainfrom
ahus1:is-21887-fix-translations-for-language-counts
Jul 27, 2023
Merged

hmlnarik merged 1 commit into
keycloak:mainfrom
ahus1:is-21887-fix-translations-for-language-counts

Conversation

@ahus1
@ahus1 ahus1 commented Jul 22, 2023 •
Copy link
Copy Markdown
Member

Closes #21887

The code that was used to convert the different languages (except English) is present in LinkExpirationFormatterMethodTest#convert.

To test the result, consider for example jshell:

jshell> java.text.MessageFormat.format("{0,choice,0#Sekunden|1#Sekunde|1<Sekunden}",2)
==> "Sekunden"


jshell> java.text.MessageFormat.format("{0,choice,0#Sekunden|1#Sekunde|1<Sekunden}",1)
==> "Sekunde"

Discussion: #9270

@ahus1
ahus1 commented Jul 23, 2023
Copy link
Copy Markdown
Member Author

@hmlnarik - as we've talked about translation formats recently, I wonder if you could review and merge this PR as well. I wasn't sure where to put the code for the conversion, so I placed it in a test case as it can be run interactively from the IDE. I could also remove it from there and paste it into this PR. WDYT?

Thanks!

@ahus1
ahus1 requested a review from hmlnarik July 23, 2023 14:04
@ahus1
ahus1 marked this pull request as ready for review July 23, 2023 14:04
@ahus1
ahus1 requested a review from a team as a code owner July 23, 2023 14:04
@ahus1
ahus1 force-pushed the is-21887-fix-translations-for-language-counts branch from 1864aff to 8de973d Compare July 26, 2023 09:05
@ahus1
ahus1 requested review from stianst and removed request for hmlnarik July 26, 2023 09:06
@ahus1
ahus1 commented Jul 26, 2023
Copy link
Copy Markdown
Member Author

@stianst - this is now re 8000 ady for another review. Thanks!

@ahus1
ahus1 force-pushed the is-21887-fix-translations-for-language-counts branch from 8de973d to 1838920 Compare July 26, 2023 09:18
@ahus1
ahus1 requested a review from stianst July 26, 2023 09:19
stianst
stianst previously approved these changes Jul 26, 2023
@stianst
stianst enabled auto-merge (squash) July 26, 2023 09:53
@hmlnarik
hmlnarik disabled auto-merge July 26, 2023 11:43
@hmlnarik hmlnarik left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like this PR, this simplifies the automatic translation. Thank you.

However, four locales (ar, cz, sk, pl) lose their translations. Could you please fix?

@ahus1
ahus1 force-pushed the is-21887-fix-translations-for-language-counts branch from 1838920 to e600a6a Compare July 26, 2023 13:12
@ahus1
ahus1 requested a review from hmlnarik July 26, 2023 13:19
@hmlnarik hmlnarik left a comment
Copy link
Copy Markdown
Contributor
8000

Choose a reason for hiding this comment

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

Thanks for the changes

@hmlnarik
hmlnarik merged commit 1ec8d3a into keycloak:main Jul 27, 2023
@ahus1
ahus1 deleted the is-21887-fix-translations-for-language-counts branch September 21, 2023 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simplify translations for LinkExpirationFormatterMethod

3 participants

0