Skip to content

Releases

0.8.0

Choose a tag to compare

@Meldiron Meldiron released this 12 Aug 12:59
10ffc86

⚠️ Breaking change, introducing new parameter in getText() in spot of 2nd parameter ⚠️

What's Changed

Full Changelog: 0.7.0...0.8.0

0.7.0

0.7.0 Pre-release
Pre-release

Choose a tag to compare

@Meldiron Meldiron released this 12 Aug 12:22
301984f

What's Changed

New Contributors

Full Changelog: 0.6.0...0.7.0

0.6.0

0.6.0 Pre-release
Pre-release

Choose a tag to compare

@Meldiron Meldiron released this 20 Sep 06:01
9de0523

⚠️ This release includes breaking changes! ⚠️

  • We adjusted the second parameter of getText - $placeholders for achieving more consistency and better support from localizing software. Before, you used your placeholder like Hello {name}, now it's Hello {{name}}. More examples:
// BEFORE.json

{
  'age: 'You are {age} years old',
  'fullName': 'You are logged in as {name} {surname}.',
  'post-info': 'Your post has {likeAmount} likes and {commentAmount} comments.'
}
// AFTER.json

{
  'age: 'You are {{age}} years old',
  'fullName': 'You are logged in as {{name} {{surname}}.',
  'post-info': 'Your post has {{likeAmount}} likes and {{commentAmount}} comments.'
}

0.5.0

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.

0.4.0

0.4.0 Pre-release
Pre-release

Choose a tag to compare

@eldadfux eldadfux released this 24 Jul 11:36
c2d9358
  • Added new method to set locale from JSON file alongside a native assoc array.

0.3.3

0.3.3 Pre-release
Pre-release

Choose a tag to compare

@eldadfux eldadfux released this 24 Oct 08:15

Updated tests, CI, coding standard and added some minor fixes based on Psalm analysis.

0.3.2

0.3.2 Pre-release
Pre-release

Choose a tag to compare

@eldadfux eldadfux released this 29 Jun 20:53

Fixed bug

0.3.1

0.3.1 Pre-release
Pre-release

Choose a tag to compare

@eldadfux eldadfux released this 29 Jun 20:51
Updated type

0.3.0

0.3.0 Pre-release
Pre-release

Choose a tag to compare

@eldadfux eldadfux released this 29 Jun 12:44

Added option to create an object instance, and added type hints.

0.2.1

0.2.1 Pre-release
Pre-release

Choose a tag to compare

@eldadfux eldadfux released this 20 Jun 11:59

Optimized PHP performance by using fully-qualified function calls.