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

[Sui-i18n] Interpolate nested chunks generate noisy warnings #1594

Open
mariofpalb opened this issue Mar 24, 2023 · 0 comments
Open

[Sui-i18n] Interpolate nested chunks generate noisy warnings #1594

mariofpalb opened this issue Mar 24, 2023 · 0 comments

Comments

@mariofpalb
Copy link

Package

[email protected]

Description

We have noticed something while developing with i18n that the interpolate function has an issue when nesting chunks like this:

%[key]%[key2]children[key2]%[key]%

The thing is that if you pass to the values object both keys definitions, is it going to work as expected. However, is not because of the nested interpolate function: https://github.com/SUI-Components/sui/blob/master/packages/sui-i18n/src/i18n.js#L218-L221

This method arguments expects another literal key, when in the example shown before the children value is %[key2]children[key2]%. This ends up showing a lot of warnings in the console that at the end makes it very noisy.

Steps to Reproduce

  1. Set a literal like the example before, with a nested chunk inside another one.
  2. Set the literal key inside the interpolate function and set values for both keys (key and key2 in the example before)
  3. Go to the page where this literals are interpolated and see the console of the navigator

Expected behavior: There is no warnings in the console when interpolating this nested literals.

Actual behavior: There is a lot of noisy warnings in the console whenever a nested chunk occures.

Reproduces how often: I would say this happens very rarely

Additional Information

I would say more testing in this feature could check this behaviour better.

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

No branches or pull requests

1 participant