Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure `I18n Ally` VsCode plugin to read nested locales from multiple locale files?

I have few language folders with locale files inside

  locales         
  ├── en
  |   ├── common.json
  |   ├── ...
  |   └── article.json
  └── de
      ├── common.json
      ├── ...
      └── article.json

And i have a nested structure of locale.json like this

{
  "title": "Something",
  "menu": {
    "first": "First",
    "second": "Second",
    "third": "Third"
  }
}

I can't configure the extension settings to read this locales structure

like image 986
Andreykch Avatar asked Dec 12 '25 11:12

Andreykch


1 Answers

I was struggling to make this work too, then finally found out the right config.

Important thing is to set localesPaths as well as pathMatcher in settings accordingly.

"i18n-ally.localesPaths": "src/locales",
"i18n-ally.namespace": true,
"i18n-ally.pathMatcher": "{locale}/{namespace}.json",

Also, developers notice in docs that it is important to set namespace to true before pathMatcher.

like image 157
jacob_frankovic Avatar answered Dec 15 '25 04:12

jacob_frankovic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!