-
Notifications
You must be signed in to change notification settings - Fork 186
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
simplify temporary language settings #676
Conversation
Are you sure the current behaviour isn't resetting env?
Tested on R 4.0.3 @ Windows 10. Also, if we do make a helper, we should use it in all places (I remember |
This might be a platform-dependent thing (I'm on Linux Mint ~ Ubuntu):
|
Okay then we should fix it in all places. Thanks for pointing it out! |
#670 causes spurious lints here. I'll whip up a quick fix PR. |
For |
Using internal functions in tests seems okay to me. |
OK done |
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.
LGTM
Originally wrote this because I noticed another place where we relied on English locale:
https://github.com/jimhester/lintr/blob/9104a004d50c66d3d77cc4e0d4a2c83067f8b43a/R/get_source_expressions.R#L89
But that's covered by #663 already.
Anyway, I think this approach looks nicer. Considered an approach like
with_lang("en", {...})
but the expressions within{...}
would be huge, don't think it would actually be better.Also note that before, we weren't actually restoring
LANGUAGE
in the event that it was currently unset, e.g.