11import { Command } from "./command.mjs" ;
22import Logger from "../logger.mjs" ;
3- import { window , workspace } from "vscode" ;
3+ import { window , workspace , l10n } from "vscode" ;
44import { configureCmakeNinja } from "../utils/cmakeUtil.mjs" ;
55import Settings , { SettingsKey } from "../settings.mjs" ;
66import { join } from "path" ;
@@ -22,7 +22,7 @@ export default class ConfigureCmakeCommand extends Command {
2222 // check if is a pico project
2323 if ( workspaceFolder === undefined ) {
2424 this . _logger . warn ( "No workspace folder found." ) ;
25- void window . showWarningMessage ( "No workspace folder found." ) ;
25+ void window . showWarningMessage ( l10n . t ( "No workspace folder found." ) ) ;
2626
2727 return ;
2828 }
@@ -34,17 +34,16 @@ export default class ConfigureCmakeCommand extends Command {
3434 settings . getBoolean ( SettingsKey . useCmakeTools )
3535 ) {
3636 void window . showErrorMessage (
37- "You must use the CMake Tools extension to configure your build. " +
38- "To use this extension instead, change the useCmakeTools setting."
37+ l10n . t ( "You must use the CMake Tools extension to configure your build. To use this extension instead, change the useCmakeTools setting." )
3938 ) ;
4039
4140 return ;
4241 }
4342
4443 if ( await configureCmakeNinja ( workspaceFolder . uri ) ) {
45- void window . showInformationMessage ( "CMake has configured your build." ) ;
44+ void window . showInformationMessage ( l10n . t ( "CMake has configured your build." ) ) ;
4645 } else {
47- void window . showWarningMessage ( "CMake failed to configure your build." ) ;
46+ void window . showWarningMessage ( l10n . t ( "CMake failed to configure your build." ) ) ;
4847 }
4948 }
5049}
@@ -63,7 +62,7 @@ export class CleanCMakeCommand extends Command {
6362
6463 if ( workspaceFolder === undefined ) {
6564 this . _logger . warn ( "No workspace folder found." ) ;
66- void window . showWarningMessage ( "No workspace folder found." ) ;
65+ void window . showWarningMessage ( l10n . t ( "No workspace folder found." ) ) ;
6766
6867 return ;
6968 }
@@ -75,8 +74,7 @@ export class CleanCMakeCommand extends Command {
7574 settings . getBoolean ( SettingsKey . useCmakeTools )
7675 ) {
7776 void window . showErrorMessage (
78- "You must use the CMake Tools extension to clean your build. " +
79- "To use this extension instead, change the useCmakeTools setting."
77+ l10n . t ( "You must use the CMake Tools extension to clean your build. To use this extension instead, change the useCmakeTools setting." )
8078 ) ;
8179
8280 return ;
@@ -91,18 +89,18 @@ export class CleanCMakeCommand extends Command {
9189 "Error cleaning build directory." ,
9290 unknownErrorToString ( error )
9391 ) ;
94- void window . showErrorMessage ( "Error cleaning build directory." ) ;
92+ void window . showErrorMessage ( l10n . t ( "Error cleaning build directory." ) ) ;
9593
9694 return ;
9795 }
9896
9997 if ( await configureCmakeNinja ( workspaceFolder . uri ) ) {
10098 void window . showInformationMessage (
101- "CMake has been cleaned and reconfigured."
99+ l10n . t ( "CMake has been cleaned and reconfigured." )
102100 ) ;
103101 } else {
104102 void window . showWarningMessage (
105- "CMake could not be reconfigured. See log for details."
103+ l10n . t ( "CMake could not be reconfigured. See log for details." )
106104 ) ;
107105 }
108106 }
0 commit comments