locale_env.rst (1141B)
1 Environments 2 ============ 3 4 While all the concepts described above apply to all programming languages and frameworks 5 used by Mozilla, there are differences in completeness of the implementation. 6 7 Below is the current list of APIs supported in each environment and examples of how to 8 use them: 9 10 C++ 11 --- 12 13 In C++ the core API for Locale is :js:`mozilla::intl::Locale` and the service for locale 14 management is :js:`mozilla::intl::LocaleService`. 15 16 For any OSPreference operations there's :js:`mozilla::intl::OSPreferences`. 17 18 19 JavaScript 20 ---------- 21 22 In JavaScript users can use :js:`mozilla.org/intl/mozILocaleService` XPCOM API to access 23 the LocaleService and :js:`mozilla.org/intl/mozIOSPreferences` for OS preferences. 24 25 The LocaleService API is exposed as :js:`Services.locale` object. 26 27 There's currently no API available for operations on language tags and Locale objects, 28 but `Intl.Locale`_ API is in the works. 29 30 Rust 31 ---- 32 33 For Rust Mozilla provides a crate `fluent-locale`_ which implements the concepts described 34 above. 35 36 .. _Intl.Locale: https://bugzilla.mozilla.org/show_bug.cgi?id=1433303 37 .. _fluent-locale: https://docs.rs/fluent-locale/