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

Allow translations for Login as Customer button #32392

Open
wants to merge 4 commits into
base: 2.4-develop
Choose a base branch
from

Conversation

jbrada
Copy link
Member

@jbrada jbrada commented Mar 6, 2021

Description (*)

The Login As Customer module adds a button to the customer edit page in the Admin panel.

The text "Login as Customer" can not be translated even though it is defined as "translatable" in the module's di.xml. Therefore it does not display well in other language versions.

This pull request fixes this behaviour and makes translation of the button possible.

image

Manual testing scenarios (*)

  1. Switch admin's user account to a different language (e.g. cs_CZ)
  2. Add translation to the Login as Customer string.
  3. The button is translated

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Allow translations for Login as Customer button #32972: Allow translations for Login as Customer button

@m2-assistant
Copy link

m2-assistant bot commented Mar 6, 2021

Hi @jbrada. Thank you for your contribution
Here are some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@mrtuvn
Copy link
Contributor

mrtuvn commented Mar 8, 2021

Imho i think you can add new csv file translate to this module (folder i18n)
Possible coverage change with automatic tests

@gabrieldagama gabrieldagama added the Priority: P2 A defect with this priority could have functionality issues which are not to expectations. label Apr 29, 2021
@aleron75
Copy link
Contributor

aleron75 commented May 7, 2021

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@Den4ik
Copy link
Contributor

Den4ik commented May 7, 2021

@magento create issue

@Den4ik Den4ik requested review from Den4ik and ihorvansach and removed request for Den4ik May 7, 2021 20:56
@Den4ik Den4ik self-assigned this May 7, 2021
@Den4ik Den4ik removed the request for review from ihorvansach May 7, 2021 20:57
@Den4ik
Copy link
Contributor

Den4ik commented May 10, 2021

@magento run WebAPI Tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

Copy link
Contributor

@Den4ik Den4ik left a comment

Choose a reason for hiding this comment

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

✔️ Approved

@engcom-Charlie
Copy link
Contributor

✔️ QA Passed

Preconditions:

  1. Magento 2.4

Manual testing scenario:

  1. Set Admin user account to France from Interface Locale
  2. Added fr_FR.csv file in customer module with translated text for Login as Customer string
  3. Go to Customer edit page

Actual Result: ✔️

  1. Login as Customer button is translated.

After: ✔️

image

Before: ✖️

image

Tested all the manual scenarios, no impact on regression testing.

Copy link
Contributor

@sidolov sidolov left a comment

Choose a reason for hiding this comment

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

Please, cover changes with automated tests

/**
* Translatable element name
*/
const LABEL_KEY = 'label';
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, add an explicit visibility modifier. Const should be private

@engcom-Charlie
Copy link
Contributor

Hi @jbrada

Thank you for your contribution.

I will check the review comments and do the needful.

Thank you!

@engcom-Charlie
Copy link
Contributor

engcom-Charlie commented Oct 18, 2021

Hi @jbrada, @Den4ik

Thank you for your contribution.

@sidolov, I have worked on the review comments.

Added appropriate visibility modifier and created new MFTF test case for automation.

Requesting for the review again so moving it to the Pending Review.

Thank you!

@engcom-Charlie
Copy link
Contributor

@magento run all tests

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests Award: bug fix Award: category of expertise Award: complex Component: LoginAsCustomerAdminUi Partner: Magexo partners-contribution Pull Request is created by Magento Partner Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: pending review Release Line: 2.4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] Allow translations for Login as Customer button
10 participants