gecko-dev/intl/docs/locale_env.rst
Zibi Braniecki 41175a3f18 Bug 1438687 - Add Developer documentation for LocaleService. r=jfkthame,Pike
MozReview-Commit-ID: Jk2BhKBsW8S

--HG--
extra : rebase_source : 13919722aa508cac0f4c9638dc6ff9a6bf4607ce
2018-04-26 14:18:34 -07:00

35 lines
1020 B
ReStructuredText

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.