-
Notifications
You must be signed in to change notification settings - Fork 141
Add xlat!() where necessary
#1386
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
we don't intend to translate sudoers-related error messages at this point; the existence of this error message is a bit of a kludge: it should end up in the "diagnostic" list we compile in sudoers/mod.rs so visudo can handle it.
2bd30d6 to
8c860a4
Compare
28307ca to
2e8790f
Compare
…lat!` this is a more restricted, subset of what format_args accepts; if in the future we get clippy lints about this, we should be prepared to silence them
bjorn3
reviewed
Dec 15, 2025
bjorn3
reviewed
Dec 15, 2025
bjorn3
reviewed
Dec 15, 2025
bjorn3
reviewed
Dec 15, 2025
bjorn3
reviewed
Dec 15, 2025
bjorn3
reviewed
Dec 15, 2025
bjorn3
reviewed
Dec 15, 2025
Member
Author
|
Note: the visudo |
bjorn3
reviewed
Dec 15, 2025
bjorn3
reviewed
Dec 15, 2025
bjorn3
reviewed
Dec 15, 2025
and accept "y" as a universal affirmative response
bjorn3
approved these changes
Dec 16, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Principle followed: only "ordinary" user-facing messages need to be translated; that is stuff that is helpful or indicates error conditions outside of our or the system administrator's control.
I.e. a parse error in /etc/sudoers does not fall in that category, and neither do runtime errors or other obscure error conditions that indicate an error condition in operating system, etc.
To achieve this, I followed the algorithm:
Displayimpl's for Error types are user facingAnything that goes into
user_error/info/warnis user facing. There might be some false positives here (i.e. things that are really "obscure errors")Looked at strings in the code base that go into an "Error" object,
println,format, and of course anything dealing with the CLI.Looked at al the remaining string literals to see what was missed. 😵💫
I'm pleased to report the
xlat!()mechanism seems to work well.Side-catch: in user-facing strings wherever I saw them I replaced "`" with "'", and tried to make capitalization consistent with the rest of the class.