aws / aws-toolkit-vscode

Amazon Q, CodeCatalyst, Local Lambda debug, SAM/CFN syntax, ECS Terminal, AWS resources
https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.amazon-q-vscode
Apache License 2.0
1.45k stars 381 forks source link

localization: "Message ... didn't get externalized correctly" #1774

Open justinmk3 opened 3 years ago

justinmk3 commented 3 years ago

Problem

vscode extension host sometimes reports warnings of the form:

Message ... didn't get externalized correctly.

Solution?

Haven't confirmed, but based on https://github.com/microsoft/vscode/issues/42426 / https://github.com/microsoft/vscode-node-debug/commit/4d9a3a70fb776e05df218849a68cdfd2645d4ed0 we may need to do:

  1. call nls.loadMessageBundle() directly in modules instead of using src/shared/utilities/vsCodeUtils.ts:localize()
  2. remove src/shared/utilities/vsCodeUtils.ts:localize()
JadenSimon commented 3 years ago

call nls.loadMessageBundle() directly in modules instead

Yup this is a requirement for NLS. Indirect calls would result in the consuming module looking for a localization file named after the imported module/file. But the localize calls would still be extracted using the current module name, so the module never finds anything.