summaryrefslogtreecommitdiffstats
path: root/intl/icu_capi/js/package/docs/source/pluralrules_ffi.rst
blob: ca29ec47e07027db25f5838ae8e05884ac79c7ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
``pluralrules::ffi``
====================

.. js:class:: ICU4XPluralCategories

    FFI version of ``PluralRules::categories()`` data.


    .. js:attribute:: zero

    .. js:attribute:: one

    .. js:attribute:: two

    .. js:attribute:: few

    .. js:attribute:: many

    .. js:attribute:: other

.. js:class:: ICU4XPluralCategory

    FFI version of ``PluralCategory``.

    See the `Rust documentation for PluralCategory <https://docs.rs/icu/latest/icu/plurals/enum.PluralCategory.html>`__ for more information.


    .. js:function:: get_for_cldr_string(s)

        Construct from a string in the format `specified in TR35 <https://unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules>`__

        See the `Rust documentation for get_for_cldr_string <https://docs.rs/icu/latest/icu/plurals/enum.PluralCategory.html#method.get_for_cldr_string>`__ for more information.

        See the `Rust documentation for get_for_cldr_bytes <https://docs.rs/icu/latest/icu/plurals/enum.PluralCategory.html#method.get_for_cldr_bytes>`__ for more information.


.. js:class:: ICU4XPluralOperands

    FFI version of ``PluralOperands``.

    See the `Rust documentation for PluralOperands <https://docs.rs/icu/latest/icu/plurals/struct.PluralOperands.html>`__ for more information.


    .. js:function:: create_from_string(s)

        Construct for a given string representing a number

        See the `Rust documentation for from_str <https://docs.rs/icu/latest/icu/plurals/struct.PluralOperands.html#method.from_str>`__ for more information.


.. js:class:: ICU4XPluralRules

    FFI version of ``PluralRules``.

    See the `Rust documentation for PluralRules <https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html>`__ for more information.


    .. js:function:: create_cardinal(provider, locale)

        Construct an :js:class:`ICU4XPluralRules` for the given locale, for cardinal numbers

        See the `Rust documentation for try_new_cardinal <https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.try_new_cardinal>`__ for more information.


    .. js:function:: create_ordinal(provider, locale)

        Construct an :js:class:`ICU4XPluralRules` for the given locale, for ordinal numbers

        See the `Rust documentation for try_new_ordinal <https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.try_new_ordinal>`__ for more information.


    .. js:method:: category_for(op)

        Get the category for a given number represented as operands

        See the `Rust documentation for category_for <https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.category_for>`__ for more information.


    .. js:method:: categories()

        Get all of the categories needed in the current locale

        See the `Rust documentation for categories <https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.categories>`__ for more information.