Laravel has built-in functionality for dealing with translations. You can store arrays for language strings inside the resources/lang folders and depending on your lcaole settings Laravel will display the correct language.

When you use the __() function Laravel will search for the key in your translation strings and return the value.

In this tutorial we're going to make some changes to how Laravel finds your translation strings and will log any missing translation strings.

if ($translation === $key) { // Log missing translation string } https://paulund.co.uk/laravel-log-missing-translation-strings#override-the-default-laravel-translatorTo override the default Laravel translator we need to add some code to our AppServiceProvider.php file.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners