-
-
Notifications
You must be signed in to change notification settings - Fork 398
Removed unnecessary fmt.*printf
before tr(...)
#1425
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
Merged
Conversation
This file contains 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
per1234
reviewed
Sep 2, 2021
cmaglie
commented
Sep 2, 2021
arduino#1425 (comment) these particular strings are not correctly handled by the i18n package because they are declared at package level before the call to i18n.Init(), and so are just returned as-is.
ae8a7f0
to
c740326
Compare
otherwise the unit-tests will fail: === RUN TestBoardOptions --- FAIL: TestBoardOptions (0.00s) panic: i18n.Tr called before i18n.Init() [recovered] panic: i18n.Tr called before i18n.Init() goroutine 9 [running]: testing.tRunner.func1.2(0xc56e00, 0xeaee20) /opt/hostedtoolcache/go/1.16.7/x64/src/testing/testing.go:1143 +0x332 testing.tRunner.func1(0xc0002a2f00) /opt/hostedtoolcache/go/1.16.7/x64/src/testing/testing.go:1146 +0x4b6 panic(0xc56e00, 0xeaee20) /opt/hostedtoolcache/go/1.16.7/x64/src/runtime/panic.go:965 +0x1b9 github.com/arduino/arduino-cli/i18n.Tr(0xdceacd, 0x28, 0x0, 0x0, 0x0, 0x0, 0x1) /home/runner/work/arduino-cli/arduino-cli/i18n/i18n.go:54 +0xd9 github.com/arduino/arduino-cli/arduino/cores.(*Board).GetBuildProperties(0x13bf060, 0xc0003b6150, 0xc000339400, 0x0, 0x0) /home/runner/work/arduino-cli/arduino-cli/arduino/cores/board.go:109 +0x69d github.com/arduino/arduino-cli/arduino/cores.(*Board).GeneratePropertiesForConfiguration(0x13bf060, 0xdb5f54, 0xe, 0xc000309ef0, 0xc911e0, 0xc0003b6000) /home/runner/work/arduino-cli/arduino-cli/arduino/cores/board.go:141 +0x28f github.com/arduino/arduino-cli/arduino/cores.TestBoardOptions(0xc0002a2f00) /home/runner/work/arduino-cli/arduino-cli/arduino/cores/board_test.go:298 +0x4bd testing.tRunner(0xc0002a2f00, 0xe052a8) /opt/hostedtoolcache/go/1.16.7/x64/src/testing/testing.go:1193 +0xef created by testing.(*T).Run /opt/hostedtoolcache/go/1.16.7/x64/src/testing/testing.go:1238 +0x2b3 FAIL github.com/arduino/arduino-cli/arduino/cores 0.021s === RUN TestIndexParsing --- FAIL: TestIndexParsing (0.00s) panic: i18n.Tr called before i18n.Init() [recovered] panic: i18n.Tr called before i18n.Init()
per1234
requested changes
Sep 6, 2021
silvanocerza
reviewed
Sep 6, 2021
silvanocerza
reviewed
Sep 6, 2021
silvanocerza
reviewed
Sep 6, 2021
silvanocerza
reviewed
Sep 6, 2021
silvanocerza
suggested changes
Sep 6, 2021
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 have some concerns about certain strings when they'll be translated for right to left languages.
per1234
approved these changes
Sep 6, 2021
silvanocerza
approved these changes
Sep 7, 2021
Co-authored-by: per1234 <[email protected]>
5c1e487
to
503457b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Removed some
fmt.Sprintf
sincetr
already provides formatting in printf-style.Simplified some strings.
Added some missing line feed.
Fixed static initialization problem on some strings