搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

Learn More

how to run firefox with default language(en-gb) from command line

  • 8 个回答
  • 1 人有此问题
  • 605 次查看
  • 最后回复者为 cor-el

more options

I need to run selenium bat file which opens Mozilla firefox (which is in windows server) with default language(en-gb) from Linux server via ssh ,

I need to run selenium bat file which opens Mozilla firefox (which is in windows server) with default language(en-gb) from Linux server via ssh ,

被采纳的解决方案

cor-el said

Support for the command line switch to start Firefox with a specific locale has been removed. You can only use a pref (intl.locale.requested) to select the locale. You can possibly use/copy a user.js file to the profile folder or set up Selenium to initialize this pref.
定位到答案原位置 👍 0

所有回复 (8)

more options

Hi

I will admit that I have never tried to do what you are attempting (and welcome comments and assistance from fellow contributors), but have you got the en-GB version of Firefox installed?

You can download a copy from here.

more options

Support for the command line switch to start Firefox with a specific locale has been removed.

You can only use a pref (intl.locale.requested) to select the locale. You can possibly use/copy a user.js file to the profile folder or set up Selenium to initialize this pref.

more options

Seburo said

Hi I will admit that I have never tried to do what you are attempting (and welcome comments and assistance from fellow contributors), but have you got the en-GB version of Firefox installed? You can download a copy from here.
more options

Thank you for you inputs. Can I get old versions of firefox in specific language.

more options

选择的解决方案

cor-el said

Support for the command line switch to start Firefox with a specific locale has been removed. You can only use a pref (intl.locale.requested) to select the locale. You can possibly use/copy a user.js file to the profile folder or set up Selenium to initialize this pref.
more options

When I added preference in selenium setup like below, still I am unable to launch firefox with en-gb

FirefoxProfile ffprofile = profile.getProfile("default");                                 ffprofile.setPreference("intl.accept_languages","en-gb");                                 driver = new FirefoxDriver(ffprofile);

more options

my problem resolved

more options

You need to set intl.locale.requested for the user interface language like I wrote above.

  • ffprofile.setPreference("intl.locale.requested","en-GB");