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.
Description
Adds internationalization of emails.
Implementation
X-Language
header on all Flow API endpoints.lang
attribute of the components as the value for theX-Language
header.lang
attribute updates the language of underlyingHanko
client used through a new setter function (only the underlying Flow client is updated since other clients are slated for removal in the near future)Hanko
client of the frontend SDK.email.send
event now also contains the transmittedX-Language
header value in thelanguage
claim (theaccept_language
claim/field of the underlying backend struct has been marked as deprecated in order to be more consistent with the new headers' name and to prevent possible confusion regarding the syntax/semantics of the claim - its value does behave like a HTTP Accept-Language header, it is only one value instead of a list with quality values/weights).How to test
Startup backend + Mailslurper (or equivalent, configure as required). Build Hanko Elements/Hanko Frontend SDK and use the example "application" in
/frontend/elements/src/example.html
to toggle languages and request emails. Alternatively, start up one of the examples in/frontend/examples
and supply different values for the components'lang
attribute.