-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add translation files with plugin config #810
Comments
@michaelbromley Are there special guidelines I should try to follow? I think the last idea would be the easiest one. I could add a |
Yes, I prefer the second solution, because I want to keep the API of PluginMetadata as limited as possible. So the idea would be that in your plugin you inject |
Just as a reminder: |
oh, I didn't know that! Looks like it can be replaced with https://github.com/i18next/i18next-fs-backend, they say
I wonder what "mostly" means here. Are you interested in attempting to try? |
Yeah I can try that. But right now im struggeling finding the correct namespace where to place the new resource bundle at. |
I have to import the Isn't it exported in This is the error I get when I try to import from Vendure core in my e2e test plugin
|
Ah yeah it's not exported. You can add to the core/src/index.ts: export * from './i18n/i18n.service'; |
I would also like to export the |
ok, you can create an |
Okay, only thing left is to improve the e2e test I guess. Is there a way to force a language in a request? I don't quite get how the |
Yes, you pass the vendure/packages/core/e2e/product.e2e-spec.ts Lines 257 to 261 in 0e9f528
|
Actually the query needs the parameter See:
Is this correct? |
Oh, yeah - the |
Okay I'll change that to |
Is your feature request related to a problem? Please describe.
When I create a new error message in my plugin, I want them to be translated like the other vendure errors.
This might not be necessary for the frontend but it might be easier for the frontend developer to always keep the same error format.
Describe the solution you'd like
A possiblity to add message files ( like the ones in core/src/i18n/message ) via PluginConfig.
All messages should be merged together on bootstrap.
Additional context
Translations can already be merged in the admin ui - so this might be reusable.
The text was updated successfully, but these errors were encountered: