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

Gen3: Use i18next instead of loc #3689

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open

Conversation

denysoblohin-okta
Copy link
Contributor

@denysoblohin-okta denysoblohin-okta commented Aug 9, 2024

Description:

Use i18next library for Gen3 instead of Courage's loc function for pluralization support

Example: use

password.complexity.length.description_one = At least one character
password.complexity.length.description_other = At least {0} characters
# fallback (same as _other)
password.complexity.length.description = At least {0} characters

instead of single

password.complexity.length.description = At least {0} characters

PR Checklist

Issue:

Reviewers:

Screenshot/Video:

Downstream Monolith Build:

// No need to escape
// Need to use raw value for phone numbers containing `‎`
// React is already safe from XSS
escapeValue: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 691 to 693
password.complexity.minAgeMinutes.description = At least {0} minute(s) must have elapsed since you last changed your password
password.complexity.minAgeMinutes.description_one = At least {0} minute must have elapsed since you last changed your password
password.complexity.minAgeMinutes.description_other = At least {0} minutes must have elapsed since you last changed your password
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example of using plural forms

Copy link
Contributor

@lesterchoi-okta lesterchoi-okta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to ask folks from g11n to review as well

src/v3/src/util/languageUtils.ts Outdated Show resolved Hide resolved
src/v3/src/util/languageUtils.ts Outdated Show resolved Hide resolved
Comment on lines -25 to +26
const authCoinConfiguration = getAuthCoinConfiguration();
const authCoinConfigByAuthKey = props?.authenticatorKey
&& authCoinConfiguration[props?.authenticatorKey];
&& getAuthCoinConfiguration()[props.authenticatorKey];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a necessary change, just small optimisation.
Noticed that for pages that don't have auth coin there will be a lot of unnecessary loc calls inside getAuthCoinConfiguration()

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

Successfully merging this pull request may close these issues.

2 participants