CodinGame / monaco-vscode-api

VSCode public API plugged on the monaco editor
MIT License
226 stars 31 forks source link

Optimize localization #417

Closed CGNonofr closed 5 months ago

CGNonofr commented 5 months ago

Apply the same optimization than VScode in vscode.dev, which replaces string translation keys by their indexes within the module

in the localization file:

{
  "vs/common/random/module": {
    "some.random.translation.key": "The actual wording",
    "some.other.translation.key": "The other wording"
  }
}

is replaced by

{
  "vs/common/random/module": [
    "The actual wording",
    "The other wording"
  ]
}

and in the modules:

localizeWithPath(moduleId,  "some.random.translation.key", "The default wording")

is replaced by

localizeWithPath(moduleId,  0,  "The default wording")

This PR:

Note that the localization keys can't be minified and neither be compressed very well (each key is different) so the final compressed size ratio should be even bigger

github-actions[bot] commented 5 months ago

:tada: This PR is included in version 4.5.2 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: