Skip to content
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

Translations update from Hosted Weblate #29103

Merged
merged 4 commits into from Apr 30, 2024

Conversation

weblate
Copy link
Contributor

@weblate weblate commented Apr 26, 2024

Translations update from Hosted Weblate for Keycloak/Admin UI.

It also includes following components:

Current translation status:

Weblate translation status

@weblate weblate requested review from a team as code owners April 26, 2024 08:07
jonkoops
jonkoops previously approved these changes Apr 26, 2024
@jonkoops jonkoops enabled auto-merge (squash) April 26, 2024 08:31
auto-merge was automatically disabled April 26, 2024 13:57

Head branch was pushed to by a user without write access

jonkoops
jonkoops previously approved these changes Apr 26, 2024
@jonkoops jonkoops enabled auto-merge (squash) April 26, 2024 13:59
ahus1
ahus1 previously approved these changes Apr 26, 2024
@ahus1 ahus1 disabled auto-merge April 26, 2024 14:08
@ahus1 ahus1 enabled auto-merge (rebase) April 26, 2024 14:08
@ahus1
Copy link
Contributor

ahus1 commented Apr 26, 2024

@jonkoops @thomasdarimont @robson90 - I see that the tests fail, I need to look into this next week if some tests depend on translations.

I also see that the German language now has a translation of all other languages. AFAIK the English language has entries for each language in the language's own writing, which would indicate not to translate those entries. If we choose to not translate them, we should better move those strings to a different file. Still this is open for discussion: in an admin UI it would make sense to translate the languages if they are presented to an admin to select them. If they are presented to a user in the login page, it would be good not to translate them as a user might not recognize their language in the current UI's language. (I am currently unable to look at the UIs, so I might be wrong here, will do that next week).

Happy to hear your thoughts. While the build breaks and with the question I raised about the language names, I ask you to slow down the translation a bit and wait for this PR to be merged. I assume we will resolve this next week.

@jonkoops
Copy link
Contributor

jonkoops commented Apr 26, 2024

I also see that the German language now has a translation of all other languages. AFAIK the English language has entries for each language in the language's own writing, which would indicate not to translate those entries. If we choose to not translate them, we should better move those strings to a different file.

Agreed, those strings should not be translated. But perhaps they don't need to be in a property file either. Could we use Locale.getDisplayName(); to get the language name on the Java-side? For example:

Locale locale = new Locale("nl");
System.out.println(locale.getDisplayName()); // "Dutch"

@ahus1 WDYT?

@thomasdarimont
Copy link
Contributor

Thanks for looking into this!

My 2 cents:
While working on the german translations I also noticed that the locale names could be pulled form the JDK, that's in fact what I used
to create the translations in the first place... but I hesitated to question the implementation as it were "just a few strings..." ;-)

However, I'm in favor of using JDK built-in functionality. It seems that the languages are currently translated via messagebundle in
the UI since the server only returns the list of supportedLocales in the realm response.

If we want to leverage the translations built-in the JDK we could add a new supportedLocales endpoint to the
RealmLocalizationResource to expose a LocaleRepresentation.

Additionally there is also LocaleBean which is used by the language selection in Freemarker based pages.

@jonkoops
Copy link
Contributor

If we want to leverage the translations built-in the JDK we could add a new supportedLocales endpoint to the
RealmLocalizationResource to expose a LocaleRepresentation.

There should be no need to create a new REST API endpoint for this, there are equivalent APIs on the browser-side we can use to localize this. Taking my previous example translated to JS:

const regionNames = new Intl.DisplayNames(['en'], { type: 'language' });
console.log(regionNames.of('nl')); // "Dutch"

@ahus1
Copy link
Contributor

ahus1 commented Apr 28, 2024

Thank you for the feedback. I'll prepare a PR to automatically blend in the Java translations of locales at the backend. This would allow us to leverage the translation override if anyone would want that. And the results shown would be consistent, independent of the user's browser settings. Please follow #29124 for the progress.

@ahus1 ahus1 enabled auto-merge (rebase) April 29, 2024 16:21
@ahus1
Copy link
Contributor

ahus1 commented Apr 29, 2024

@thomasdarimont - Weblate is buffering changes, so they might show up deferred only. With the latest squash-commit changes (maybe even before?) it will rebase this PR once there is a change in the parent repo. Let's see how often this happens, and how annoying this is to get the PR merged.

This was referenced Apr 29, 2024
@ahus1
Copy link
Contributor

ahus1 commented Apr 30, 2024

@jonkoops - please review for the UI team. Thanks!

@ahus1 ahus1 requested a review from jonkoops April 30, 2024 06:28
auto-merge was automatically disabled April 30, 2024 06:58

Head branch was pushed to by a user without write access

thomasdarimont and others added 4 commits April 30, 2024 10:17
Translation: Keycloak/Theme base/email
Translate-URL: https://hosted.weblate.org/projects/keycloak/theme-baseemail/de/

Translated using Weblate (German)

Translation: Keycloak/Theme base/login
Translate-URL: https://hosted.weblate.org/projects/keycloak/theme-baselogin/de/

Translated using Weblate (German)

Translation: Keycloak/Theme base/admin
Translate-URL: https://hosted.weblate.org/projects/keycloak/theme-baseadmin/de/

Translated using Weblate (German)

Translation: Keycloak/Theme base/account
Translate-URL: https://hosted.weblate.org/projects/keycloak/theme-baseaccount/de/

Co-authored-by: Thomas Darimont <thomas.darimont@googlemail.com>
Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
Translation: Keycloak/Account UI
Translate-URL: https://hosted.weblate.org/projects/keycloak/account-ui/de/

Translated using Weblate (German)

Translation: Keycloak/Account UI
Translate-URL: https://hosted.weblate.org/projects/keycloak/account-ui/de/

Translated using Weblate (German)

Translation: Keycloak/Account UI
Translate-URL: https://hosted.weblate.org/projects/keycloak/account-ui/de/

Co-authored-by: Robin <39960884+robson90@users.noreply.github.com>
Signed-off-by: Robin <39960884+robson90@users.noreply.github.com>
Translation: Keycloak/Theme base/login
Translate-URL: https://hosted.weblate.org/projects/keycloak/theme-baselogin/de/

Co-authored-by: Alexander Schwartz <alexander.schwartz@gmx.net>
Signed-off-by: Alexander Schwartz <alexander.schwartz@gmx.net>
Updated by "Remove blank strings" hook in Weblate.

Translation: Keycloak/Theme base/login
Translate-URL: https://hosted.weblate.org/projects/keycloak/theme-baselogin/

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Signed-off-by: Hosted Weblate <hosted@weblate.org>
@ahus1 ahus1 enabled auto-merge (rebase) April 30, 2024 09:01
@ahus1 ahus1 merged commit db6f356 into keycloak:main Apr 30, 2024
69 checks passed
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.

None yet

5 participants