i18n-ally icon indicating copy to clipboard operation
i18n-ally copied to clipboard

Allow absolute path support for localesPaths array items

Open Greg-NetDuma opened this issue 3 years ago • 1 comments

Is your feature related to a specific framework or general for this extension No

Is your feature request related to a problem? Please describe. Currently in a multi-root workspace in VSCode localesPath is always relative to the (workspace) folder a selected file is in. This is a problem if the workspace folders are at different folder depths relative to each other and you want to use the extension in the global workspace (otherwise you could use path traversal).

"folders": [
        {
            "name": "Core",
            "path": "core"
        },
        {
            "name": "Dashboard",
            "path": "dashboard/files"
        },
],
"settings": {
       "i18n-ally.localesPaths": [
            "../core/locales",
            "../dashboard/files/locales",
        ]
}

A working example with path traversal because the folders are at the same depth:

"folders": [
        {
            "name": "Core",
            "path": "core"
        },
        {
            "name": "Dashboard",
            "path": "dashboard"
        },
],
"settings": {
       "i18n-ally.localesPaths": [
            "../core/locales",
            "../dashboard/files/locales",
        ]
}

Describe the solution you'd like If absolute paths could be supported I could use a localePaths array like this:

"folders": [
        {
            "name": "Core",
            "path": "core"
        },
        {
            "name": "Dashboard",
            "path": "dashboard/files"
        },
],
"settings": {
       "i18n-ally.localesPaths": [
            "${workspaceFolder}/core/locales",
            "${workspaceFolder}/dashboard/files/locales",
        ]
}

This would work because this setting is defined in the global workspace, so it would resolve to it's root.

Additional context None

Greg-NetDuma avatar Jan 05 '22 14:01 Greg-NetDuma

any update?

Wxh16144 avatar Jan 17 '24 10:01 Wxh16144