Skip to content

Conversation

@Maria-Cordero-ibm
Copy link
Contributor

@Maria-Cordero-ibm Maria-Cordero-ibm commented Sep 9, 2020

Issue: English string occurs in Overview -> Reports -> Reports -> Configuration -> Add a new report -> Summary

Links

Steps for Testing/QA

  1. Change language in settings
  2. Click Overview -> Reports
  3. Click Reports
  4. Click Configuration Management -> Virtual Machines -> Account Groups - Linux
  5. Click Configuration
  6. Click Add a new report
  7. Click Availiable Fields and select at one item
  8. Click icon
  9. Click Formatting
  10. Click Summary
  11. Select Descending at Sort Order
  12. Select Yes at Show Sort Breaks

Original Issue

English string occured
error

Result

Screen Shot 2020-09-09 at 2 28 53 PM

- 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),
Copy link
Contributor

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.

Copy link
Contributor Author

@Maria-Cordero-ibm Maria-Cordero-ibm Sep 10, 2020

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.

Copy link
Member

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@h-kataria h-kataria self-assigned this Sep 9, 2020
@Maria-Cordero-ibm Maria-Cordero-ibm changed the title Issue #8670 - Calculations dropdown now translates properly Added gettext calls to MiqReport::GROUPINGS for options select Sep 11, 2020
Copy link
Member

@skateman skateman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Seal of Approval

@miq-bot
Copy link
Member

miq-bot commented Sep 11, 2020

Checked commit Maria-Cordero-ibm@bbb5cb8 with ruby 2.6.3, rubocop 0.69.0, haml-lint 0.28.0, and yamllint
1 file checked, 1 offense detected

**

  • 💣 💥 🔥 🚒 - Linter/Haml - Linter::Haml STDERR:
warning: parser/current is loading parser/ruby26, which recognizes
warning: 2.6.6-compliant syntax, but you are running 2.6.3.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.

@h-kataria h-kataria merged commit 133eb7e into ManageIQ:master Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants