Repository navigation
0.5.0
Pre-release
Pre-release
- We removed second parameter
$default. To achieve the same logic, you can do this in your code:
$translation = $locale->getText('myMissingTranslation');
if($translation == '{{myMissingTranslation}}') {
$translation = 'Translation not found!';
}
echo $translation;
If you have exceptions enabled, you could:
Locale::$exceptions = true;
try {
$translation = $locale->getText('myMissingTranslation');
echo $translation;
} catch (\Throwable $exception) {
echo "Translation not found!";
}
- We added new second parameter
$placeholders. Please refer to README.md to learn how to use it.