Skip to content

Commit 972295c

Browse files
committed
feature #44484 [Translation] [Loco] Send If-Modified-Since header when possible (Kocal)
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 possible
2 parents d780c09 + e2364c6 commit 972295c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Resources/config/translation_providers.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
service('logger'),
5252
param('kernel.default_locale'),
5353
service('translation.loader.xliff'),
54+
service('translator'),
5455
])
5556
->tag('translation.provider_factory')
5657

0 commit comments

Comments
 (0)