Feat/korean lsp docs - #476
Conversation
|
I had a concept for documentation localization a while ago, but never got to finish it due to lack of demand. The approach should rather be to change the "wait": {
"guid": "000000007872",
"description": {
"en-US": "Pauses the execution of the action list. Unless the wait is interrupted, the remainder of the actions will execute after the pause.",
"ko-KR": "동작 목록의 실행을 일시 중지합니다.\n대기가 중단되지 않으면 남은 동작은 대기 시간이 지난 뒤 실행됩니다.",
},
"args": [...],
...,
}You can use Datatool to automatically get all the translations of the descriptions (the guid should NOT be stored, as it would otherwise overwrite manual changes to the descriptions, and the descriptions won't change anyway). Then you can also create The choice of documentation language should be an additional setting in the vs code extension, and should be by default based on the vs code language (so that, if someone compiles for another language for testing purposes, they aren't faced with unreadable documentation). Thanks :) |
|
Thanks, that makes a lot more sense. I agree that localizing the source documentation data directly is cleaner than post-processing the generated Markdown. I'll refactor this PR to: make documentation description fields use LocalizableString Thanks for the detailed direction :) |
c28e441 to
caf81a6
Compare
caf81a6 to
fa41a6a
Compare
|
Thanks for the feedback, I’ve reworked the implementation based on your suggestions. The documentation is now localized directly in the data model using LocalizableString, and I added a separate documentationLanguage setting that defaults to the VS Code locale instead of relying on workshopLanguage. I also updated the DataTool generation logic while preserving the existing Workshop locale data, and added tests for localization and fallback behavior. All core, CLI, and LSP tests are passing now |
Summary
Adds localized editor documentation support to the OverPy language server, following the approach discussed in review.
This keeps Workshop compilation/decompilation locale data separate from the language used for editor documentation.
What changed
descriptionfields to useLocalizableStringsrc/data/opy/documentation.tsfor documentation-specific strings such as:Arguments:Type:Returns:ko-KR) translations for the documentation UI stringsoverpy.documentationLanguagesettingautoautofollows the VS Code / LSP client localeen-USwhen a localized string is unavailableBehavior
The documentation language is independent from
workshopLanguage, so compiling or testing Workshop code in another language does not change the editor documentation language.Existing Workshop locale values are preserved; this PR only changes how documentation strings are represented and selected.
Validation
Validated against the current upstream
masterwith:pnpm run check-typespnpm run lintpnpm run test:corepnpm run test:clipnpm run test:lspThe upstream GitHub Actions workflow also passes successfully.
Thanks for the direction on the localization architecture.