Skip to main content
Skip table of contents

Plurals Support

Background

Plurals are a mechanism of language that allows a speaker or writer to differentiate types of nouns or phrases. In English we have two plural forms singular and plural. These forms are represented in different ways:

  • Standard: appending an “-s”, “-es” or changing “-y” to “-ies” for a singular noun.

    • Example: cat - cats, baby - babies

  • Irregular plural: some nouns do not follow specific rules

    • Example: mouse - mice

  • No change: some nouns have no change between forms

    • Example: deer - deer,

  • Latin and Greek: some forms derive from Latin or Greek origin

    • Example: cactus - cacti

English forms are just the beginning, in Arabic there are six forms and completely different rules. The localization industry has created multiple syntax’s including ICU and i18n to support this eccentricity of language.

LILT’s Plural support

What we support

At LILT we provide automated support for plurals created with ICU, Android, and iOS libraries. Users can upload files with the ICU syntax, easily translate, and export with correct formatting.

ICU

LILT supports ICU plural functions, in addition to the other ICU functions. Product strings or product documents uploaded with ICU plural functions can be automatically processed by our filters. For linguists these plurals will appear in the CAT as any other plural form we automatically filter.

CODE
{applesCount, plural, 
    zero {{pearsCount, plural, 
        zero {{orangesCount, plural, 
            zero {I have no fruit}
            other {I have some oranges}
        }}
        other {{orangesCount, plural, 
            zero {I have some pears}
            other {I have some pears and some oranges}
        }}
    }}
    other {{pearsCount, plural, 
        zero {{orangesCount, plural, 
            zero {I have some apples}
            other {I have some apples and some oranges}
        }}
        other {{orangesCount, plural, 
            zero {I have some apples and some pears}
            other {I have some apples, some pears, and some oranges}
        }}
    }}
}

Android

LILT supports Android plurals. Product strings or product documents uploaded with ICU plural functions will be automatically processed by our filters. For linguists these plurals will appear in the CAT as any other plural form we automatically filter.

XML
<!-- Snippet from source EN Android XML File -->
<plurals name="number_of_beds">
		<item quantity="one">%d bed</item>
		<item quantity="other">%d beds</item>
</plurals>

iOS

LILT supports iOS plurals. Product strings or product documents uploaded with ICU plural functions will be automatically processed by our filters. For linguists these plurals will appear in the CAT as any other plural form we automatically filter.

XML
<!-- Snippet from source EN .stringsdict File -->
<plist version="1.0">
    <dict>
        <key>number_of_beds</key>
        <dict>
            <key>NSStringLocalizedFormatKey</key>
            <string>%#@count@</string>
            <key>count</key>
            <dict>
                <key>NSStringFormatSpecTypeKey</key>
                <string>NSStringPluralRuleType</string>
                <key>NSStringFormatValueTypeKey</key>
                <string>d</string>
                <key>one</key>
                <string>%1$d bed</string>
                <key>other</key>
                <string>%1$d beds</string>
            </dict>
        </dict>
    </dict>
</plist>

What we don’t support

If it not above, it is not supported. To answer some specific questions, we do not support:

  • We do not support non-standard formats which would produce errors in the ICU parser, iOS compiler, or Android compiler

  • We do not support iOS strings catalog

  • Tags within plurals

  • MT/Pre-translation within the plural modal. Linguists will not receive plural form suggestions.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.