-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Firefox locale not available #2851
-
Hello,
I'm migrating some tests to seleniumbase, and I can't launch Firefox with the correct locale.
My local Firefox is in French, but the one start for the test is in English, and don't have any other language available.
Here is a part of the about:config page that is of interest :
Application Settings
Requested Locales: ["fr-FR"]
Available Locales: ["en-US"]
App Locales: ["en-US"]
Regional Preferences: ["en-US"]
Default Locale: "en-US"
Operating System
System Locales: ["fr-FR"]
Regional Preferences: ["fr-FR"]
As you can see, it correctly takes the fr locale that I request, but the automated Firefox don't have it. Is there something to do to make it available ?
Thanks for the help.
Beta Was this translation helpful? Give feedback.
All reactions
After running this:
pytest --firefox --locale="fr"
Sites visited became French in Firefox:
If that isn't working for you, then I'm not sure what else is happening on your end.
Valid local codes: SeleniumBase/help_docs/locale_codes.md
For the SB()
and Driver()
formats, use locale_code
, eg: SB(locale_code="fr")
Replies: 3 comments 3 replies
-
There's a section on changing locale here:
https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/locale_codes.md
For the SB()
and Driver()
formats, use locale_code
, eg: SB(locale_code="fr")
Beta Was this translation helpful? Give feedback.
All reactions
-
Yeah, I did that and that didn't change anything :/
the locale is correctly set to the one I ask for using --locale=fr, it's just that it is not available on the Firefox used for the test, but the Firefox I use every day have it :/
it seems that sb use another Firefox instance or something that don't have the language :/
Beta Was this translation helpful? Give feedback.
All reactions
-
Do you have multiple versions of Firefox installed? SeleniumBase will first try to use the one in the default location. If it can't find it, then Selenium Manager will try to download a new Firefox into the ~/.cache/selenium
folder. If you see one there, then it did.
Beta Was this translation helpful? Give feedback.
All reactions
-
No, I did uninstall every Firefox binary I found and check that the test didn't launch before reinstalling Firefox.
Still the same issue when I launch it manually it is in fr when pytest launch it, it is in en without fr available
Only chromedriver in the .cache/selenium folder (no issue with chronium, correctly set to fr locale), I did remove everything in any case.
Beta Was this translation helpful? Give feedback.
All reactions
-
After running this:
pytest --firefox --locale="fr"
Sites visited became French in Firefox:
Screenshot 2024年06月12日 at 10 20 56 AMIf that isn't working for you, then I'm not sure what else is happening on your end.
Valid local codes: SeleniumBase/help_docs/locale_codes.md
For the SB()
and Driver()
formats, use locale_code
, eg: SB(locale_code="fr")
Beta Was this translation helpful? Give feedback.
All reactions
-
Also SB(UC=True, locale_code="tr")
is not working on my arm Linux device. Everything is up to date. No matter what I set as locale_code, websites automatically request it in my system language.
On selenium, I was using
options.add_experimental_option('prefs', {'intl.accept_languages':'tr'})
but I can't use this with SB.
Beta Was this translation helpful? Give feedback.