Skip to content

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

@flyweight

Description

@flyweight

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions