Laravel:查看整个lang文件

时间:2018-08-12 09:33:21

标签: laravel laravel-5 localization laravel-blade lang

我想本地化Laravel应用。

我在刀片上这样称呼它:@lang('bot.bots')

但是我的看法是: enter image description here

我的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',
];

可能是什么问题?我所做的一切都与文档中的内容一样

1 个答案:

答案 0 :(得分:1)

只需指出这样的计数

$bots_count = 4 //replace with count
@lang('bot.bots', $bots_count)

您还可以使用翻译选择,其数组应如下所示     

return [

    'bots' => '{0} No Bots|{1} Bot|[2,*] Bots',
    ...
];