Skip to content

0.5.0

Pre-release
Pre-release

Choose a tag to compare

@Meldiron Meldiron released this 13 Sep 09:43
a8c0375

⚠️ This release includes breaking changes! ⚠️

  • 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.