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

Mark Strings in Request Details for Translation #22506

Merged

Conversation

DavidResende0
Copy link
Member

Related to: ManageIQ/manageiq-ui-classic#8788

Marks strings for translation in the Request Details page. Most of these strings used to be marked prior to the recent form conversion.

@@ -25,7 +25,7 @@ def self.get_description(req)
msg << build_message(options, :network_adapter_edit, "Edit Network Adapters: %d", :length)
msg << build_message(options, :cdrom_connect, "Attach CD/DVDs: %d", :length)
msg << build_message(options, :cdrom_disconnect, "Detach CD/DVDs: %d", :length)
"#{request_class::TASK_DESCRIPTION} for: #{resource_name(req)} - #{msg.compact.join(", ")}"
N_("#{request_class::TASK_DESCRIPTION} for: #{resource_name(req)} - #{msg.compact.join(", ")}")
Copy link
Member

Choose a reason for hiding this comment

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

This one is a bit more complicated, but it's a similar pattern - you can build up the list of messages and each one should be translated before interpolating it in.

@DavidResende0 DavidResende0 force-pushed the request-summary-translation-fix branch from fa494df to b7b77dd Compare July 26, 2023 21:11
Comment on lines 59 to 63
N_("Provisioning Service [#{rsc_name}] for Service [#{svc_target_name}]")
when MiqProvisionRequestTemplate
"Provisioning VM [#{rsc_name}] for Service [#{svc_target_name}]"
N_("Provisioning VM [#{rsc_name}] for Service [#{svc_target_name}]")
else
"Provisioning [#{rsc_name}] for Service [#{svc_target_name}]"
N_("Provisioning [#{rsc_name}] for Service [#{svc_target_name}]")
Copy link
Member

Choose a reason for hiding this comment

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

These all need to be changed similar to how it was done on line 43.

@Fryguy
Copy link
Member

Fryguy commented Jul 31, 2023

Can you verify that the definition of each request_class::TASK_DESCRIPTION is defined as N_()? I'd check but I'm not sure which classes can be request_class.

@DavidResende0 DavidResende0 force-pushed the request-summary-translation-fix branch from b7b77dd to 54349bf Compare July 31, 2023 21:02
@miq-bot miq-bot added the stale label Nov 6, 2023
@miq-bot
Copy link
Member

miq-bot commented Nov 6, 2023

This pull request has been automatically marked as stale because it has not been updated for at least 3 months.

If these changes are still valid, please remove the stale label, make any changes requested by reviewers (if any), and ensure that this issue is being looked at by the assigned/reviewer(s)

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

@Fryguy Fryguy removed the stale label Nov 6, 2023
@Fryguy
Copy link
Member

Fryguy commented Nov 6, 2023

@DavidResende0 I think I was waiting on a response to this:

Can you verify that the definition of each request_class::TASK_DESCRIPTION is defined as N_()? I'd check but I'm not sure which classes can be request_class.

I did a quick grep and it doesn't look like any of them are defined as N_, which is what i'm concerned about, but I'm not sure these are all of the request types:

app/models/automation_request.rb:4:  TASK_DESCRIPTION  = 'Automation Request'
app/models/miq_provision_configured_system_request.rb:2:  TASK_DESCRIPTION  = 'Configured System Provisioning'
app/models/miq_provision_request.rb:9:  TASK_DESCRIPTION  = 'VM Provisioning'
app/models/orchestration_stack_retire_request.rb:2:  TASK_DESCRIPTION  = 'OrchestrationStack Retire'.freeze
app/models/physical_server_firmware_update_request.rb:2:  TASK_DESCRIPTION  = 'Physical Server Firmware Update'.freeze
app/models/physical_server_provision_request.rb:2:  TASK_DESCRIPTION  = 'Physical Server Provisioning'.freeze
app/models/service_reconfigure_request.rb:2:  TASK_DESCRIPTION  = 'Service Reconfigure'
app/models/service_retire_request.rb:2:  TASK_DESCRIPTION  = 'Service Retire'.freeze
app/models/service_template_provision_request.rb:2:  TASK_DESCRIPTION  = 'Service_Template_Provisioning'
app/models/vm_cloud_reconfigure_request.rb:2:  TASK_DESCRIPTION  = 'VM Cloud Reconfigure'.freeze
app/models/vm_migrate_request.rb:2:  TASK_DESCRIPTION  = 'VM Migrate'
app/models/vm_reconfigure_request.rb:2:  TASK_DESCRIPTION  = 'VM Reconfigure'
app/models/vm_retire_request.rb:2:  TASK_DESCRIPTION  = 'VM Retire'.freeze

@DavidResende0
Copy link
Member Author

@DavidResende0 I think I was waiting on a response to this:

Can you verify that the definition of each request_class::TASK_DESCRIPTION is defined as N_()? I'd check but I'm not sure which classes can be request_class.

I did a quick grep and it doesn't look like any of them are defined as N_, which is what i'm concerned about, but I'm not sure these are all of the request types:

app/models/automation_request.rb:4:  TASK_DESCRIPTION  = 'Automation Request'
app/models/miq_provision_configured_system_request.rb:2:  TASK_DESCRIPTION  = 'Configured System Provisioning'
app/models/miq_provision_request.rb:9:  TASK_DESCRIPTION  = 'VM Provisioning'
app/models/orchestration_stack_retire_request.rb:2:  TASK_DESCRIPTION  = 'OrchestrationStack Retire'.freeze
app/models/physical_server_firmware_update_request.rb:2:  TASK_DESCRIPTION  = 'Physical Server Firmware Update'.freeze
app/models/physical_server_provision_request.rb:2:  TASK_DESCRIPTION  = 'Physical Server Provisioning'.freeze
app/models/service_reconfigure_request.rb:2:  TASK_DESCRIPTION  = 'Service Reconfigure'
app/models/service_retire_request.rb:2:  TASK_DESCRIPTION  = 'Service Retire'.freeze
app/models/service_template_provision_request.rb:2:  TASK_DESCRIPTION  = 'Service_Template_Provisioning'
app/models/vm_cloud_reconfigure_request.rb:2:  TASK_DESCRIPTION  = 'VM Cloud Reconfigure'.freeze
app/models/vm_migrate_request.rb:2:  TASK_DESCRIPTION  = 'VM Migrate'
app/models/vm_reconfigure_request.rb:2:  TASK_DESCRIPTION  = 'VM Reconfigure'
app/models/vm_retire_request.rb:2:  TASK_DESCRIPTION  = 'VM Retire'.freeze

I'll look into it and see if I can find them all

@miq-bot
Copy link
Member

miq-bot commented Nov 8, 2023

Checked commit DavidResende0@7ace1d5 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint
16 files checked, 0 offenses detected
Everything looks fine. 🏆

@Fryguy Fryguy merged commit 7b5ac62 into ManageIQ:master Nov 8, 2023
6 checks passed
@Fryguy
Copy link
Member

Fryguy commented Nov 15, 2023

Backported to quinteros in commit 5f7ba25.

commit 5f7ba252b621b6278d889462afb0f731c73248a5
Author: Jason Frey <[email protected]>
Date:   Wed Nov 8 17:00:05 2023 -0500

    Merge pull request #22506 from DavidResende0/request-summary-translation-fix
    
    Mark Strings in Request Details for Translation
    
    (cherry picked from commit 7b5ac629c859cdd2060d5266614301692c7d45de)

Fryguy added a commit that referenced this pull request Nov 15, 2023
…ion-fix

Mark Strings in Request Details for Translation

(cherry picked from commit 7b5ac62)
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.

4 participants