Commit 972295c
committed
feature #44484 [Translation] [Loco] Send
This PR was squashed before being merged into the 6.1 branch.
Discussion
----------
[Translation] [Loco] Send `If-Modified-Since` header when possible
| Q | A
| ------------- | ---
| Branch? | 6.1 <!-- see below -->
| Bug fix? | no
| New feature? | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix #44414 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
This PR is a proposal for #44414.
When pulling translations from Loco, we save the `Last-Modified` response header in each `MessageCatalogue` thanks to the new `CatalogueMetadataAwareInterface`.
When pulling translations one more time from Loco, we send the previous `Last-Modified` response header as `If-Modified-Since` request header if it's available.
If Loco returns a 304, we don't update current translations. If it's not the case, we keep the original behaviour.
_Catalogue metadata_ can be used to store metadata about the catalogue itself and not about translations.
Actually, only `.xliff` format is supported (read/write).
WDYT?
Thanks!
cc @welcoMattic
Commits
-------
052aea5ecc [Translation] [Loco] Send `If-Modified-Since` header when possibleIf-Modified-Since header when possible (Kocal)1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
0 commit comments