-
Notifications
You must be signed in to change notification settings - Fork 289
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
Delocalize error: warning: and note:. #1260
Delocalize error: warning: and note:. #1260
Conversation
Response to code review comment microsoft#1239 (comment)
include/vcpkg/base/messages.h
Outdated
inline constexpr StringLiteral InternalErrorPrefix = "internal error: "; | ||
inline constexpr StringLiteral NotePrefix = "note: "; | ||
inline constexpr StringLiteral WarningPrefix = "warning: "; | ||
|
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.
LocalizedString error_prefix(); | |
LocalizedString internal_error_prefix(); | |
LocalizedString note_prefix(); | |
LocalizedString warning_prefix(); |
These are used widely enough that I think it improves clarity:
LocalizedString::from_raw(ErrorPrefix).append(msgMyErrorStuff)
to
error_prefix().append(msgMyErrorStuff)
src/vcpkg/base/parse.cpp
Outdated
if (kind == MessageKind::Warning) | ||
{ | ||
res.append(msgWarningMessage); | ||
res.append_raw(WarningPrefix); | ||
} | ||
else | ||
{ | ||
res.append(msgErrorMessage); | ||
res.append_raw(ErrorPrefix); | ||
} |
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.
if (kind == MessageKind::Warning) | |
{ | |
res.append(msgWarningMessage); | |
res.append_raw(WarningPrefix); | |
} | |
else | |
{ | |
res.append(msgErrorMessage); | |
res.append_raw(ErrorPrefix); | |
} | |
res.append_raw(kind == MessageKind::Warning ? WarningPrefix : ErrorPrefix); |
} | ||
|
||
if (!mismatches.arguments_without_comment.empty() || !mismatches.comments_without_argument.empty()) | ||
{ | ||
has_errors = true; | ||
msg::println_error(msgGenerateMsgIncorrectComment, msg::value = msg.name); | ||
msg::print(LocalizedString::from_raw(ErrorPrefix) | ||
.append_raw(fmt::format("message {} has an incorrect comment:\n", msg.name))); | ||
|
||
for (const auto& arg : mismatches.arguments_without_comment) |
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.
Double check these -- the message seems opposite from the member name arguments_without_comment
.
Response to code review comment #1239 (comment)
I spoke with localization team and compiler team and not localizing these are what the compiler does.