Replies: 1 comment 3 replies
-
@Hydhen Here is a simple implementation of a reusable concept. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I am working on a project that offers various features designed to be as independent as possible. This involves organizing translations for each feature into separate translation files.
The structure of my components is outlined below:
Currently, I have a provider set up for each feature like this:
To streamline the code across multiple features and components, I aim to centralize the loader function app-wide. Thus, I've devised the following generic approach:
However, I'm facing an issue with providing the correct path to this shared loader function so that it can load scoped translation files appropriately. Unfortunately, accessing __filename or __dirname isn't feasible in my scenario – both during development and in the built project.
If you have any insights on how to address this challenge effectively, your input would be greatly appreciated.
Possible related discussion: #571
Beta Was this translation helpful? Give feedback.
All reactions