Class TextDomain

Summary

Fully Qualified Name: Zend\I18n\Translator\TextDomain
Extends: ArrayObject

Description

Text domain.

Methods

Name Description Defined By
getDefaultPluralRule() Returns a shared default plural rule. TextDomain
getPluralRule() Get the plural rule. TextDomain
hasPluralRule() Checks whether the text domain has a plural rule. TextDomain
merge() Merge another text domain with the current one. TextDomain
setPluralRule() Set the plural rule TextDomain

Method Details

getDefaultPluralRule()

Returns a shared default plural rule.

Returns: \PluralRule

getPluralRule()

Get the plural rule.

Parameter Name Type Description
$fallbackToDefaultRule bool

Returns: \PluralRule|null

hasPluralRule()

Checks whether the text domain has a plural rule.

Returns: bool

merge()

Merge another text domain with the current one.

The plural rule of both text domains must be compatible for a successful merge. We are only validating the number of plural forms though, as the same rule could be made up with different expression.

Parameter Name Type Description
$textDomain \TextDomain

Returns: \TextDomain

setPluralRule()

Set the plural rule

Parameter Name Type Description
$rule \PluralRule

Returns: \TextDomain

Top