diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index accd1c79..919eadd2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -20,7 +20,8 @@ "bierner.lit-html", "runem.lit-plugin", "davidanson.vscode-markdownlint", - "redhat.vscode-yaml" + "redhat.vscode-yaml", + "lokalise.i18n-ally" ], "settings": { "files.eol": "\n", diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 01ce9bc7..cd04d570 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -7,6 +7,7 @@ "bierner.lit-html", "runem.lit-plugin", "davidanson.vscode-markdownlint", - "redhat.vscode-yaml" + "redhat.vscode-yaml", + "lokalise.i18n-ally" ] } diff --git a/.vscode/i18n-ally-custom-framework.yml b/.vscode/i18n-ally-custom-framework.yml new file mode 100644 index 00000000..d7a1d8e3 --- /dev/null +++ b/.vscode/i18n-ally-custom-framework.yml @@ -0,0 +1,25 @@ +# 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]localize\\(['\"`]({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 new file mode 100644 index 00000000..615fdb53 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "i18n-ally.localesPaths": [ + "src/localize/languages" + ], + "i18n-ally.keystyle": "nested", +} \ No newline at end of file diff --git a/src/localize/languages/pt_br.json b/src/localize/languages/pt-BR.json similarity index 100% rename from src/localize/languages/pt_br.json rename to src/localize/languages/pt-BR.json diff --git a/src/localize/localize.ts b/src/localize/localize.ts index 9b353b08..3d7fd8df 100644 --- a/src/localize/localize.ts +++ b/src/localize/localize.ts @@ -1,5 +1,5 @@ import * as en from './languages/en.json'; -import * as pt_BR from './languages/pt_br.json'; +import * as pt_BR from './languages/pt-BR.json'; // eslint-disable-next-line @typescript-eslint/no-explicit-any const languages: any = {