-
-
Notifications
You must be signed in to change notification settings - Fork 760
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
localeStructure without sub-directory keeps searching for subdirectory #1500
Comments
Sounds like you've debugged it thoroughly. Would definitely accept a PR for this bug fix if you have the time? |
I will try to do this in the next couple of days ✌️ |
I've created a PR for this Issue. |
@BeckerNico Much appreciated! However, I don't think this should be solved via a regex. The solution should be declarative via the templating syntax. |
@isaachinman I tried that, but the problem is, that without the regex i'm not able to remove the special chraracters around the language. For example if the filename is |
Perhaps check the i18next ecosystem for inspiration, as this is where the templated path option comes from. |
@isaachinman i adjusted the PR by removing the regex and using only the templating syntax to extract the namespace from the filename. What do you think? |
thx @BeckerNico for taking care of this ✌️ |
@isaachinman did you have time to look into the updated PR? |
@bartrail @BeckerNico Here are my thoughts: Based on comments like #1202 (comment):
I think the most "custom" fs support we'd proceed with in I am envisioning a future state where I am very hesitant to merge a PR like #1546, as it will just lead to further and further edge cases popping up, as the possibilities are literally infinite. |
Hi @isaachinman, I am thinking to make this PR as you said, since Couchers is transitioning to NextJS and we need this functionality. I was thinking to keep |
@lucaslcode I think we'd be better off introducing a new/dedicated config property, rather than overriding any i18next props. |
@isaachinman my bad sorry - I meant override |
@isaachinman this is coming along. I just have a question about the workings that I can't quite figure out. You're using Thanks so much! |
If you want it to work out of the box, yes. The docs are here. Let me know if I can answer any other questions, and a massive thanks for digging into this! |
localeStructure without sub-directory keeps searching for subdirectory
When changing the configuration to use a flat directory structure like this, so I can use files like
common.en.json
orsomething-else.fr.json
there is an error thrown, expecting the language directory to be there.configuration:
Error:
Occurs in next-i18next version
8.8.0
Steps to reproduce
change the configuration to the one above
Expected behaviour
The loading of the files works as expected.
Additional context
I did some debugging in the
createConfig.js
from node-modules and found out, that thecombinedConfig
variable is filled correctly and these variables also look correct:outputs:
So I think the problem relies in some un-configured namespace configuration below where path is concatinated without respecting the combined config.
The text was updated successfully, but these errors were encountered: