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

(PC-7917) App Native - Amélioration tech - Mise à jour de lingui v2 -> v3 avec traduction au pluriel #845

Merged
merged 1 commit into from
Apr 8, 2021

Conversation

kopax-polyconseil
Copy link
Contributor

@kopax-polyconseil kopax-polyconseil commented Apr 7, 2021

Jira

https://passculture.atlassian.net/browse/PC-7917

Original PR

#842

Things done

  • Inside test/utils.tsx extracted a render function with a wrapper with Lingui, in this way we don't need to wrap any render function on every test, also exports every function of testing library native so you could use that file for every test
  • Removed the _.(t) function because it was useless, Lingui v3 is use the macro functions, there's no need to complex everything. https://lingui.js.org/ref/macro.html#examples-of-js-macros. IN some cases you need to format currencies, numbers, or dates giving a locale, Lingui also exports date, and number macros but those ones are extracted from the @lingui/core library. **I've remember this because I saw hard-written dates formatted to iso but could be good to format them using the locale instead of the iso... **
  • Added lingui.config.js with a typedef for checking that the config is valid ;)
  • Modified the add new locale and add new translation readmes to match latest lingui version
  • Also i saw that you use a lot unicode chars to give spaces to things, in Lingui v3 we strip this characters so just use html entities or basic templating

Checklist

I have:

  • Made sure the title of my PR follows the convention [PC-XXX] <summary>.
  • Made sure my feature is working on the relevant real / virtual devices.
  • Written unit tests for my feature.
  • Added new reusable components to the AppComponents page and communicate to the team on slack

@kopax-polyconseil kopax-polyconseil self-assigned this Apr 7, 2021
@kopax-polyconseil kopax-polyconseil changed the title Semoal refactor to lingui v3 (PC-7957) Flaskadmin - Automatiser la génération d'API key en intégration et production Apr 7, 2021
@kopax-polyconseil kopax-polyconseil changed the title (PC-7957) Flaskadmin - Automatiser la génération d'API key en intégration et production (PC-7917) App Native - Amélioration tech - Mise en place de la traduction au pluriel Apr 7, 2021
@kopax-polyconseil kopax-polyconseil force-pushed the semoal-refactor-to-lingui-v3 branch 2 times, most recently from ab34bba to 5bbaf8f Compare April 7, 2021 12:22
@kopax-polyconseil kopax-polyconseil requested review from blixit and antoinewg and removed request for blixit April 7, 2021 12:23
Copy link
Contributor

@blixit blixit left a comment

Choose a reason for hiding this comment

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

Huge ! n'oublie pas de faire un message aux PO pour qu'ils fassent attention aux traductions.

Je pense qu'il serait même préférable de demander une repasse sur les traductions lors de la prochaine session globale de test

@kopax-polyconseil kopax-polyconseil mentioned this pull request Apr 7, 2021
6 tasks
@kopax-polyconseil
Copy link
Contributor Author

Y a encore quelque pétouilles, en cours de fix via lingui/js-lingui#1022

@kopax-polyconseil kopax-polyconseil changed the title (PC-7917) App Native - Amélioration tech - Mise en place de la traduction au pluriel (PC-7917) App Native - Amélioration tech - Mise à jour de lingui v2 -> v3 avec traduction au pluriel Apr 7, 2021
@kopax-polyconseil kopax-polyconseil force-pushed the semoal-refactor-to-lingui-v3 branch 4 times, most recently from dc8025d to 5688a7a Compare April 8, 2021 11:12
Copy link
Contributor

@BenStirrup BenStirrup left a comment

Choose a reason for hiding this comment

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

Ne pas oublier dans la prochaine pr d'ajouter une règle eslint pour interdir les import depuis testing library

.eslintignore Outdated Show resolved Hide resolved
@kopax-polyconseil
Copy link
Contributor Author

Ne pas oublier dans la prochaine pr d'ajouter une règle eslint pour interdir les import depuis testing library

Après ce ticket OK

…tion au pluriel et upgrade de lingui v2 -> v3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants