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.7.0 - 2022-07-27
- StrictPoLoader, a stricter PO loader more aligned with the syntax of the GNU gettext tooling #282.
- Previous attributes (msgctxt, msgid, msgid_plural) to the Translation class and the PO generator #282.
- Minor performance improvements to the Translations class #282.
5.6.1 - 2021-12-04
- PHP 8.1 support #278.
5.6.0 - 2021-11-05
- New method
addFlag
toParsedFunction
, that allows to assign flags by scanners. - The
FunctionsHandlersTrait
has an abstractaddFlags
method.
5.5.4 - 2020-12-20
- TypeError in which numeric entries were converted to integers #265
5.5.3 - 2020-12-01
- Add PHP 8 to composer.json
5.5.2 - 2020-11-17
5.5.1 - 2020-06-08
- Type error in which numeric filenames were converted to integers #260
5.5.0 - 2020-05-23
- New option
addReferences()
to configure the code scanners whether add or not references #258
- BREAKING: Moved some code from
CodeScanner
to the newFunctionsHandlersTrait
in order to better reuse.
5.4.1 - 2020-03-15
- PoGenerator includes the description and flags of the translations #253
5.4.0 - 2020-03-07
- Added
_
function to the list of functions scanned by default - Added
Translations::setDescription()
andTranslations::getDescription()
methods #251 - Added
Translations::getFlags()
that returns aFlags
object to assign flags to the entire po file #251
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
5.0.0 - 2019-11-04
- 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.