Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add localization to debugger components #6064

Merged
merged 4 commits into from
Aug 9, 2023
Merged

Conversation

WardenGnaw
Copy link
Contributor

@WardenGnaw WardenGnaw commented Aug 8, 2023

This PR adds in localization via vscode.l10n.t(...) calls to the strings
used in the debugger components of vscode-csharp.

This also moves the tests that now call vscode.l10n.t to be integration tests.
Also refactored DotnetInfo to its own file to avoid pulling in vscode for unit tests.

This PR adds in localization via vscode.l10n.t(...) calls to the strings
used in the debugger components of vscode-csharp.
@WardenGnaw WardenGnaw self-assigned this Aug 8, 2023
@WardenGnaw WardenGnaw requested a review from a team as a code owner August 8, 2023 00:36
@WardenGnaw
Copy link
Contributor Author

Whats the best way to localize this block?

WARNING01: '*********************************************************************************',
WARNING02: 'The C# extension was unable to automatically decode projects in the current',
WARNING03: 'workspace to create a runnable launch.json file. A template launch.json file has',
WARNING04: 'been created as a placeholder.',
WARNING05: '',
WARNING06: 'If the server is currently unable to load your project, you can attempt to resolve',
WARNING07: "this by restoring any missing project dependencies (example: run 'dotnet restore')",
WARNING08: 'and by fixing any reported errors from building the projects in your workspace.',
WARNING09: 'If this allows the server to now load your project then --',
WARNING10: ' * Delete this file',
WARNING11: ' * Open the Visual Studio Code command palette (View->Command Palette)',
WARNING12: " * run the command: '.NET: Generate Assets for Build and Debug'.",
WARNING13: '',
WARNING14: 'If your project requires a more complex launch configuration, you may wish to delete',
WARNING15: "this configuration and pick a different template using the 'Add Configuration...'",
WARNING16: 'button at the bottom of this file.',
WARNING17: '*********************************************************************************',

@gregg-miskelly
Copy link
Contributor

Whats the best way to localize this block?

WARNING01: '*********************************************************************************',
WARNING02: 'The C# extension was unable to automatically decode projects in the current',
WARNING03: 'workspace to create a runnable launch.json file. A template launch.json file has',
WARNING04: 'been created as a placeholder.',
WARNING05: '',
WARNING06: 'If the server is currently unable to load your project, you can attempt to resolve',
WARNING07: "this by restoring any missing project dependencies (example: run 'dotnet restore')",
WARNING08: 'and by fixing any reported errors from building the projects in your workspace.',
WARNING09: 'If this allows the server to now load your project then --',
WARNING10: ' * Delete this file',
WARNING11: ' * Open the Visual Studio Code command palette (View->Command Palette)',
WARNING12: " * run the command: '.NET: Generate Assets for Build and Debug'.",
WARNING13: '',
WARNING14: 'If your project requires a more complex launch configuration, you may wish to delete',
WARNING15: "this configuration and pick a different template using the 'Add Configuration...'",
WARNING16: 'button at the bottom of this file.',
WARNING17: '*********************************************************************************',

My thought:

  • Turn the text into three or four localizable strings (ex: 'The C# extension was unable to automatically decode projects in the current workspace to create a runnable launch.json file. A template launch.json file has been created as a placeholder....') -- one per paragraph, and maybe one for each list item, and probably one for the word "WARNING".
  • Find and/or implement a simple word wrap algorithm.
  • Turn the text into the comment.

Copy link
Contributor

@gregg-miskelly gregg-miskelly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

@WardenGnaw
Copy link
Contributor Author

Whats the best way to localize this block?

WARNING01: '*********************************************************************************',
WARNING02: 'The C# extension was unable to automatically decode projects in the current',
WARNING03: 'workspace to create a runnable launch.json file. A template launch.json file has',
WARNING04: 'been created as a placeholder.',
WARNING05: '',
WARNING06: 'If the server is currently unable to load your project, you can attempt to resolve',
WARNING07: "this by restoring any missing project dependencies (example: run 'dotnet restore')",
WARNING08: 'and by fixing any reported errors from building the projects in your workspace.',
WARNING09: 'If this allows the server to now load your project then --',
WARNING10: ' * Delete this file',
WARNING11: ' * Open the Visual Studio Code command palette (View->Command Palette)',
WARNING12: " * run the command: '.NET: Generate Assets for Build and Debug'.",
WARNING13: '',
WARNING14: 'If your project requires a more complex launch configuration, you may wish to delete',
WARNING15: "this configuration and pick a different template using the 'Add Configuration...'",
WARNING16: 'button at the bottom of this file.',
WARNING17: '*********************************************************************************',

My thought:

  • Turn the text into three or four localizable strings (ex: 'The C# extension was unable to automatically decode projects in the current workspace to create a runnable launch.json file. A template launch.json file has been created as a placeholder....') -- one per paragraph, and maybe one for each list item, and probably one for the word "WARNING".
  • Find and/or implement a simple word wrap algorithm.
  • Turn the text into the comment.

Heres an example of the wordWrapString method.
image

@WardenGnaw WardenGnaw merged commit 0614ce4 into main Aug 9, 2023
4 checks passed
@WardenGnaw WardenGnaw deleted the dev/waan/addDebuggerLoc branch August 9, 2023 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants