Skip to content

Commit 2ee126b

Browse files
authored
Merge pull request #104 from rootstrap/fix/vscode_i18n_ally_not_showing_inline_annotations
fix(vscode): i18n-ally not showing inline annotations
2 parents 915ca20 + 0f4ab2d commit 2ee126b

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
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]translate\\(['\"`]({key})['\"`]"
17+
- "(?:text|title)\\s*[:=]\\s*{?['\"`]({key})['\"`]}?"
18+
19+
# A RegEx to set a custom scope range. This scope will be used as a prefix when detecting keys
20+
# and works like how the i18next framework identifies the namespace scope from the
21+
# useTranslation() hook.
22+
# You should unescape RegEx strings in order to fit in the YAML file
23+
# To help with this, you can use https://www.freeformatter.com/json-escape.html
24+
scopeRangeRegex: "useTranslation\\(\\s*\\[?\\s*['\"`](.*?)['\"`]"
25+
26+
# An array of strings containing refactor templates.
27+
# The "$1" will be replaced by the keypath specified.
28+
# Optional: uncomment the following two lines to use
29+
30+
# refactorTemplates:
31+
# - i18n.get("$1")
32+
33+
# If set to true, only enables this custom framework (will disable all built-in frameworks)
34+
monopoly: true

0 commit comments

Comments
 (0)