Skip to content

Commit

Permalink
Merge pull request #612 from SteveL-MSFT/dsc-i18n
Browse files Browse the repository at this point in the history
Internationalize `dsc` exe
  • Loading branch information
SteveL-MSFT authored Dec 14, 2024
2 parents 7ee6e7a + 12c97aa commit 2c0b681
Show file tree
Hide file tree
Showing 10 changed files with 582 additions and 195 deletions.
264 changes: 258 additions & 6 deletions dsc/Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dsc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dsc_lib = { path = "../dsc_lib" }
indicatif = { version = "0.17" }
jsonschema = { version = "0.26", default-features = false }
path-absolutize = { version = "3.1" }
rust-i18n = { version = "3" }
schemars = { version = "0.8" }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["preserve_order"] }
Expand Down
128 changes: 128 additions & 0 deletions dsc/locales/en-us.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
_version = 1

[args]
about = "Apply configuration or invoke specific DSC resources"
traceFormat = "Trace format to use"
traceLevel = "Trace level to use"
completer = "Generate a shell completion script"
configAbout = "Apply a configuration document"
parameters = "Parameters to pass to the configuration as JSON or YAML"
parametersFile = "Parameters to pass to the configuration as a JSON or YAML file"
systemRoot = "Specify the operating system root path if not targeting the current running OS"
resourceAbout = "Invoke a specific DSC resource"
schemaAbout = "Get the JSON schema for a DSC type"
schemaType = "The type of DSC schema to get"
outputFormat = "The output format to use"
input = "The input document as JSON or YAML to pass to the configuration or resource"
file = "The path to a file used as input to the configuration or resource. Use '-' for the file to read from STDIN."
whatIf = "Run as a what-if operation instead of executing the configuration or resource"
getAbout = "Retrieve the current configuration"
setAbout = "Set the current configuration"
testAbout = "Test the current configuration"
validateAbout = "Validate the current configuration"
exportAbout = "Export the current configuration"
resolveAbout = "Resolve the current configuration"
listAbout = "List or find resources"
adapter = "Adapter filter to limit the resource search"
description = "Description keyword to search for in the resource description"
tags = "Tag to search for in the resource tags"
resourceGet = "Invoke the get operation to a resource"
getAll = "Get all instances of the resource"
resource = "The name of the resource to invoke"

[main]
ctrlCReceived = "Ctrl-C received"
failedCtrlCHandler = "Failed to set Ctrl-C handler"
failedReadingParametersFile = "Failed to read parameters file"
generatingCompleter = "Generating completion script for"
readingParametersFile = "Reading parameters from file"
usingDscVersion = "Running DSC version"
foundProcesses = "Found processes"
failedToGetPid = "Could not get current process id"
currentPid = "Current process id"
failedToGetProcess = "Could not get current process"
terminatingSubprocess ="Terminating subprocesses of process"
terminatingProcess = "Terminating process"
failedTerminatingProcess = "Failed to terminate process"
storeMessage = """DSC.exe is a command-line tool and cannot be run directly from the Windows Store or Explorer.
Visit https://aka.ms/dscv3-docs for more information on how to use DSC.exe.
Press any key to close this window"""

[resolve]
processingInclude = "Processing Include input"
invalidInclude = "Failed to deserialize Include input"
failedToReadFile = "Failed to read file"
failedToOpenFile = "Failed to open included file"
invalidFileContent = "Invalid UTF-8 sequence in included file"
invalidFile = "Failed to read the configuration file as YAML or JSON"
resolvingParameters = "Resolving parameters from file"
failedParseParametersFile = "Failed to parse parameters file to JSON"
failedResolveParametersFile = "Failed to resolve parameters file"
noParametersFile = "No parameters file found"
invalidPath = "Include path must not contain '..'"
failedGetCurrentDirectory = "Failed to get current directory"

[resource_command]
implementedAs = "implemented as"
invalidOperationOnAdapter = "Can not perform this operation on the adapter itself"
adapterNotFound = "Adapter not found"
setInputEmpty = "Desired input is empty"
testInputEmpty = "Expected input is required"

[subcommand]
actualStateNotObject = "actual_state is not an object"
unexpectedTestResult = "Unexpected Group TestResult"
message = "message"
currentDirectory = "current directory"
noParameters = "No parameters specified"
parameters = "Parameters specified"
failedConvertJson = "Failed to convert YAML to JSON"
invalidParamters = "Parameters are not valid JSON or YAML"
invalidPath = "Target path does not exist"
failedSetParameters = "Parameter input failure"
invalidInclude = "Failed to deserialize Include input"
failedSerialize = "Failed to convert validation result to JSON"
invalidConfiguration = "Failed to deserialize configuration"
failedSerializeResolve = "Failed to serialize resolve result"
validatingConfiguration = "Validating configuration against schema"
noResources = "Resources not specified"
resourceTypeNotSpecified = "Resource type not specified"
validatingResource = "Validating resource named"
resourceNotFound = "Resource type not found"
resourceImplementsValidate = "Resource implements validation"
noReason = "No reason provided"
resourceValidationFailed = "Resource failed validation"
resourceDoesNotImplementValidate = "Resource does not implement validation, using schema"
noSchemaOrValidate = "Resource does not have a schema nor supports validation"
noManifest = "Resource does not have a manifest"
tableHeader_type = "Type"
tableHeader_kind = "Kind"
tableHeader_version = "Version"
tableheader_capabilities = "Capabilities"
tableHeader_adapter = "RequireAdapter"
tableHeader_description = "Description"
invalidManifest = "Error in manifest for"

[util]
failedToConvertJsonToString = "Failed to convert JSON to string"
failedToReadTracingSetting = "Could not read 'tracing' setting"
invalidTraceLevel = "Default to 'warn', invalid DSC_TRACE_LEVEL value"
failedToSetTracing = "Unable to set global default tracing subscriber. Tracing is diabled."
validatingSchema = "Validating against schema"
failedToCompileSchema = "JSON Schema Compilation"
validationFailed = "Failed validation"
readingInput = "Reading input from command line parameter"
inputIsFile = "Document provided is a file path, use '--file' instead"
readingInputFromFile = "Reading input from file"
readingInputFromStdin = "Reading input from STDIN"
invalidUtf8 = "Invalid utf-8 input"
failedToReadStdin = "Failed to read input from STDIN"
failedToReadFile = "Failed to read input file"
noInput = "No input provided"
emptyInput = "Empty input provided"
failedToParseInput = "Invalid JSON or YAML"
failedToAbsolutizePath = "Error making config path absolute"
failedToGetParentPath = "Error reading config path parent"
dscConfigRootAlreadySet = "The current value of DSC_CONFIG_ROOT env var will be overridden"
settingDscConfigRoot = "Setting DSC_CONFIG_ROOT env var as"
Loading

0 comments on commit 2c0b681

Please sign in to comment.