jlesage / docker-firefox

Docker container for Firefox
MIT License
1.42k stars 267 forks source link

Enviroment value for system locale? #137

Open krajis opened 1 year ago

krajis commented 1 year ago

I might just miss something, but it seems I cannot get the system locale sorted out. So that decimal separator would be comma and thousand separator would be, well, nothing. On command line there seems not to be locale command available and Firefox does not seem to care about any site language or UI language preferences for this. So I can download for example language pack just fine, but locale stays as it is.

Could there be -e parameter for locale of the system?

jlesage commented 1 year ago

To clarify, are you saying that changing the language in Firefox doesn't work ?

krajis commented 1 year ago

Sorry for not being clear enough. Language packs work just fine, but the number/currency etc formatting is the issue. As far as I know under normal linux environment it is enough to se the system locale to for example de-DE and everything is fine after that, no matter the browser language settings. Changing the requested site locale in Firefox settings does not change how for example floating point numbers are presented.

jlesage commented 1 year ago

Do you have an example of where in Firefox such numbers are shown ?

krajis commented 1 year ago

On web page for example when using home assistant in "use system locale" setting. In this case that is easily fixable from HA, but in some pages formatting is not manually selectable.

jlesage commented 1 year ago

Ok I see. Did you confirm that this is working using a "normal" firefox installation ?

Can you try to set the LANG environment variable (e.g. LANG=en_US.UTF-8)? There is also a setting in Firefox to use system locale. I would enable that.

floxboy commented 1 year ago

Hey! I have the same problem i installed in container musl-locales

/tmp # locale LANG=ru_RU.UTF-8 LC_CTYPE=ru_RU.UTF-8 LC_NUMERIC=ru_RU.UTF-8 LC_TIME=ru_RU.UTF-8 LC_COLLATE=ru_RU.UTF-8 LC_MONETARY=ru_RU.UTF-8 LC_MESSAGES=ru_RU.UTF-8 LC_ALL=

but /tmp # date Wed Oct 26 06:29:59 UTC 2022

not Russian. and in my Homeasssistant image

although everything else is in Russian

jlesage commented 1 year ago

Is this working when using "normal" Firefox ? What are your Firefox settings related to language and locale ?

floxboy commented 1 year ago

I installed Firefox on windows host and everything is ok no X on linux host also everything is fine with the display in Chrome on Windows host in Firefox set language - Russian in Firefox in docker worth it too Language pack Russian

image

jlesage commented 1 year ago

Could you try to set the LANG=ru_RU.UTF-8 Docker environment variable ?

Also, if you can explain a little bit how I could reproduce on my side, it would be useful.

yangtfu commented 1 year ago

I have the same problem in Chinese already set LANG=zh_CN.UTF-8.