hilla
hilla copied to clipboard
i18n default language should be in sync with Flow
trafficstars
Describe your motivation
Currently if you are doing this:
await i18n.configure();
It uses the browser language by default.
So the lang attribute in the html tag is not the same.
<!doctype html><!--
This file is auto-generated by Vaadin.
-->
<html lang="de">
<head>
The value in the html tag is added by Flow, by taking the first value of the list (de , en, es).
Describe the solution you'd like
The default language of the i18n object should be in sync with the default language Flow
Describe alternatives you've considered
You can set it manually.
await i18n.configure({ language: document.documentElement.lang });
Here is a project that reproduce the issue: https://github.com/jcgueriaud1/spring-petclinic-vaadin-flow/tree/hybrid