<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi all,</div><div><br></div><div>A quick update on the LocaleService and OSPreferences APIs.</div><div><br></div><div>We just landed an update [0] that utilizes recently introduced new XPIDL feature of handling Arrays[1]!</div><div><br></div><div>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.</div><div><br></div><div>The change for OSPreferences will land soon [2].</div><div><br></div><div>The new APIs:</div><div><br></div><div> - LocaleService.requestedLocales (rw)<br></div><div> - LocaleService.availableLocales (rw)<br></div><div> - LocaleService.packagedLocales (ro)<br></div><div> - LocaleService.regionalPrefsLocales (ro)</div><div> - OSPreferences.systemLocales (ro)<br></div><div> - OSPreferences.regionalPrefsLocales (ro)<br></div><div><br></div><div>Documentation is available in the IDL files:<br> - <a href="https://searchfox.org/mozilla-central/source/intl/locale/mozILocaleService.idl">https://searchfox.org/mozilla-central/source/intl/locale/mozILocaleService.idl</a></div><div> - <a href="https://searchfox.org/mozilla-central/source/intl/locale/mozIOSPreferences.idl">https://searchfox.org/mozilla-central/source/intl/locale/mozIOSPreferences.idl</a></div><div><br></div><div>and in the docs: <a href="https://firefox-source-docs.mozilla.org/intl/locale.html">https://firefox-source-docs.mozilla.org/intl/locale.html</a></div><div><br></div><div>Also, PSA - the new Array<> API is awesome and you should switch to it!<br></div><div><br></div><div>Cheers,</div><div>zb.<br></div><div><br></div><div>[0] <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1491394">https://bugzilla.mozilla.org/show_bug.cgi?id=1491394</a></div><div>[1] <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1474369">https://bugzilla.mozilla.org/show_bug.cgi?id=1474369</a><br></div><div>[2] <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1493220">https://bugzilla.mozilla.org/show_bug.cgi?id=1493220</a><br></div></div></div></div></div></div></div></div>