我想本地化Laravel应用。
我在刀片上这样称呼它:@lang('bot.bots')
我的bot.php
是:
<?
return [
'bots' => 'Bot|Bots',
'addBot' => 'Add bot',
'editBot' => 'Edit bot',
'deleteBot' => 'Delete bot',
'compose' => 'Compose',
'addGroup' => 'Add group',
'editGroup' => 'Edit group',
'deleteGroup' => 'Delete group',
'confirmDeleteGroup' => 'Are you sure you want to delete the group?',
'textRecognition' => 'Text recognition',
'newRule' => 'Add rule',
'deleteRule' => 'Delete rule',
'confirmDeleteRule' => 'Are you sure you want to delete the rule?',
'editBot' => 'Bot szerkesztése',
'input' => 'Input',
'output' => 'Output',
'addInput' => 'Add input',
'addOutput' => 'Add output',
'blocks' => 'Block|Blocks',
'groups' => 'Group|Groups',
'text' => 'Text',
'broadcast' => 'Broadcast',
'analytics' => 'Analytics',
'chatPartners' => 'Chat Partners',
];
可能是什么问题?我所做的一切都与文档中的内容一样
答案 0 :(得分:1)
只需指出这样的计数
$bots_count = 4 //replace with count
@lang('bot.bots', $bots_count)
您还可以使用翻译选择,其数组应如下所示
return [
'bots' => '{0} No Bots|{1} Bot|[2,*] Bots',
...
];