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

Support for nested locale structure in React projects #440

Open
lukdev371 opened this issue Oct 16, 2024 · 0 comments
Open

Support for nested locale structure in React projects #440

lukdev371 opened this issue Oct 16, 2024 · 0 comments

Comments

@lukdev371
Copy link

First of all, I want to say that I really enjoy using the easy i18n plugin—it's been incredibly helpful for managing translations in my project!
I am working on a React project using i18next and the easy-i18n plugin. My locale structure is nested to support modularity, similar to this:

.
└── locales/
    ├── de/
    │   ├── context/
    │   │   ├── common.json -> common only for context
    │   │   └── login.json
    │   └── common.json -> general common
    └── en/
        ├── context/
        │   ├── common.json
        │   └── login.json
        └── common.json

This structure works well with i18next, but the easy-i18n plugin currently does not support it.

At least for the creation and the code completion, the plugin does not handle this correctly. Code completion leads to the separation of keys with the namespace separator. For example, it produces context:common:my_key.nested but it should be context/common:my_key.nested.

The plugin expects flat locale files directly under the language folder, which limits its use in projects with more complex and modular file structures.

Desired Behavior

It would be great if easy-i18n could support nested folder structures for locale files, similar to how i18next handles it. This would allow for more flexible and organized file management, especially in larger projects where multiple contexts or components have their own localized content.

Benefits

  • Improved compatibility with existing i18next setups
  • Better organization of locale files in larger projects
  • Enhanced scalability and maintainability for multilingual projects
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