hilla icon indicating copy to clipboard operation
hilla copied to clipboard

i18n default language should be in sync with Flow

Open jcgueriaud1 opened this issue 1 year ago • 0 comments
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

jcgueriaud1 avatar May 15 '24 10:05 jcgueriaud1