You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fff5e52
Browse filesBrowse the repository at this point in the historyBrowse files
* Migrate to gettext/gettext v5
gettext/gettext v5 no longer ships extractors, the Jed and PHP array
generators or the PHP functions scanner, and changes the data model
(immutable merges, nullable getters, sorted headers and flags,
references grouped by file).
To keep the output of all commands unchanged:
* Add `Translation` and `Translations` classes on top of the v5 ones
that keep headers, flags and references in the order they were added
and provide the default headers that v4 used to set.
* Add a PO loader and PO/MO generators. The ones in v5 treat "0" as an
empty string, which drops `msgid "0"` entries and `msgstr "0"`
translations when reading, merging and writing files.
* Port the PHP functions scanner from v4, as it is no longer part of
the library.
* Make the extractors and the Jed and PHP array generators standalone
classes.
* Implement the merge strategies used by `update-po` and
`make-pot --merge/--subtract-and-merge` on top of the v5 API.
Two intentional fixes on the way: headers of a PO file that only
consists of a header entry without a trailing newline are no longer
ignored, and strings with `\u{...}` escapes no longer trigger a
`hexdec()` deprecation.
* Fix PHPStan errors
Narrow the return types of the `create()` factories, read comments
through `toArray()`, and make numeric ranges explicit.
* Fix type annotation for scanner constants
* Keep data of plain gettext translations in insert()
* Assert the translated value in the MO generator test
* Use the header, flag and reference order of gettext/gettext v5
Drop the classes that kept headers, flags and references in the order
they were added. Headers and flags are now sorted alphabetically and
references are grouped by file, as the library does by default.
The keys in generated PHP files keep their order.
* Use the PO loader and generators of gettext/gettext 5.7.4
5.7.4 treats "0" as a valid string, so the local copies of the PO
loader, the PO and MO generators and the `Translation` subclass are no
longer needed.
* PO and POT files are loaded with the library's loader. Entries that
appear more than once in a file are still merged.
* `make-mo` uses the library's MO generator.
* `update-po` writes PO files with the library's generator. This keeps
file-level comments with `--no-purge`, the `#, fuzzy` header flag and
`#|` previous strings, and reactivates obsolete entries that are back
in the POT file.
* The POT generator keeps its own output format, as POT files need
empty `msgstr[0]` and `msgstr[1]` lines for plurals.
* Fix PHPStan error when merging duplicate entries
* Mark removed strings as obsolete with `update-po --no-purge`
Entries that are no longer in the POT file were kept as active entries,
although the option is documented to keep them marked with `#~`.
* Harden PO loading and writing in `update-po`
* Stop when the source POT file cannot be read instead of treating it
as empty, which would remove all entries from the PO files.
* Prefix every line of a multiline obsolete entry with `#~`.
gettext/gettext writes the continuation lines without it.
* When merging duplicate entries, also treat a `#` line after an entry
as its end, as the PO loader does.
* Add Behat scenario for an unreadable POT file in `update-po`
* Use gettext/php-scanner to find functions in PHP code
Replaces the tokenizer-based scanner ported from gettext/gettext 4.x
with the one from gettext/php-scanner, which uses nikic/php-parser.
The subclass only adds error recovery, so that a file with a syntax
error is still scanned instead of being skipped. As before, only the
translator comment closest to a function call is extracted, and the
lines of a multiline comment are joined with spaces.
gettext/php-scanner is required as dev-master until 2.1.0 is released.
* Fix PHPStan error for comment prefixes
* Require gettext/php-scanner 2.1
0 commit comments