Updates to mozilla/intl/mozILocaleService and mozilla/intl/mozIOSPreferences

Zibi Braniecki (Gandalf) zbraniecki at mozilla.com
Fri Sep 21 22:32:59 UTC 2018

Hi all,

A quick update on the LocaleService and OSPreferences APIs.

We just landed an update [0] that utilizes recently introduced new XPIDL
feature of handling Arrays[1]!

That means that we were able to turn all `getX` and `setX` methods into
properties, which means that instead of
`Services.locale.getRequestedLocales` and
`Services.locale.setRequestedLocales` you'll now have
`Services.locale.requestedLocales` and so on.

The change for OSPreferences will land soon [2].

The new APIs:

 - LocaleService.requestedLocales (rw)
 - LocaleService.availableLocales (rw)
 - LocaleService.packagedLocales (ro)
 - LocaleService.regionalPrefsLocales (ro)
 - OSPreferences.systemLocales (ro)
 - OSPreferences.regionalPrefsLocales (ro)

Documentation is available in the IDL files:

and in the docs: https://firefox-source-docs.mozilla.org/intl/locale.html

Also, PSA - the new Array<> API is awesome and you should switch to it!


[0] https://bugzilla.mozilla.org/show_bug.cgi?id=1491394
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1474369
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1493220
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/firefox-dev/attachments/20180921/452314d9/attachment.html>

More information about the firefox-dev mailing list