packagist gettext/gettext v4.0.0
4.0.0

latest releases: 4.x-dev, v4.8.10, dev-master...
7 years ago

Breaking changes

  • PHP >= 5.4 compatibility (dropped PHP 5.3 support)
  • New class Merge, that changes the way to merge translations.
  • Gettext\Translation::getPluralTranslation() renamed to Translation::getPluralTranslations() and always returns an array with all plural translations
  • Removed the print functions like __e(), n__e(), p__e(), etc. Use <?= __('text') ?> instead.
  • The format PhpArray has a different structure
  • Removed Gettext\Translation::normaliceTranslationCount() to improve performance
  • Removed Gettext\Translator::initGettextFunction(). Use $translator->register().
  • Invalid languages throw a InvalidArgumentException in Translations::setLanguage()
  • If not specified, the default domain for translations is an empty string instead "messages"
  • Changed the extractor and generator interfaces and allow to pass an array with the options instead use static properties.
  • Removed the ability to include empty translations on generate Mo.

New extractors/generators

  • Yaml
  • Csv
  • Xliff
  • Json

Other changes

  • Added the $checkContent argument to Translation::hasPluralTranslations() to check whether the plural translation contains any text or not
  • Added Translations::$options to configure some default headers.
  • Prevent to insert duplicated comments, flags and extracted comments in a translation
  • Translations::register() returns the previous registered translations instance if exists.
  • Improved tests
  • Bugfixes
  • Code improvements

Don't miss a new gettext release

NewReleases is sending notifications on new releases.