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

Added Magento_TranslationGraphQl module to support PWA Studio Localization #27600

Conversation

chris-brabender
Copy link

Description (*)

This pull request adds a GraphQL module for the Magento_Translation module. It creates two GraphQL queries to:

  1. Retrieve translated phrases for a supplied locale
  2. Retrieval of available locales configured within Magento

This feature is to support the Localization tasks in the PWA Studio Project - magento/pwa-studio#669

In the PWA Studio project, a Buildpack command extracts phrases from the PWA Project and requests translated phrases from the Magento backend. This effort is to allow PWA Studio to feature localisation and multiple store views. The Available Locales query is used by PWA Studio Buildpack to know what locales it should query for.

Related Pull Requests

PWA Studio work (pending finalisation and review) - https://github.com/magento/pwa-studio/compare/develop...chris-brabender:feature/prototype-v2?expand=1

Manual testing scenarios (*)

Using postman for example, you can provide a GraphQL payload similar to:

{ translate ( locale: "fr_CA" phrases: ["General", "Add to Cart", "Api Keys", "Behavior"] ) { items { original translated } } }

This assumes you have a French language pack installed.

Screen Shot 2020-04-04 at 5 34 01 PM

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)

@m2-assistant
Copy link

m2-assistant bot commented Apr 4, 2020

Hi @chris-brabender. Thank you for your contribution
Here is 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

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

@zetlen
Copy link

zetlen commented Jun 16, 2020

@magento give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @zetlen. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @zetlen, here is your new Magento instance.
Admin access: https://pr-27600.instances.magento-community.engineering/admin_5426
Login: 11392af7 Password: a2af7de9a219
Instance will be terminated in up to 3 hours.

@pmarjan
Copy link
Contributor

pmarjan commented Jun 30, 2020

@magento run all tests

@nrkapoor nrkapoor requested a review from prabhuram93 July 17, 2020 23:10
@maghamed
Copy link
Contributor

We pass store header right now for all requests, and based on this header we might resolver what language should be used for all translatable attributes. Translations might be part of PWA application and all the translations would be built-in while assembling of PWA app.

If we would introduce independent translation endpoint
We would need to resolve translations also independently
Not sure that we want it, at least now.

This PR was not created to Arch repo, so no one from our team had an ability to review it
Thus, I just wanted to make sure that if it would be processed we need broader discussion here.
As it might be quite a crucial point whether we want to decouple translation from store view, or keep as-is
@akaplya @paliarush @zetlen @kokoc

@nrkapoor
Copy link

We pass store header right now for all requests, and based on this header we might resolver what language should be used for all translatable attributes. Translations might be part of PWA application and all the translations would be built-in while assembling of PWA app.

If we would introduce independent translation endpoint
We would need to resolve translations also independently
Not sure that we want it, at least now.

This PR was not created to Arch repo, so no one from our team had an ability to review it
Thus, I just wanted to make sure that if it would be processed we need broader discussion here.
As it might be quite a crucial point whether we want to decouple translation from store view, or keep as-is
@akaplya @paliarush @zetlen @kokoc

@maghamed I will put the PR on hold so we can review the design.

@nrkapoor nrkapoor modified the milestones: 2.4.1, 2.4.2 Aug 15, 2020
@sivaschenko
Copy link
Member

@davemacaulay @nrkapoor Hi guys, can you please suggest the priority/severity for this pull request to correctly facilitate the processing.

@davemacaulay
Copy link
Contributor

@sivaschenko this is no longer needed as we implemented a different solution for i18n in PWA.

@m2-assistant
Copy link

m2-assistant bot commented Apr 15, 2021

Hi @chris-brabender, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

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.

8 participants