Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

26 views
Skip to first unread message

Zibi Braniecki (Gandalf)

unread,
Sep 21, 2018, 6:33:47 PM9/21/18
to firefox-dev, dev-platform
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:
-
https://searchfox.org/mozilla-central/source/intl/locale/mozILocaleService.idl
-
https://searchfox.org/mozilla-central/source/intl/locale/mozIOSPreferences.idl

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!

Cheers,
zb.

[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
0 new messages