Skip to content
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

Delayed translation of ui constants #9086

Merged

Conversation

mzazrivec
Copy link
Contributor

@mzazrivec mzazrivec commented Jun 1, 2016

Changes:

  • Modify PostponedTranslation to receive block as an argument. This change is to make sure
    the block given is evaluated at the same moment when we're calling .call() or .translate(),
    not when we're constructing the object.
  • Use delayed translations for UI constants. These constants are loaded at application startup and
    therefore need to be translated when the constants are being used.

Not all constants have been addressed, the rest will be addressed in a later PR.

https://bugzilla.redhat.com/show_bug.cgi?id=1340437
https://bugzilla.redhat.com/show_bug.cgi?id=1340426
https://bugzilla.redhat.com/show_bug.cgi?id=1275614
https://bugzilla.redhat.com/show_bug.cgi?id=1233072

@chessbyte
Copy link
Member

/cc @h-kataria

@mzazrivec mzazrivec force-pushed the delayed_translation_of_ui_constants branch 2 times, most recently from 812ae86 to 8292cf9 Compare June 2, 2016 08:15
This change is to make sure the block given is evaluated
at the same moment when we're calling .call() or .translate(),
not when we're constructing the object.
@mzazrivec mzazrivec force-pushed the delayed_translation_of_ui_constants branch from 8292cf9 to 5326cdf Compare June 2, 2016 08:16
These constants are loaded at application startup and therefore
need to be translated when the constants are being used.
@mzazrivec mzazrivec force-pushed the delayed_translation_of_ui_constants branch from 5326cdf to 91be50d Compare June 2, 2016 08:25
@miq-bot
Copy link
Member

miq-bot commented Jun 2, 2016

Checked commits mzazrivec/manageiq@c67cddf~...91be50d with ruby 2.2.4, rubocop 0.37.2, and haml-lint 0.16.1
20 files checked, 5 offenses detected

app/controllers/ops_controller/settings/analysis_profiles.rb

app/views/chargeback/_cb_assignments.html.haml

  • 🔴 Warn - Line 12, Col - - Unused block argument - k. You can omit all the arguments if you don't care about them.
  • 🔴 Warn - Line 12, Col - - Unused block argument - v. You can omit all the arguments if you don't care about them.

app/views/miq_policy/_alert_profile_assign.html.haml

  • 🔴 Warn - Line 17, Col - - Line is too long. [199/160]

spec/lib/postponed_translation_spec.rb

  • 🔴 Warn - Line 12, Col 12 - Lint/BlockAlignment - end at 12, 11 is not aligned with pt = PostponedTranslation.new("Test %{bar}") do at 10, 6.

@martinpovolny
Copy link

This should go to Darga, after a detailed review.

@mzazrivec
Copy link
Contributor Author

@martinpovolny Review please?

@martinpovolny martinpovolny merged commit e04182e into ManageIQ:master Jun 16, 2016
@martinpovolny martinpovolny added this to the Sprint 42 Ending June 20, 2016 milestone Jun 16, 2016
@martinpovolny
Copy link

Needs to be backported together with #9268

@mzazrivec mzazrivec deleted the delayed_translation_of_ui_constants branch June 27, 2016 15:57
chessbyte pushed a commit that referenced this pull request Jul 6, 2016
…stants

Delayed translation of ui constants
(cherry picked from commit e04182e)
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.

None yet

4 participants