Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 906dad6

Browse files
committed
dev: Set up i18n-ally
1 parent e284ea9 commit 906dad6

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"lokalise.i18n-ally"
4+
]
5+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# An array of strings which contain Language Ids defined by VS Code
2+
# You can check available language ids here: https://code.visualstudio.com/docs/languages/identifiers
3+
languageIds:
4+
- javascript
5+
- typescript
6+
- javascriptreact
7+
- typescriptreact
8+
9+
# An array of RegExes to find the key usage. **The key should be captured in the first match group**.
10+
# You should unescape RegEx strings in order to fit in the YAML file
11+
# To help with this, you can use https://www.freeformatter.com/json-escape.html
12+
usageMatchRegex:
13+
# The following example shows how to detect `t("your.i18n.keys")`
14+
# the `{key}` will be placed by a proper keypath matching regex,
15+
# you can ignore it and use your own matching rules as well
16+
- "[^\\w\\d]t\\(['\"`]({key})['\"`]"
17+
18+
# A RegEx to set a custom scope range. This scope will be used as a prefix when detecting keys
19+
# and works like how the i18next framework identifies the namespace scope from the
20+
# useTranslation() hook.
21+
# You should unescape RegEx strings in order to fit in the YAML file
22+
# To help with this, you can use https://www.freeformatter.com/json-escape.html
23+
scopeRangeRegex: "useTranslation\\(\\s*\\[?\\s*['\"`](.*?)['\"`]"
24+
25+
# An array of strings containing refactor templates.
26+
# The "$1" will be replaced by the keypath specified.
27+
# Optional: uncomment the following two lines to use
28+
29+
# refactorTemplates:
30+
# - i18n.get("$1")
31+
32+
33+
# If set to true, only enables this custom framework (will disable all built-in frameworks)
34+
monopoly: true

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
"editor.formatOnSave": false,
33
"editor.defaultFormatter": "esbenp.prettier-vscode",
44
"files.eol": "\n",
5-
"typescript.tsdk": "node_modules/typescript/lib"
5+
"typescript.tsdk": "node_modules/typescript/lib",
6+
"i18n-ally.localesPaths": [
7+
"./src/public/translations"
8+
],
69
}

0 commit comments

Comments
 (0)