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

Localize binaryparagraph.cpp and sourceparagraph.cpp #631

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
575fe0e
WIP
JavierMatosD Jul 11, 2022
bef0248
WIP
JavierMatosD Jul 12, 2022
f4f2cee
Adding messages
JavierMatosD Jul 12, 2022
d840466
WIP: Added message
JavierMatosD Jul 12, 2022
dd2786e
WIP
JavierMatosD Jul 12, 2022
d85eafb
Moved messages to messages.h/cpp
JavierMatosD Jul 12, 2022
9400523
Sorted Messages
JavierMatosD Jul 12, 2022
7829c56
WIP: Add msg
JavierMatosD Jul 12, 2022
102f2ec
Localizing messages
JavierMatosD Jul 12, 2022
38cd9e7
Localizing messages in sourceparagraph.cpp
JavierMatosD Jul 12, 2022
feb7dde
Merge branch 'main' into localization_vcpkgcmdarguments
JavierMatosD Jul 14, 2022
ad461a2
Merge branch 'main' into localization_continued
JavierMatosD Jul 14, 2022
9e3ce1e
LM
JavierMatosD Jul 14, 2022
db70510
Formatting change
JavierMatosD Jul 14, 2022
85f6db3
Split large message in binaryparagraph.cpp
JavierMatosD Jul 15, 2022
642aaee
All messages are localized.
JavierMatosD Jul 15, 2022
258292b
Sorted Messages
JavierMatosD Jul 15, 2022
6e69b6e
WIP
JavierMatosD Jul 15, 2022
1265b0c
UndeterminedToolChainForTriplet
JavierMatosD Jul 15, 2022
57a045a
return_code lambda
JavierMatosD Jul 15, 2022
462127b
FailedToFindDependencyAbi
JavierMatosD Jul 15, 2022
f84aec4
InvalidCrtILinkage
JavierMatosD Jul 15, 2022
ae5e896
Rename: InvalidCrtLinkage -> InvalidLinkage
JavierMatosD Jul 15, 2022
805920b
InvalidLinkage re-use
JavierMatosD Jul 15, 2022
da5170a
UnknownPolicySetting
JavierMatosD Jul 15, 2022
6bcc262
InvalidBuildInfo
JavierMatosD Jul 15, 2022
f130f2d
UnknownSettingForBuildType
JavierMatosD Jul 15, 2022
b578ecc
Sort
JavierMatosD Jul 15, 2022
0f639b3
Update: FailedToFindDependencyAbi
JavierMatosD Jul 15, 2022
d8ba3db
Update: IncorrectNumberOfArgs
JavierMatosD Jul 15, 2022
9190e0d
Update:SpecifiedFeatureTurnedOff
JavierMatosD Jul 15, 2022
9fc4655
Edit: ConflictingValuesForOption
JavierMatosD Jul 15, 2022
f0fb958
PR feedback
JavierMatosD Jul 15, 2022
3d7b751
WIP
JavierMatosD Jul 15, 2022
dbb507d
update clang format
JavierMatosD Jul 15, 2022
4d3d4ee
Fix format
JavierMatosD Jul 15, 2022
b8a0624
Fix paths
JavierMatosD Jul 15, 2022
93d96bc
Fix paths
JavierMatosD Jul 15, 2022
cc597cf
Fix paths
JavierMatosD Jul 15, 2022
3beb0c7
Split BinaryParagraphDescription to avoid re-useing replacement varia…
JavierMatosD Jul 16, 2022
9abcac5
Sorted messages
JavierMatosD Jul 16, 2022
1c96ade
Revert CMakeSettings.json
JavierMatosD Jul 18, 2022
5791d4a
Revert CMakeSettings
JavierMatosD Jul 18, 2022
bc747d6
Revert CMakeSettings
JavierMatosD Jul 18, 2022
78019b6
Response to PR feedback
JavierMatosD Jul 18, 2022
071d8d7
Merge branch 'main' into localization_vcpkgcmdarguments
JavierMatosD Jul 18, 2022
b1498f2
Merge branch 'main' into localization_vcpkgcmdarguments
JavierMatosD Jul 18, 2022
36847bf
Merge branch 'main' into localization_vcpkgcmdarguments
JavierMatosD Jul 19, 2022
dcc61b4
Removed BinParagraph messages
JavierMatosD Jul 19, 2022
27812b2
Response to feedback
JavierMatosD Jul 19, 2022
de5967b
Merge branch 'main' into localization_binaryparagraph.cpp_and_sourcep…
JavierMatosD Jul 19, 2022
f61cc7d
resolve merge conflicts
JavierMatosD Jul 19, 2022
4a7ea97
Grammer fix + ensure environment variable goes through its formatter
JavierMatosD Jul 19, 2022
2512707
grammer fixes
JavierMatosD Jul 19, 2022
aea2345
Removed the format_env_variable for consistency
JavierMatosD Jul 19, 2022
e74d2dd
added -- to all options and scanned for command_name replacements tha…
JavierMatosD Jul 19, 2022
482d571
Update src/vcpkg/sourceparagraph.cpp
JavierMatosD Jul 19, 2022
3c6b6bd
Update src/vcpkg/sourceparagraph.cpp
JavierMatosD Jul 19, 2022
6afcd01
Update src/vcpkg/sourceparagraph.cpp
JavierMatosD Jul 19, 2022
177985f
Update src/vcpkg/build.cpp
JavierMatosD Jul 19, 2022
781eed3
update json
JavierMatosD Jul 20, 2022
9e83a72
Merge branch 'main' into localization_vcpkgcmdarguments
JavierMatosD Jul 21, 2022
3c3bbbd
Merge branch 'localization_vcpkgcmdarguments' into localize_build.cpp
JavierMatosD Jul 21, 2022
6ca19a5
Merge branch 'localize_build.cpp' into localization_binaryparagraph.c…
JavierMatosD Jul 21, 2022
10d7c5c
Feedback
JavierMatosD Jul 21, 2022
73f0919
Merge branch 'main' into localization_binaryparagraph.cpp_and_sourcep…
JavierMatosD Jul 21, 2022
27de5c3
wip
JavierMatosD Jul 21, 2022
9fe5448
wip
JavierMatosD Jul 21, 2022
efa5f3f
Merge branch 'main' into localization_binaryparagraph.cpp_and_sourcep…
JavierMatosD Jul 21, 2022
2dd2576
sort
JavierMatosD Jul 21, 2022
805643c
Update src/vcpkg/binaryparagraph.cpp
JavierMatosD Jul 21, 2022
53c2afb
Update src/vcpkg/binaryparagraph.cpp
JavierMatosD Jul 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 31 additions & 2 deletions include/vcpkg/base/messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,8 @@ namespace vcpkg
(msg::value),
"'{value}' is a command line option.",
"'--{value}' specified multiple times.");
DECLARE_MESSAGE(EmptyArg, (msg::option), "", "The option --{option} must be passed a non-empty argument.");
DECLARE_MESSAGE(EmailVcpkgTeam, (msg::url), "", "Send an email to {url} with any feedback.");
DECLARE_MESSAGE(EmptyArg, (msg::option), "", "The option --{option} must be passed a non-empty argument.");
DECLARE_MESSAGE(EmptyLicenseExpression, (), "", "SPDX license expression was empty.");
DECLARE_MESSAGE(EnvStrFailedToExtract, (), "", "could not expand the environment string:");
DECLARE_MESSAGE(ErrorDetectingCompilerInfo,
Expand Down Expand Up @@ -751,6 +751,7 @@ namespace vcpkg
DECLARE_MESSAGE(ErrorNoVSInstanceAt, (msg::path), "", "at \"{path}\"");
DECLARE_MESSAGE(ErrorNoVSInstanceFullVersion, (msg::version), "", "with toolset version prefix {version}");
DECLARE_MESSAGE(ErrorNoVSInstanceVersion, (msg::version), "", "with toolset version {version}");
DECLARE_MESSAGE(ErrorParsingBinaryParagraph, (msg::spec), "", "while parsing the Binary Paragraph for {spec}");
DECLARE_MESSAGE(ErrorRequireBaseline,
(),
"",
Expand All @@ -777,6 +778,7 @@ namespace vcpkg
"",
"Visual Studio Code was not found and the environment variable {env_var} is not set or invalid.");
DECLARE_MESSAGE(ErrorVsCodeNotFoundPathExamined, (), "", "The following paths were examined:");
DECLARE_MESSAGE(ErrorWhileParsing, (msg::path), "", "Errors occurred while parsing {path}.");
DECLARE_MESSAGE(ErrorWhileWriting, (msg::path), "", "Error occured while writing {path}");
DECLARE_MESSAGE(ExcludedPackage, (msg::spec), "", "Excluded {spec}");
DECLARE_MESSAGE(
Expand All @@ -791,8 +793,14 @@ namespace vcpkg
(msg::value),
"'{value}' is a command option.",
"expected value after '{value}'.");
DECLARE_MESSAGE(ExtendedDocumenationAtUrl, (msg::url), "", "Extended documentation available at '{url}'.");
DECLARE_MESSAGE(ExtendedDocumentationAtUrl, (msg::url), "", "Extended documentation available at '{url}'.");
JavierMatosD marked this conversation as resolved.
Show resolved Hide resolved
DECLARE_MESSAGE(FailedToExtract, (msg::path), "", "Failed to extract \"{path}\":");
DECLARE_MESSAGE(FailedToParseBinParagraph,
(msg::error_msg),
"'{error_msg}' is the error message for failing to parse the Binary Paragraph.",
"[sanity check] Failed to parse a serialized binary paragraph.\nPlease open an issue at "
"https://github.com/microsoft/vcpkg, "
"with the following output:\n{error_msg}\nSerialized Binary Paragraph:");
DECLARE_MESSAGE(FailedToParseCMakeConsoleOut,
(),
"",
Expand Down Expand Up @@ -1064,6 +1072,10 @@ namespace vcpkg
(msg::value),
"Example of {value} is 'unknownlicense'",
"Unknown license identifier '{value}'. Known values are listed at https://spdx.org/licenses/");
DECLARE_MESSAGE(ListOfValidFieldsForControlFiles,
(),
"",
"This is the list of valid fields for CONTROL files (case-sensitive):");
DECLARE_MESSAGE(LoadingCommunityTriplet,
(msg::path),
"'-- [COMMUNITY]' at the beginning must be preserved",
Expand All @@ -1087,8 +1099,18 @@ namespace vcpkg
"{value} is a localized message name like LocalizedMessageMustNotEndWithNewline",
"The message named {value} ends with a newline which should be added by formatting "
"rather than by localization.");
DECLARE_MESSAGE(MismatchedBinaryParagraphs,
(msg::url),
"A comparison of the original binary paragraph and serialized binary paragraph is expected.",
"[sanity check] The serialized binary paragraph was different from the original binary "
"paragraph.\nPlease open an issue at {url}, with the following output:");
DECLARE_MESSAGE(Missing7zHeader, (), "", "Unable to find 7z header.");
DECLARE_MESSAGE(MissingExtension, (msg::extension), "", "Missing '{extension}' extension.");
DECLARE_MESSAGE(MissmatchedBinParagraphs,
(),
"",
"The serialized binary paragraph was different from the original binary paragraph. Please open an "
"issue at https://github.com/microsoft/vcpkg with the following output:");
DECLARE_MESSAGE(MonoInstructions,
(),
"",
Expand All @@ -1099,6 +1121,7 @@ namespace vcpkg
(msg::path, msg::exit_code),
"",
"msiexec failed while extracting \"{path}\" with launch or exit code {exit_code} and message:");
DECLARE_MESSAGE(MultiArch, (msg::option), "", "Multi-Arch must be 'same' but was {option}");
DECLARE_MESSAGE(NavigateToNPS, (msg::url), "", "Please navigate to {url} in your preferred browser.");
DECLARE_MESSAGE(NewConfigurationAlreadyExists,
(msg::path),
Expand All @@ -1124,6 +1147,7 @@ namespace vcpkg
(msg::path),
"",
"NuGet package creation succeeded, but no .nupkg was produced. Expected: \"{path}\"");
DECLARE_MESSAGE(OriginalBinParagraphHeader, (), "", "\nOriginal Binary Paragraph");
DECLARE_MESSAGE(PackageFailedtWhileExtracting,
(msg::value, msg::path),
"'{value}' is either a tool name or a package name.",
Expand Down Expand Up @@ -1190,6 +1214,7 @@ namespace vcpkg
"{value} may be either a 'vendor' like 'Azure' or 'NuGet', or a file path like C:\\example or /usr/example",
"Restored {count} package(s) from {value} in {elapsed}. Use --debug to see more details.");
DECLARE_MESSAGE(ResultsHeader, (), "Displayed before a list of installation results.", "RESULTS");
DECLARE_MESSAGE(SerializedBinParagraphHeader, (), "", "\nSerialized Binary Paragraph");
DECLARE_MESSAGE(SettingEnvVar,
(msg::env_var, msg::url),
"An example of env_var is \"HTTP(S)_PROXY\""
Expand Down Expand Up @@ -1226,6 +1251,10 @@ namespace vcpkg
(),
"",
"Please make sure you have started a new bash shell for the change to take effect.");
DECLARE_MESSAGE(SuggestUpdateVcpkg,
(msg::command_line),
"",
"You may need to update the vcpkg binary; try running {command_line} to update.");
DECLARE_MESSAGE(SupportedPort, (msg::package_name), "", "Port {package_name} is supported.");
DECLARE_MESSAGE(SystemApiErrorMessage,
(msg::system_api, msg::exit_code, msg::error_msg),
Expand Down
1 change: 1 addition & 0 deletions include/vcpkg/binaryparagraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ namespace vcpkg
};

void serialize(const BinaryParagraph& pgh, std::string& out_str);
std::string format_binary_paragraph(BinaryParagraph paragraph);
}
12 changes: 11 additions & 1 deletion locales/messages.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,24 @@
"ErrorNoVSInstanceAt": "at \"{path}\"",
"ErrorNoVSInstanceFullVersion": "with toolset version prefix {version}",
"ErrorNoVSInstanceVersion": "with toolset version {version}",
"ErrorParsingBinaryParagraph": "while parsing the Binary Paragraph for {spec}",
"ErrorRequireBaseline": "this vcpkg instance requires a manifest with a specified baseline in order to interact with ports. Please add 'builtin-baseline' to the manifest or add a 'vcpkg-configuration.json' that redefines the default registry.",
"ErrorRequirePackagesList": "`vcpkg install` requires a list of packages to install in classic mode.",
"ErrorUnableToDetectCompilerInfo": "vcpkg was unable to detect the active compiler's information. See above for the CMake failure output.",
"ErrorVcvarsUnsupported": "in triplet {triplet}: Use of Visual Studio's Developer Prompt is unsupported on non-Windows hosts.\nDefine 'VCPKG_CMAKE_SYSTEM_NAME' or 'VCPKG_CHAINLOAD_TOOLCHAIN_FILE' in the triplet file.",
"ErrorVsCodeNotFound": "Visual Studio Code was not found and the environment variable {env_var} is not set or invalid.",
"ErrorVsCodeNotFoundPathExamined": "The following paths were examined:",
"ErrorWhileParsing": "Errors occurred while parsing {path}.",
"ErrorWhileWriting": "Error occured while writing {path}",
"ExcludedPackage": "Excluded {spec}",
"ExpectedCharacterHere": "expected '{expected}' here",
"ExpectedFailOrSkip": "expected 'fail', 'skip', or 'pass' here",
"ExpectedPortName": "expected a port name here",
"ExpectedTripletName": "expected a triplet name here",
"ExpectedValueForOption": "expected value after '{value}'.",
"ExtendedDocumenationAtUrl": "Extended documentation available at '{url}'.",
"ExtendedDocumentationAtUrl": "Extended documentation available at '{url}'.",
"FailedToExtract": "Failed to extract \"{path}\":",
"FailedToParseBinParagraph": "[sanity check] Failed to parse a serialized binary paragraph.\nPlease open an issue at https://github.com/microsoft/vcpkg, with the following output:\n{error_msg}\nSerialized Binary Paragraph:",
"FailedToParseCMakeConsoleOut": "Failed to parse CMake console output to locate block start/end markers.",
"FailedToProvisionCe": "Failed to provision vcpkg-ce.",
"FailedToRunToolToDetermineVersion": "Failed to run \"{path}\" to determine the {tool_name} version.",
Expand Down Expand Up @@ -225,15 +228,19 @@
"LicenseExpressionImbalancedParens": "There was a close parenthesis without an opening parenthesis.",
"LicenseExpressionUnknownException": "Unknown license exception identifier '{value}'. Known values are listed at https://spdx.org/licenses/exceptions-index.html",
"LicenseExpressionUnknownLicense": "Unknown license identifier '{value}'. Known values are listed at https://spdx.org/licenses/",
"ListOfValidFieldsForControlFiles": "This is the list of valid fields for CONTROL files (case-sensitive):",
"LoadingCommunityTriplet": "-- [COMMUNITY] Loading triplet configuration from: {path}",
"LoadingDependencyInformation": "Loading dependency information for {count} packages...",
"LoadingOverlayTriplet": "-- [OVERLAY] Loading triplet configuration from: {path}",
"LocalizedMessageMustNotContainIndents": "The message named {value} contains what appears to be indenting which must be changed to use LocalizedString::append_indent instead.",
"LocalizedMessageMustNotEndWithNewline": "The message named {value} ends with a newline which should be added by formatting rather than by localization.",
"MismatchedBinaryParagraphs": "[sanity check] The serialized binary paragraph was different from the original binary paragraph.\nPlease open an issue at {url}, with the following output:",
"Missing7zHeader": "Unable to find 7z header.",
"MissingExtension": "Missing '{extension}' extension.",
"MissmatchedBinParagraphs": "The serialized binary paragraph was different from the original binary paragraph. Please open an issue at https://github.com/microsoft/vcpkg with the following output:",
"MonoInstructions": "This may be caused by an incomplete mono installation. Full mono is available on some systems via `sudo apt install mono-complete`. Ubuntu 18.04 users may need a newer version of mono, available at https://www.mono-project.com/download/stable/",
"MsiexecFailedToExtract": "msiexec failed while extracting \"{path}\" with launch or exit code {exit_code} and message:",
"MultiArch": "Multi-Arch must be 'same' but was {option}",
"NavigateToNPS": "Please navigate to {url} in your preferred browser.",
"NewConfigurationAlreadyExists": "Creating a manifest would overwrite a vcpkg-configuration.json at {path}.",
"NewManifestAlreadyExists": "A manifest is already present at {path}.",
Expand All @@ -247,6 +254,7 @@
"NoRegistryForPort": "no registry configured for port {package_name}",
"NoteMessage": "note: ",
"NugetPackageFileSucceededButCreationFailed": "NuGet package creation succeeded, but no .nupkg was produced. Expected: \"{path}\"",
"OriginalBinParagraphHeader": "\nOriginal Binary Paragraph",
"PackageFailedtWhileExtracting": "'{value}' failed while extracting {path}.",
"PackageRootDir": "(Experimental) Specify the packages root directory.",
"PackingVendorFailed": "Packing {vendor} failed. Use --debug for more information.",
Expand All @@ -270,6 +278,7 @@
"RestoredPackagesFromVendor": "Restored {count} package(s) from {value} in {elapsed}. Use --debug to see more details.",
"ResultsHeader": "RESULTS",
"SeeURL": "See {url} for more information.",
"SerializedBinParagraphHeader": "\nSerialized Binary Paragraph",
"SettingEnvVar": "-- Setting \"{env_var}\" environment variables to \"{url}\".",
"SourceFieldPortNameMismatch": "The 'Source' field inside the CONTROL file, or \"name\" field inside the vcpkg.json file has the name {package_name} and does not match the port directory \"{path}\".",
"SpecifiedFeatureTurnedOff": "'{command_name}' feature specifically turned off, but --{option} was specified.",
Expand All @@ -279,6 +288,7 @@
"SpecifyTargetArch": "Specify the target architecture triplet. See 'vcpkg help triplet'.\n(default: '{env_var}')",
"StoredBinaryCache": "Stored binary cache: \"{path}\"",
"SuggestStartingBashShell": "Please make sure you have started a new bash shell for the change to take effect.",
"SuggestUpdateVcpkg": "You may need to update the vcpkg binary; try running {command_line} to update.",
"SupportedPort": "Port {package_name} is supported.",
"SystemApiErrorMessage": "calling {system_api} failed with {exit_code} ({error_msg})",
"ToolFetchFailed": "Could not fetch {tool_name}.",
Expand Down
Loading