App using FR translation but HTML is EN

My jmix app is in French and English. The language in the app is set to french by default and the text is using the french translations as intended, however, as you can see in the screenshot, the page html considers it to be in english. This causes issue with some addons I’m using as they default to english for the translation. What could be the cause
image

Hi, @p.desaxce

You can use the io.jmix.core.security.CurrentAuthentication#getLocale to get a correct locale for the user. This method is used by Jmix (for example, io.jmix.core.Messages) to get localized messages.

It is required to add implementation 'io.jmix.translations:jmix-translations-fr' to the project build.gradle. This starter contains French translations for the Jmix add-ons.

Regards,
Maria.

Dear @m.orlova

Thank you for the reply. But this does not solve the problem, that Jmix is generating wrong html-code. If there is a site displayed in french ( or in my case in german ) the <html lang= should be fr or de and not en. The question is, how to get this attribute correctly generated in the html file.

Regards
Felix

Hi @f.zehnder

Yes, you are right. I have created the GitHub issue.

After quick investigation, Vaadin sets the lang attribute value in com.vaadin.flow.server.communication.IndexHtmlRequestHandler. In short, it takes value from index.html, if it is not set then the first available locale is set as attribute value.

Regards,
Maria.

Thank you for the answer, @m.orlova.

Have a nice day,
Pierre de Saxce.