diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /intl/docs/locale_env.rst | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'intl/docs/locale_env.rst')
-rw-r--r-- | intl/docs/locale_env.rst | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/intl/docs/locale_env.rst b/intl/docs/locale_env.rst new file mode 100644 index 0000000000..7f9f2fc754 --- /dev/null +++ b/intl/docs/locale_env.rst @@ -0,0 +1,37 @@ +Environments +============ + +While all the concepts described above apply to all programming languages and frameworks +used by Mozilla, there are differences in completeness of the implementation. + +Below is the current list of APIs supported in each environment and examples of how to +use them: + +C++ +--- + +In C++ the core API for Locale is :js:`mozilla::intl::Locale` and the service for locale +management is :js:`mozilla::intl::LocaleService`. + +For any OSPreference operations there's :js:`mozilla::intl::OSPreferences`. + + +JavaScript +---------- + +In JavaScript users can use :js:`mozilla.org/intl/mozILocaleService` XPCOM API to access +the LocaleService and :js:`mozilla.org/intl/mozIOSPreferences` for OS preferences. + +The LocaleService API is exposed as :js:`Services.locale` object. + +There's currently no API available for operations on language tags and Locale objects, +but `Intl.Locale`_ API is in the works. + +Rust +---- + +For Rust Mozilla provides a crate `fluent-locale`_ which implements the concepts described +above. + +.. _Intl.Locale: https://bugzilla.mozilla.org/show_bug.cgi?id=1433303 +.. _fluent-locale: https://docs.rs/fluent-locale/ |