Open soullivaneuh opened 4 years ago
This is currently working as designed. We have discussed just adding new values to existing themes but we decided against that because we thought it may be a bad idea to silently add new messages to your theme that you don't have a chance to localize.
If you use the UI to update the theme you will be shown a warning and be prompted to add the missing keys automatically. When using the API it is manual as you are doing already.
We could think about adding a new Theme API parameter that would tell FusionAuth to just add any missing values from the default theme w/out a validation error. This would allow the API to work as you would like.
We have discussed just adding new values to existing themes but we decided against that because we thought it may be a bad idea to silently add new messages to your theme that you don't have a chance to localize.
I understand this part, but because of that, I just have translations key and I don't really know what to put in it.
Having a default value is better and I don't think so much people change what you defined. After all, there is no many ways to translate a sentence. :wink:
If I want to get the default values, what should I do?
If you use the UI to update the theme you will be shown a warning and be prompted to add the missing keys automatically. When using the API it is manual as you are doing already.
This will be the easiest.
If you want to do it programmatically, you could retrieve the default theme, and parse out the missing keys to get the default english version.
you could retrieve the default theme, and parse out the missing keys to get the default english version.
This is the issue here. As said on my first comment, I can't retrieve the default missing keys:
I never changed those keys, and they are indeed not present on the related version translations: https://github.com/FusionAuth/fusionauth-localization/blob/1.18.7/theme/messages.properties
Yes. Good point.
We need to figure how to best solve this, probably one of two options, or both:
Thanks!
The default way, as its done for the other keys looks better to me.
FYI, updating to 1.27.2 comes with additional required keys:
{description}recovery-codes-1
{description}recovery-codes-2
email-verification-required-send-another
[EmailVerificationEmailUpdated]
email-verification-required-title
[cannotSend]method
{description}email-verification-required
[ExternalAuthenticationException]SAMLIdPInitiatedIssuerVerificationFailed
[RegistrationVerificationSent]
{description}registration-verification-required-non-interactive
[moderationRejected]registration.username
{description}registration-verification-required
[ExternalAuthenticationException]SAMLIdPInitiatedResponseSolicited
registration-verification-required-title
registration-verification-required-send-another
{description}email-verification-required-non-interactive
{description}email-verification-required-change-email
[EmailVerificationSent]
But it's even worst for that case because I can find any of those keys on the default localization file: https://github.com/FusionAuth/fusionauth-localization/blob/master/theme/messages.properties.
However, I can find some on the polish translation.
A bit help on that would be greatly appreciated. :slightly_smiling_face:
@soullivaneuh Thanks! While this doesn't address the original issue, I did just push an updated properties file to https://github.com/FusionAuth/fusionauth-localization/blob/master/theme/messages.properties with all the required keys in it.
We're working on a solution to automate this process, but appreciate your letting us know about the issue with 1.27.2. Sorry about that.
The following key is missing on v1.28.1
: https://github.com/FusionAuth/fusionauth-localization/blob/4b15d67b2eda6202cb44b972a737e88472ebeffb/theme/messages.properties#L93
Another three required translations on v1.29.0
:
pending-device-links=Continue to complete your link to %s and %s.
pending-links-login-to-complete=Login to complete your link to %s and %s.
pending-links-register-to-complete=Register to complete your link to %s and %s.
Missing default translations keys for theme API
Description
In order to automate our FusionAuth setup, I have a script that download your default translations files, change some keys and push them trough the API.
I currently have this error:
I never changed those keys, and they are indeed not present on the related version translations: https://github.com/FusionAuth/fusionauth-localization/blob/1.18.7/theme/messages.properties
To be sure, I remove my override hack and directly put the official file content: Same thing.
I "solved" my problem by adding those key to my override file:
But I don't know what to put in because such references do not exist on your repo.
Affects versions
Not working with v1.18.7.
Working with 1.17.5.
Steps to reproduce
Update the theme translation message trough
PATCH /api/theme/{theme_id}
resource.Expected behavior
Update done without any error and without having to add those keys,
Additional context
My theme update script part:
Note:
messages.properties
andmessages_fr.properties
are a merge of your official file and my custom keys.