-
Notifications
You must be signed in to change notification settings - Fork 366
Added gettext calls to MiqReport::GROUPINGS for options select #7302
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
Added gettext calls to MiqReport::GROUPINGS for options select #7302
Conversation
| - selected = @edit[:new][:col_options][col] && @edit[:new][:col_options][col][:grouping] ? @edit[:new][:col_options][col][:grouping] : [] | ||
| - opts = [[_("Minimum"),"Minimum"],[_("Average"),"Average"], [_("Maximum"), "Maximum"], [_("Total"),"Total"]] | ||
| = select_tag(field_name, | ||
| options_for_select(MiqReport::GROUPINGS.map(&:reverse), selected), |
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.
@Maria-Cordero-ibm i think you could have done something like MiqReport::GROUPINGS.map(&:reverse).map { |key, value| [_(key), value] } to fix this.
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.
That's clever, I changed the solution to this.
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 if this way the data gets indexed properly into the translation DB, maybe we should call the _ where the constant is declared.
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.
We'd probably need N_() in the model class (since it's a constant) and _() 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 updated the core repo to reflect the changes and made a PR #20537.
1d88d5c to
2757495
Compare
2757495 to
bbb5cb8
Compare
skateman
left a 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.
|
Checked commit Maria-Cordero-ibm@bbb5cb8 with ruby 2.6.3, rubocop 0.69.0, haml-lint 0.28.0, and yamllint **
|

Issue: English string occurs in Overview -> Reports -> Reports -> Configuration -> Add a new report -> Summary
Links
Steps for Testing/QA
Original Issue
English string occured

Result