Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 1.78 KB

File metadata and controls

27 lines (20 loc) · 1.78 KB

Phrase::IcuSkeletonParameters

Properties

Name Type Description Notes
content String Source ICU message string to derive skeletons from. Mutually exclusive with `id`; exactly one of the two must be provided. [optional]
id String Code of an existing translation to source content from. Mutually exclusive with `content`; exactly one of the two must be provided. Returns 404 when the translation does not exist. [optional]
locale_codes Array<String> Locale codes for which to generate skeletons. The pluralization rules of each locale determine which plural forms appear in the output. [optional]
keep_content Boolean When true, preserves the existing translation text in each plural form and adds any missing forms for the locale rather than stripping all literal content. [optional]
zero_form_enabled Boolean When true, includes the zero plural form in the generated skeleton for locales that support it. [optional]
cldr_version String Pluralization rule set to use when constructing skeletons. Pass `legacy` for pre-CLDR behaviour, or a CLDR version string such as `cldr48`. Defaults to the project's configured version when omitted. [optional]

Code Sample

require 'phrase'

instance = Phrase::IcuSkeletonParameters.new(content: '{count, plural, one {One item} other {# items}}',
                                 id: 'abcd1234abcd1234abcd1234abcd1234',
                                 locale_codes: ["en","de"],
                                 keep_content: false,
                                 zero_form_enabled: false,
                                 cldr_version: 'cldr48')