All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Previous releases are documented in github releases
5.3.0 - 2020-02-18
Comments::delete()
andFlags::delete()
methods #247
5.2.2 - 2020-02-09
- MoLoader with plurals #246
5.2.1 - 2019-12-08
- Multiline string in PoGenerator #244
5.2.0 - 2019-11-25
- New function
CodeScanner::extractCommentsStartingWith()
to extract comments from the code.
5.1.0 - 2019-11-11
- New function
CodeScanner::ignoreInvalidFunctions()
to ignore invalid functions instead throw an exception
- New interfaces:
ScannerInterface
andFunctionsScannerInterface
.
- Moved the package and dependencies to php-gettext organization
- Minimum PHP version supported is 7.2
- Added php7 strict typing
- Extractors have been split into two different types of classes to import translations:
- Scanners: To scan code files (like php, javascript, twig, etc) in order to collect gettext entries from many domains at the same time.
- Loaders: To load a translation format such po, mo, json, xliff, etc
- Split the
Translation
andTranslations
classes in different sub-classes to handle comments, flags, references, etc. For example, instead$translation->addComment('foo')
now it's$translation->getComments()->add('foo')
. - Simplified the options to merge translations with pre-configured options like
Merged::SCAN_AND_LOAD
. - The headers of translations are always sorted alphabetically.
- Changed the signature of all classes and interfaces.
- Extractors (now scanners and loaders), generators and translators were removed from this package and published as external packages, allowing to install only those that you need. Only Po and Mo formats are included by default.
- Removed magic classes like
Translations::fromPoFile
or$translation->toMoFile()
. Now, the scanners, loaders and generators are independent classes that have to be instantiated. - Removed
Merge::LANGUAGE_OVERRIDE
andMerge::DOMAIN_OVERRIDE
contants
- Improved code quality
- The library is easier to extend
- Translation id can be independent of the context + original values, in order to be more compatible with Xliff format.