Configure default local i18n

Hello guys,

I’d like to know if there is a way to enforce a default local language using docker-compose deployment method ?

Thanks for your work !

Hi @Louis_Delbosc, the locale and timezone of an individual Grist document is set from the browser of the user creating them:

There are defaults (en-US/UTC) but they would only take effect if the browser for some reason did not supply a locale or timezone, which I would guess is unlikely these days. The settings for individual documents can be overridden in the document settings page.

You could modify the code I pointed to, to set timezone and/or locale to something passed in as an environment variable. That could be reasonable for an installation with a particular national “home”. Is that what you are looking for?

Grist does not yet have any particular hooks for controlling the language used throughout the app (as opposed to the formatting of numbers etc).

Does that apply only when the document is created or also when it is viewed ?

I’d say that this could be great indeed. It would be better to control the default locale in our case.

It applies when the document is created. After that point, the locale is determined by the document, not the viewer (we went back and forth on this but in the end it seemed the least confusing option). The locale of the document can be changed in document settings, and that change affects all viewers of the document.

I’m wondering what is motivating you to drill into this - are you seeing problems with documents having unexpected locale settings? It could be our existing logic isn’t working as intended in that case, or we’ve missed something.

In any case, an optional override for locale seems easy to add and non-disruptive, so a PR would be welcome.

It’s certainly me missing something, but this is what I see when I create a new document on our instance with a Chrome that is (has much as I can say) in French:

(see the output of navigator in the console)

Same in getgrist:

Thanks for flagging this @Yohan_Boniface, will look into it, that does not look great. The solution may be a fix or improvement in Grist rather than adding more configuration. :wink:

1 Like