-
Notifications
You must be signed in to change notification settings - Fork 56
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
[TECH] Isoler la configuration du module i18n de l'api #10501
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bpetetot
added
👀 Tech Review Needed
team-acces
cross-team
Toutes les équipes de dev
labels
Nov 7, 2024
Une fois les applications déployées, elles seront accessibles via les liens suivants :
Les variables d'environnement seront accessibles via les liens suivants : |
bpetetot
force-pushed
the
pix-15112-isolate-i18n-module
branch
from
November 8, 2024 09:23
97c0470
to
03913a6
Compare
Une fois les applications déployées, elles seront accessibles via les liens suivants :
Les variables d'environnement seront accessibles via les liens suivants : |
bpetetot
force-pushed
the
pix-15112-isolate-i18n-module
branch
from
November 8, 2024 13:40
03913a6
to
819fa1e
Compare
er-lim
approved these changes
Nov 8, 2024
lionelB
reviewed
Nov 12, 2024
lionelB
reviewed
Nov 12, 2024
lionelB
approved these changes
Nov 12, 2024
bpetetot
force-pushed
the
pix-15112-isolate-i18n-module
branch
3 times, most recently
from
November 12, 2024 14:44
923151c
to
0e0cadc
Compare
pix-service-auto-merge
force-pushed
the
pix-15112-isolate-i18n-module
branch
from
November 12, 2024 14:58
0e0cadc
to
2279f21
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🍂 Problème
La configuration i18n de l'api est fortement couplée à la librarie
hapi-i18n
. Ce qui fait qu'on a pas d'accès à un objeti18n
en dehors de l'api.Or on en a besoin en dehors, par exemple dans certains jobs. À partir d'une locale, on souhaite récupérer certaines traductions.
🌰 Proposition
Isoler la configuration
i18n
dans un module d'infrastructure qui sera utilisé danshapi-18n
.Le nouveau module
i18n
est dansshared/infrastructure/i18n
, il expose :hapi-i18n
getI18n
qui retourne une instance dei18n
pré-configurée avec la locale par défaut.getI18nForLocale
qui retourne une instance dei18n
pré-configurée avec la locale donné en entrée.Note
Le fichier
tests/tooling/i18n.js
a été supprimé. Les tests utilisent désormais la fonctiongetI18n
du modulei18n
deshared/infrastructure/i18n
🪵 Pour tester
Les tests de CI suffisent pour ce type de changement.