From a536f3085f1cf8ad623db1ccabc8623cd6b7bfea Mon Sep 17 00:00:00 2001
From: Sebastian Castro <sebastian.castro@protonmail.com>
Date: Sun, 2 May 2021 09:57:31 +0200
Subject: [PATCH] i18n: adds config for vscode i18n-ally plugin

---
 .vscode/i18n-ally-custom-framework.yml | 30 ++++++++++++++++++++++++++
 .vscode/settings.json                  |  8 +++++++
 2 files changed, 38 insertions(+)
 create mode 100644 .vscode/i18n-ally-custom-framework.yml
 create mode 100644 .vscode/settings.json

diff --git a/.vscode/i18n-ally-custom-framework.yml b/.vscode/i18n-ally-custom-framework.yml
new file mode 100644
index 000000000..fc7ca9ca8
--- /dev/null
+++ b/.vscode/i18n-ally-custom-framework.yml
@@ -0,0 +1,30 @@
+# .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:
+  - javascript
+  - php
+  - twig
+  - vue
+
+# 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
+  - "->trans\\(\\s*['\"`]({key})['\"`]" # php syntax
+  - "[^\\w\\d]t\\(\\s*['\"`]({key})['\"`]" # javascript template
+  - "[`'\"]({key})[`'\"][\\s\\n]*\\|[\\s\\n]*trans" # twig syntax
+
+
+# An array of strings containing refactor templates.
+# The "$1" will be replaced by the keypath specified.
+refactorTemplates:
+ - $this->trans("$1")
+
+
+# If set to true, only enables this custom framework (will disable all built-in frameworks)
+# monopoly: true
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 000000000..f93499a9f
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,8 @@
+{
+    "i18n-ally.localesPaths": [ "translations"  ],
+    "i18n-ally.pathMatcher": "**/*.{locale}.{ext}",
+    "i18n-ally.enabledParsers": ["yaml"],
+    "i18n-ally.sourceLanguage": "fr",
+    "i18n-ally.displayLanguage": "fr",
+    "i18n-ally.keystyle": "nested",    
+}
\ No newline at end of file
-- 
GitLab