Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Start using Intl another attempt #782

Merged
merged 64 commits into from
Jun 26, 2020
Merged

Conversation

przlada
Copy link
Member

@przlada przlada commented Jun 23, 2020

I want to merge this change because... it adds react-intl integration. Basing on the great work of @Wael-Mohamed PR (#731) I made another clean attempt to localize storefront. I fully agree with @krzysztofwolski (#760) to split this task into smaller ones and resolve issues in smaller modules. I propose to go with three steps:

  1. Make strings locale-aware (this PR is an attempt for that)
  2. Add functionality to change storefront language and store configuration
  3. Load localized model data from Django backend

For now, you can only manually change storefront language (still quite useful) by setting it in LocaleProvider. Also for now I only added one additional language (without translation) just for test.

I managed to localize as many strings as I found but some might still be missing. Known things TODO:

  • Localizing AccountMenu and AccountMenuMobile links

Please let me known what do you think about this work and the proposed steps. With your acceptance and guidance, I could try to tackle them.

Screenshots

Pull Request Checklist

  1. All visible strings are translated with proper context.
  2. All data-formatting is locale-aware (dates, numbers, and so on).
  3. The changes are tested.
  4. The code is documented (docstrings, project documentation).
  5. Changes are mentioned in the changelog.

@przlada przlada marked this pull request as ready for review June 24, 2020 21:43
@przlada
Copy link
Member Author

przlada commented Jun 24, 2020

Is everything fine with CircleCI config? This PR fails at both (build, cypress/run) steps with Error: Environment variable API_URI not set error. Locally it builds successfully

@krzysztofwolski
Copy link
Member

@przlada thank you a lot for this PR! It looks great. CircleCI failed because we are not running it for forked repos. I'll run tests myself.

@krzysztofwolski
Copy link
Member

Tests are passing
image

No other issues when running code myself

@dominik-zeglen dominik-zeglen merged commit b296500 into saleor:master Jun 26, 2020
@dominik-zeglen
Copy link
Contributor

👌💥⭐️

@dominik-zeglen
Copy link
Contributor

dominik-zeglen commented Jun 26, 2020

I added transifex resource for this project, so it's now really translatable :)
#785
Oh and I also mentioned you in changelog because I somehow missed that you didn't add yourself there.

@maarcingebala
Copy link
Member

Hey @przlada, thanks a lot for your contribution! If you're willing to help even more, I think next week we should be able to provide more detailed issues with descriptions of what needs to be done. We already have designs of the language switcher which we'd share with you as well. We need to wait for @krzysztofwolski to return from holiday as he's in charge of the project :)

@przlada
Copy link
Member Author

przlada commented Jun 26, 2020

I added transifex resource for this project, so it's now really translatable :)
#785
Oh and I also mentioned you in changelog because I somehow missed that you didn't add yourself there.

That's great, thanks @dominik-zeglen 👍 I added my test Polish translation to Transifex and made PR with it #786

@przlada
Copy link
Member Author

przlada commented Jun 26, 2020

Hey @przlada, thanks a lot for your contribution! If you're willing to help even more, I think next week we should be able to provide more detailed issues with descriptions of what needs to be done. We already have designs of the language switcher which we'd share with you as well. We need to wait for @krzysztofwolski to return from holiday as he's in charge of the project :)

@maarcingebala Yes I'm willing to help 😊 I will patiently wait for @krzysztofwolski. What's the best way to discuss the details? Here on Github or using some different channels?

@krzysztofwolski
Copy link
Member

@przlada I'm back! On Thursday I'll have github issues for you with designs. Personally I'm fan of async communication on GH, but if there will be any questions I'm open for Hangouts call

@krzysztofwolski krzysztofwolski mentioned this pull request Jul 1, 2020
@krzysztofwolski
Copy link
Member

@przlada thanks for patience :) Here is an issue with resources: #798. I suggest to move any questions to that issue. Let me know if you need anything 💪

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants