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

String interpolation throws error if missing replacement keys for i18n #3725

Open
flyweight opened this issue Sep 29, 2024 · 1 comment
Open
Labels

Comments

@flyweight
Copy link

flyweight commented Sep 29, 2024

Describe the bug

When replacing language keys defined in okta-signin-widget/packages/@okta/i18n/src/properties /login.properties that contain replacement references (e.g. {0}), the interpolation throws an exception when leaving out the reference.

Reproduction Steps

Update the following key:

factor.windowsHello.signin.description.specific = Sign in to {0} using Windows Hello.

to

factor.windowsHello.signin.description.specific = Sign in using Windows Hello.

and have the sign in widget show this language key.

https://github.com/okta/okta-signin-widget/blob/master/src/util/loc.ts#L78

SDK Versions

7.23.0

Additional Information

No response

@flyweight flyweight added the bug label Sep 29, 2024
@flyweight
Copy link
Author

The brandName config property may resolve this for my use case

brandName
The brand or company name that is displayed in messages rendered by the Sign-in Widget (for example, "Reset your {brandName} password"). If no brandName is provided, a generic message is rendered instead (for example, "Reset your password"). You can further customize the text that is displayed with language and text settings.

brandName: 'Spaghetti Inc.'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant