I am using Laravel localization builtin to translate phrases.
In my view I have {{ trans('site.phrase') }}
. Let's say I mispell the keyword and type:
{{ trans('site.prase') }} //without h
Now in my view I will have a: site.prase
. Is there any way to obtain a warning from Laravel in the log ?
Edit
Following comments and the answer I am now using a simple custom helper:
// trans_safe
function transs( $key, $params = []) {
$localized = trans($key, $params);
if ($localized == $key) {
\Log::warning("Key: {$key} doesn't exists with language: " . \App::getLocale() . ", url: " . \Request::fullUrl());
}
return $localized;
}
Now in the view I use: {{ transs('site.key) }}