Skip to content

Conversation

@MaximeBajeux
Copy link
Contributor

ref: #MANAGER-19805

Description

Ticket Reference: #MANAGER-19805

Additional Information

@MaximeBajeux MaximeBajeux requested a review from a team as a code owner October 24, 2025 12:51
@MaximeBajeux MaximeBajeux requested review from JacquesLarique, achrafHafedh and sachinrameshn and removed request for a team October 24, 2025 12:51
@github-actions github-actions bot added the bug Something isn't working label Oct 24, 2025
*/
// const { t: tCountry } = useTranslation(NAMESPACES.COUNTRY);
// const { t: tLanguage } = useTranslation(NAMESPACES.LANGUAGE);
const { t: tCountry } = useTranslation(NAMESPACES.COUNTRY);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think in this case it would be better to use an alternative way of using useTranslation by passing an array of namespaces to the hook and then define the namespace in the t-function.

const { t } = useTranslation(['account-details', NAMESPACES.FORM, NAMESPACES.LANGUAGE, NAMESPACES.COUNTRY]);

and then

tCountry(`country_${countryCode}`)

becomes

t(`country_${countryCode}`, { ns: NAMESPACES.COUNTRY })

Copy link
Contributor

Choose a reason for hiding this comment

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

the first namespace (account-details) can be accessed without naming the ns.
So here it stays the same with t('asdf');

ref: https://react.i18next.com/latest/usetranslation-hook#usetranslation-params

ref: #MANAGER-19805

Signed-off-by: Maxime Bajeux <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants