Funkcionalnosć toś togo sedła se pśez wótwardowańske źěła wobgranicujo, kótarež maju wašo dožywjenje pólěpšyś. Jolic nastawk waš problem njerozwězujo a cośo pšašanje stajiś, wobrośćo se na našo zgromoźeństwo pomocy, kótarež na to caka, wam na @FirefoxSupport na Twitter a /r/firefox na Reddit pomagaś.

Pomoc pśepytaś

Glědajśo se wobšudy pomocy. Njenapominajomy was nigda, telefonowy numer zawołaś, SMS pósłaś abo wósobinske informacije pśeraźiś. Pšosym dajśo suspektnu aktiwitu z pomocu nastajenja „Znjewužywanje k wěsći daś“ k wěsći.

Dalšne informacije

How can I make general.useragent.locale variable

  • 3 wótegrona
  • 3 maju toś ten problem
  • 43 naglědow
  • Slědne wótegrono wót cor-el

more options

In our domain we have different user languages. Windows adapts it's gui depending on the username they login with. We have configured Firefox settings through GPO's and build a pakcage with the FF GPO add-in included, with also the 5 different language packs included we use in our domain. We can switch manually the GUI language, but we are looking for a way to automate this, depending on the profile language. I know we can change the user.js file, but I was wondering if there is a way to automate this through GPO's. Something like a variable we can place in the general.useragent.locale that looks for the sytem language? Or another way to automate this?

In our domain we have different user languages. Windows adapts it's gui depending on the username they login with. We have configured Firefox settings through GPO's and build a pakcage with the FF GPO add-in included, with also the 5 different language packs included we use in our domain. We can switch manually the GUI language, but we are looking for a way to automate this, depending on the profile language. I know we can change the user.js file, but I was wondering if there is a way to automate this through GPO's. Something like a variable we can place in the general.useragent.locale that looks for the sytem language? Or another way to automate this?

Wšykne wótegrona (3)

more options

You should be able to do this via a mozilla.cfg autoconfig file.

This file is run as JavaScript with full chrome privileges and can contain more advanced code, so you should be able to check the system language and set general.useragent.locale accordingly.

I don't know how to get the system language setting, but you should be able to read registry keys and environment variables if necessary.

more options

Thanks for your quick response I configured the mozilla.cfg file, although wasn't able to set the variable here.

I tried adding but this did not work: var languagesetting = window.navigator.language; lockPref("general.useragent.locale", languagesetting);

Seems like the command 'window.navigator.language' is not recognised, nor is window.navigator.userLanguage

Do you have any idea how I can set this?

more options

There is no window defined when Firefox is running the code in mozilla.cfg and anyway you would have to use other code to reference to a browser window.

You can try this code:

locale = Cc["@mozilla.org/chrome/chrome-registry;1"] .getService(Components.interfaces.nsIXULChromeRegistry).getSelectedLocale("global");

lockPref("general.useragent.locale", locale);

Wót cor-el změnjony