lokalise / i18n-ally

🌍 All in one i18n extension for VS Code
https://marketplace.visualstudio.com/items?itemName=lokalise.i18n-ally
MIT License
3.92k stars 310 forks source link

[Framework Request] i18n.js #691

Open RobertSasak opened 2 years ago

RobertSasak commented 2 years ago

What framework do you want to have? Please provide links of its i18n solution/package. https://github.com/fnando/i18n-js

Please provide some overall screenshots about how the i18n usage would be like

i18n.t("scope.key")
I18n.t("scope.key")

Please provide a minimal starter project Starter is included in the https://github.com/lokalise/i18n-ally/pull/690

Additional context

# .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
  - typescript
  - javascriptreact
  - typescriptreact

# 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]t\\(['\"`]({key})['\"`]"
  - "(?:i18n|I18n)\\.t\\(\\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
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

RobertSasak commented 2 years ago

Please, let me know if there is something I can do.

ghost commented 1 year ago

same it does not work at all. Neither detection of hard coded strings in VUE files neither the code i18n.t()