Somo encoding problems in spanish in 24.0.4 docker version in admin theme
Before reporting an issue
- [X] I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.
Area
login/ui
Describe the bug
Accents, ñ and others display bad when you use it from messeges, the data form the database shows ok.
I read a lot of closed issues, and i try adding in compose
- JAVA_OPTS_APPEND=-Dfile.encoding=UTF-8
And in the github repo everything is utf8:
find -name "messages_es*" |xargs file ./themes/src/main/resources-community/theme/base/account/messages/messages_es.properties: HTML document, Unicode text, UTF-8 text ./themes/src/main/resources-community/theme/base/admin/messages/messages_es.properties: Unicode text, UTF-8 text ./themes/src/main/resources-community/theme/base/login/messages/messages_es.properties: HTML document, Unicode text, UTF-8 text ./themes/src/main/resources-community/theme/base/email/messages/messages_es.properties: HTML document, Unicode text, UTF-8 text, with very long lines (440) ./js/apps/admin-ui/maven-resources-community/theme/keycloak.v2/admin/messages/messages_es.properties: Unicode text, UTF-8 text, with very long lines (607) ./js/apps/account-ui/maven-resources-community/theme/keycloak.v3/account/messages/messages_es.properties: Unicode text, UTF-8 text
I tried existing database and fresh one.
Someone had the same problem?
Thanks
Version
24.0 to 24.0.4
Regression
- [X] The issue is a regression
Expected behavior
I expected the to see á instead of a symbol
Actual behavior
i see a symbol
How to Reproduce?
just run the docker
Anything else?
No response
Update, I made a new admin theme including only the original messages files and it worked as expected.
Probably something in the image build?
From the description, it is not clear what is needed to reproduce the issue. Could you please try to clarify steps to reproduce in a bit more details to reproduce this?
What I did is:
-
Start Keycloak distribution (ZIP bundle)
-
Created admin user
-
Login to admin console
-
In tab "Localization" of "master" realm, I've enabled localization and added "Spanish" to the list of "Supported locales"
-
Logout as admin and on the login page, I've updated language to "Spanish". Login page seems to be OK
-
Re-login to the admin console
-
Admin console looks OK to me. Everything properly translated to Spanish (with the exception of some messages, which are not localized to spanish)
Thanks for reporting this issue, but there is insufficient information or lack of steps to reproduce.
Please provide additional details, otherwise this issue will be automatically closed within 14 days.
Hi Marek, thanks for asking!
Just:
Run docker image: docker run -d -p 8080:8080
-e KEYCLOAK_ADMIN=admin
-e KEYCLOAK_ADMIN_PASSWORD=your-password
-e KC_PROXY=edge
--restart always
-v /your/projet/path:/opt/jboss/keycloak/standalone/data
quay.io/keycloak/keycloak:24.0.4 start-dev
Login in localhost:8080 -> http://localhost:8080/admin/master/console/#/master/realm-settings/localization
Add spanish, select spanish as default, f5 and then
I can reproduce this. And I think this is something not OK when generating the keycloak-admin-ui jar. In my local build the messages are ok. But If I download the zip for keycloak 24 I see the jar contains weird characters. Decompressing the JAR in distribution:
file theme/keycloak.v2/admin/messages/messages_es.properties
theme/keycloak.v2/admin/messages/messages_es.properties: Non-ISO extended-ASCII text, with very long lines (627)
In my local build:
file theme/keycloak.v2/admin/messages/messages_es.properties
theme/keycloak.v2/admin/messages/messages_es.properties: Unicode text, UTF-8 text, with very long lines (607)
So I presume that the issue is when the keycloak zip is generated. @mposolda Where can we point this distribution issues?
@rmartinc Maybe we can change component to area/dist/quarkus if it is related to the distribution? Could you please also update the description a bit to reflect this?
Moved to dist, but I cannot change the description (I suppose I have no permissions for that). Please check my previous comment. The texts inside the keycloak-admin-ui-*.jar are garbled in the zip file for 24.0.4 while they are not in my local compilation.
@rmartinc they don't appear to be garbled in nightly either.
I think this was fixed incidentally by #28798 - what's in 24 without that fix is not valid UTF-8 so proper encoding detection fails.
Thanks @shawkins! Then I assume we can close this as already fixed by #28798, right?
Yes, @shawkins is right and it's OK in the nightly build. So it was not something wrong in the distribution but in the file. I suppose there were some non utf-8 characters and that triggered the issue. When those chars were fixed in https://github.com/keycloak/keycloak/issues/28798 it was immediately fixed in the jar. So this is already fixed and it will be OK in version 25. Closing this as duplicated of #28798.