MessageSelector

MessageSelector

class MessageSelector

MessageSelector.

Methods

string choose(string $message, int $number, string $locale)

Given a message with different plural translations separated by a pipe (|), this method returns the correct portion of the message based on the given number, locale and the pluralization rules in the message itself.

Details

string choose(string $message, int $number, string $locale)

Given a message with different plural translations separated by a pipe (|), this method returns the correct portion of the message based on the given number, locale and the pluralization rules in the message itself.

The message supports two different types of pluralization rules:

登录查看完整内容