diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index de4cea74f..44ff253cb 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -6,7 +6,8 @@ "workspaceFolder": "/workspace", "extensions": [ "dbaeumer.vscode-eslint", - "esbenp.prettier-vscode" + "esbenp.prettier-vscode", + "lokalise.i18n-ally" ], "remoteUser": "node" } diff --git a/.vscode/i18n-ally-custom-framework.yml b/.vscode/i18n-ally-custom-framework.yml new file mode 100644 index 000000000..5309314f0 --- /dev/null +++ b/.vscode/i18n-ally-custom-framework.yml @@ -0,0 +1,27 @@ +# .vscode/i18n-ally-custom-framework.yml + +# An array of strings which contain Language Ids defined by VS Code +# You can check avaliable language ids here: https://code.visualstudio.com/docs/languages/overview#_language-id +languageIds: + - typescript + +# An array of RegExes to find the key usage. **The key should be captured in the first match group**. +# You should unescape RegEx strings in order to fit in the YAML file +# To help with this, you can use https://www.freeformatter.com/json-escape.html +usageMatchRegex: + # The following example shows how to detect `t("your.i18n.keys")` + # the `{key}` will be placed by a proper keypath matching regex, + # you can ignore it and use your own matching rules as well + - "[^\\w\\d]LocalizationManager.localizer.translate\\([\\n\\r\\s]*.+,[\\n\\r\\s]*['\"`]({key})['\"`]" + - "[^\\w\\d]LocalizationManager.localizer.translateByLocale\\([\\n\\r\\s]*.+,[\\n\\r\\s]*['\"`]({key})['\"`]" + - "[^\\w\\d]LocalizationManager.localizer.internalLocalizer.t\\([\\n\\r\\s]*['\"`]({key})['\"`]" + +# An array of strings containing refactor templates. +# The "$1" will be replaced by the keypath specified. +# Optional: uncomment the following two lines to use + +# refactorTemplates: +# - i18n.get("$1") + +# If set to true, only enables this custom framework (will disable all built-in frameworks) +monopoly: true diff --git a/.vscode/settings.json b/.vscode/settings.json index 2a0f950e1..f0ecdcd4f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,8 @@ { "files.insertFinalNewline": true, - "typescript.tsdk": "node_modules/typescript/lib" -} \ No newline at end of file + "typescript.tsdk": "node_modules/typescript/lib", + "i18n-ally.localesPaths": [ + "i18n" + ], + "i18n-ally.enabledParsers": ["json"] +}