Support for custom namespace match/separator
See original GitHub issueIs your feature related to a specific framework or general for this extension
General, next-translate
Is your feature request related to a problem? Please describe.
I’m trying to use this together with next-translate
It uses the following pattern t('namespace:key.nested')
, which I can’t seem to setup with the custom framework yaml
Describe the solution you’d like
If I could add {namespace}
to usageMatchRegex
, and use that to pick locale file, another solution would be to have namespaceKeySeparator
setting, default to .
, I could then set it to :
to get the same result.
Additional context
.vscode/settings.json
{
"i18n-ally.localesPaths": ["./public/static/locales", "public/static/locales"],
"i18n-ally.namespace": true,
"i18n-ally.pathMatcher": "{locale}/{namespace}.json",
"i18n-ally.sourceLanguage": "sv",
"i18n-ally.keystyle": "nested",
"i18n-ally.enabledFrameworks": ["custom"]
}
.vscode/i18n-ally-custom-framework.yml
languageIds:
- javascript
- typescript
- javascriptreact
- typescriptreact
usageMatchRegex:
- "[^\\w\\d]t\\(['\"`]({namespace})\\:({key})['\"`]"
monopoly: true
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Support for custom namespace match/separator · Issue #295
If I could add {namespace} to usageMatchRegex , and use that to pick locale file, another solution would be to have namespaceKeySeparator ......
Read more >Manual:Using custom namespaces
Custom namespaces are simple to manage using the $wgExtraNamespaces configuration directive. It is also possible to define alias names for ...
Read more >Installing IBM Cloud Pak foundational services in a custom ...
Important: You can install foundational services in a custom namespace only if you are installing them for the first time in your cluster....
Read more >Help:Custom namespaces - semantic-mediawiki.org
Missing data on custom namespaces - troubleshooting on missing semantic data on a custom namespace; $smwgNamespacesWithSemanticLinks - help page ...
Read more >Namespaces | Airbyte Documentation
Custom Format - Create a "Custom Format" to rename the namespace that your data will be replicated into. If both your desired source...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is this supposed to work “out of the box”? I’m using 2.3.20 and I cannot make this work
I’m using i18next with two namespaces and ‘:’ as separator
From my i18next config:
In my i18-a11y setting I have
Some examples I tried:
Only the first two are recognized by the extension. The others are not found. When I try to add them via the extension, it asks which file to use.
Additionally, it seems to be no way to set a default namespace (example 5) ?
Perhaps anecdotically: In example 5, not only the key is not found, but when I try to add them via the extension, it crops part of the key (eg: “Required val” is saved as “d val” - seems to crop an non-existent common: prefix)
Supported in v2.1.6. It should work out of the box. All you need would be