-
-
Notifications
You must be signed in to change notification settings - Fork 205
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 more glob patterns for namespaces #52
Comments
I thought about this 🙂Ok, let's do it! |
@aralroca when you see my config you will know why :D |
@BjoernRave what do you think if instead of glob patterns, we will support regExp when it exist the prefix Ex: {
'rgx:^.*/test/.*/example$': ['namespace'] // /this/test/is/an/example -> true
} In this case, we can provide more flexibility without bringing extra code. The problem of Glob is that we need to do all the conversions or use an external library. In static websites is not a problem because this code is only for the CLI, but in the case of |
@aralroca not sure. I myself am not super fluent with regexes, same for many people I think. Glob patterns seem to be like a standard for this kind of configuration. |
I like the idea of regex support, since its native in javascript it would keep the library tiny |
Ok @BjoernRave @Hanzo93 . Let's do a list of pros and cons:
Do you want to add any points to the list? I researched and there are a lot of libraries, like |
@aralroca thanks for that comparison. I guess looking at it, Regexes make more sense. It's fine by me if you guys prefer it. Will be a way to improve my Regex game :D |
@BjoernRave can you confirm that with the new Your example: {
"*/new": ["forms"],
"*/[id]/edit": ["forms"]
} Should be: {
"rgx:/new$": ["forms"],
"rgx:/\\[id\\]/edit$": ["forms"]
} or with both rules: {
"rgx:(/new|/\\[id\\]/edit)$": ["forms"],
} |
@aralroca when I install |
@BjoernRave you are right, I forgot to publish to npm, now is ready https://www.npmjs.com/package/next-translate?activeTab=versions |
@aralroca can confirm, that it works, good job :) |
It would be great if I could define my namespaces with patterns like the following:
The text was updated successfully, but these errors were encountered: