Knowledge Base

Empty filter

Laravel Blade syntax translations

{{ $workOrder->estimated_hours ?? __('messages.not_specified') }}

To add a colon (":") before the translation
{{ $workOrder->estimated_hours ?? ':' . __('messages.not_specified') }}

space after the colon
{{ $workOrder->estimated_hours ?? ': ' . __('messages.not_specified') }}

add ";"
{{ $workOrder->completion_date ? date('M d, Y', strtotime($workOrder->completion_date)) : __('messages.not_completed') . ';' }}
This will add a semicolon after the translated text when the completion date is not available. The result will be something like "Not completed;" in English or "Nije dovršeno;" in Croatian.

If you want to add the semicolon in both cases (whether there's a completion date or not), you can do:
{{ ($workOrder->completion_date ? date('M d, Y', strtotime($workOrder->completion_date)) : __('messages.not_completed')) . ';' }}

":" before messages.
{{ $workOrder->completion_date ? date('M d, Y', strtotime($workOrder->completion_date)) : ':' . __('messages.not_completed') }}
This will add a colon before the translated text when the completion date is not available. The result will be something like ":Not completed" in English or ":Nije dovršeno" in Croatian.

If you want a space after the colon for better readability
{{ $workOrder->completion_date ? date('M d, Y', strtotime($workOrder->completion_date)) : ': ' . __('messages.not_completed') }}

Published
Back to Index