Laravel 8 trans_choice() {#collection-method}
trans_choice 函数将根据词形变化来翻译给定的翻译键:
echo trans_choice('messages.notifications', $unreadCount); 如果指定的翻译键不存在,trans_choice 函数将会返回您指定的键。因此,在上方的例子中,若翻译键不存在,则 trans_choice 函数将会返回 messages.notifications:
trans_choice 函数将根据词形变化来翻译给定的翻译键:
echo trans_choice('messages.notifications', $unreadCount); 如果指定的翻译键不存在,trans_choice 函数将会返回您指定的键。因此,在上方的例子中,若翻译键不存在,则 trans_choice 函数将会返回 messages.notifications: