-
Notifications
You must be signed in to change notification settings - Fork 280
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
[Localization] Monoceros #704
[Localization] Monoceros #704
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I trust you to make these nitpick fixes. Do note the request to implement "MutuallyExclusiveOption" back in Aries
src/vcpkg/remove.cpp
Outdated
@@ -52,7 +51,7 @@ namespace vcpkg::Remove | |||
const auto status = fs.symlink_status(target, ec); | |||
if (ec) | |||
{ | |||
print2(Color::error, "failed: symlink_status(", target, "): ", ec.message(), "\n"); | |||
msg::println_error(msgFailedSymlinkStatus, msg::path = target, msg::error_msg = ec.message()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use the same formatting mechanism as exit_filesystem_call_error (and FailedSymlinkStatus deleted)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto other filesystem operations here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean. Can you elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In files.cpp
there's a function exit_system_call_error
which forms an error message out of the name of the called operation, the parameters, and the actual error returned by the operating system, which notably means no localization is necessary. (It is done by the operating system) This comment is asking to extract that and print that instead rather than making slightly different localized message for each "generic filesystem operation failed" message.
vcpkg-tool/src/vcpkg/base/files.cpp
Lines 76 to 77 in da270f4
auto arguments = args.size() == 0 ? "()" : "(\"" + Strings::join("\", \"", args.begin(), args.end()) + "\")"; | |
Checks::exit_with_message_and_line(li, Strings::concat(call_name, arguments, ": ", ec.message())); |
* improve message clarity * add explanation for InvalidOptionForRemove to avoid confusion amongst translators
* add overload for Checks::unreachable that takes a message * add function format_filesystem_call_error
# Conflicts: # include/vcpkg/base/messages.h # locales/messages.en.json # locales/messages.json # src/vcpkg/base/messages.cpp
src/vcpkg/remove.cpp
Outdated
fs.remove(*b, ec); | ||
if (ec) | ||
{ | ||
msg::write_unlocalized_text_to_stdout(Color::error, ec.message()); | ||
Checks::exit_with_message_and_line(VCPKG_LINE_INFO, | ||
format_filesystem_call_error(ec, __func__, {*b})); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fs.remove(*b, ec);
if (ec)
{
Checks::exit_with_message_and_line(VCPKG_LINE_INFO,
format_filesystem_call_error(ec, __func__, {*b}));
}
should instead be
fs.remove(*b, VCPKG_LINE_INFO);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops looks like the red code didn't terminate here so it should do that.
src/vcpkg/remove.cpp
Outdated
@@ -19,6 +19,15 @@ namespace vcpkg::Remove | |||
|
|||
REGISTER_MESSAGE(RemovingPackage); | |||
|
|||
static LocalizedString format_filesystem_call_error(const std::error_code& ec, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This belongs in files.cpp and exit_filesystem_call_error
should use it too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved with 1 nitpick
Localizes messages in the following files: