Translatable notification

hi, need to translate this
$body = __('Your <b>brands</b> export has completed and :count :row exported.', [
'count' => number_format($export->successful_rows),
'row' => str(__('brand.rows'))->plural($export->successful_rows),
]);
$body = __('Your <b>brands</b> export has completed and :count :row exported.', [
'count' => number_format($export->successful_rows),
'row' => str(__('brand.rows'))->plural($export->successful_rows),
]);
i have problem with plurals brand in italian is marchio plural for brands is marchi but the translation in this case add an S at the end and become MARCHIS i also need to translate 'your brands etc...'
2 Replies
Soundmit
Soundmit2mo ago
i've found this solution
$body = __(':message :count :brand_brands.', [
'message' => __('brand.export_message_success'),
'count' => number_format($export->successful_rows),
'brand_brands' => trans_choice('brand.brand_brands', $export->successful_rows),
$body = __(':message :count :brand_brands.', [
'message' => __('brand.export_message_success'),
'count' => number_format($export->successful_rows),
'brand_brands' => trans_choice('brand.brand_brands', $export->successful_rows),
is the best way?
Dennis Koch
Dennis Koch2mo ago
Check the Laravel docs for Localization: https://laravel.com/docs/master/localization#pluralization
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.