Commit 9fef42e
committed
I18N: Read the revision date key that GlotPress writes into .l10n.php files.
wp_get_l10n_php_file_data() maps `PO-Revision-Date` onto `po-revision-date`,
but GlotPress writes that value under `translation-revision-date`. The key core
looks for is absent from every language pack currently served, so the function
returns an empty revision date.
The name changed upstream. The `de_CH.l10n.php` fixture already in core reports
`GlotPress/4.0.0-beta.2` and uses `po-revision-date`, while packs generated by
`GlotPress/4.0.3` use `translation-revision-date`. The mapping was correct when
the function was added in 6.6 and stopped matching later. `Project-Id-Version`
and `X-Generator` still resolve, which is why nothing looked broken.
This matters because wp_get_installed_translations() falls back to this reader
when a translation has no sibling `.po` file, and the result is sent to
api.wordpress.org to decide which language packs are stale. An empty revision
date means an installed, current pack is offered again on every check.
Accept both spellings, preferring the current one, so files written before and
after the rename resolve.
`POT-Creation-Date` maps to `pot-creation-date`, which appears in neither
format, and is left alone rather than guessed at.
The existing coverage did not catch this because the only `.l10n.php` fixture it
asserts against predates the rename. Add a fixture in the current format and a
test that fails on trunk with an empty string.
Props bejignesh.
Fixes #65809.1 parent a105958 commit 9fef42e
3 files changed
Lines changed: 49 additions & 7 deletions
File tree
- src/wp-includes
- tests/phpunit
- data/l10n
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1682 | 1682 | | |
1683 | 1683 | | |
1684 | 1684 | | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
1685 | 1692 | | |
1686 | | - | |
1687 | | - | |
1688 | | - | |
1689 | | - | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
1690 | 1697 | | |
1691 | 1698 | | |
1692 | 1699 | | |
| |||
1696 | 1703 | | |
1697 | 1704 | | |
1698 | 1705 | | |
1699 | | - | |
1700 | | - | |
1701 | | - | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
1702 | 1712 | | |
1703 | 1713 | | |
1704 | 1714 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
157 | 187 | | |
158 | 188 | | |
159 | 189 | | |
| |||
0 commit comments