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

[bug]: Translations unusable and saved without plugin prefix #86

Open
joaovpmamede opened this issue Feb 14, 2025 · 0 comments
Open

[bug]: Translations unusable and saved without plugin prefix #86

joaovpmamede opened this issue Feb 14, 2025 · 0 comments
Labels
issue: bug Issue reporting a bug

Comments

@joaovpmamede
Copy link

What version of @strapi/sdk-plugin are you using?

Npm version
9.8.1
Node.js version
18.18.2
React version:
18.3.1
@strapi/sdk-plugin version
5.3.1

What's Wrong?

My understanding is that a plugin should use translations with the plugin name as a prefix, hence the use of PLUGIN_ID to get the translation.
It seems that before a prefixPluginTranslations function was used to "add" the prefix to each translated string (e.g. users-permissions plugin).

To Reproduce

We can see that this is not working because there's no functionality to add this prefix.
We can also check the messages object from the useIntl() hook to see how its being saved (after adding some strings to /translations/en.json for example).

Expected Behaviour

The getTranslation function should return the correct string for the current locale.

@joaovpmamede joaovpmamede added the issue: bug Issue reporting a bug label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug
Projects
None yet
Development

No branches or pull requests

1 participant