Description
Description:
Currently, the package.nls.json
and package.nls.{locale}.json
files are expected to be located in the root of the project for VSCode to properly detect and apply translations. However, for projects with multiple locales, this can result in a large number of translation files cluttering the root directory.
Feature Request:
I'd like to propose a feature that allows grouping all package.nls*.json
files inside a custom folder (e.g., packages-nls
). The package.json
would still reference these files in the usual way, but with the option to define their location, similar to how the l10n
folder is currently used for bundle.l10n.json
.
Example:
Instead of placing all translation files in the root, we could organize them as follows:
PROJECT_NAME
├── l10n
│ └── bundle.l10n.json
├── packages-nls
│ ├── package.nls.json
│ ├── package.nls.es.json
│ └── package.nls.de.json
├── src
│ └── extension.ts
└── package.json
And in the package.json
, we could still use translation keys like this:
{
"name": "my-extension",
"version": "0.0.1",
"main": "./out/extension.js",
"l10n": "./l10n",
"nls": "./packages-nls",
"contributes": {
"commands": [
{
"command": "my-extension.helloWorld",
"title": "%my-extension.helloWorld.title%"
}
]
}
}
This way, developers could keep their root directory cleaner while still providing translation files.
Current Behavior:
If the package.nls*.json
files are moved to a custom folder, VSCode does not recognize keys and extension shows %my-extension.helloWorld.title%
Activity