Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Translation] [Loco] SendIf-Modified-Since
header when possible#44484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[Translation] [Loco] SendIf-Modified-Since
header when possible#44484
Uh oh!
There was an error while loading.Please reload this page.
Conversation
If-Modified-Since\
header when possible, close #44414If-Modified-Since\
header when possible, close #44414If-Modified-Since\
header when possible, close #44414If-Modified-Since
header when possible, close #44414<xsd:element name="prop-group"> | ||
<xsd:complexType> | ||
<xsd:sequence maxOccurs="unbounded"> | ||
<xsd:element ref="xlf:prop"/> | ||
</xsd:sequence> | ||
<xsd:attribute name="name" type="xsd:string" use="optional"/> | ||
</xsd:complexType> | ||
</xsd:element> | ||
<xsd:element name="prop"> | ||
<xsd:complexType> | ||
<xsd:simpleContent> | ||
<xsd:extension base="xsd:string"> | ||
<xsd:attribute name="prop-type" type="xsd:string" use="required"/> | ||
<xsd:attribute ref="xml:lang" use="optional"/> | ||
</xsd:extension> | ||
</xsd:simpleContent> | ||
</xsd:complexType> | ||
</xsd:element> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I had to add declarationsprop-group
/prop
, otherwise it breaks because we have some validations on XLIFF files.
I'm not sure to understand why PHPUnit tests are failing:
The file Do someknow what's going on here? Thanks! |
carsonbot commentedDec 7, 2021
Hey! I think@rvanlaak has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
welcoMattic left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Here are some little comments.
I guess we need to update the changelog of Translation component, because this PR add support ofprop-group
andprop
XLIFF tags?
WDYT@stof@nicolas-grekas?
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Thanks for your comments :) We still have the issue when running tests, and this issue only happens in CI:
ping@nicolas-grekas@stof, do you know what can happens here? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks great already. Do you have an idea whether the other translation providers also support theIf-Modified-Since
header?
src/Symfony/Component/Translation/CatalogueMetadataAwareInterface.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Translation/CatalogueMetadataAwareInterface.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
If-Modified-Since
header when possible, close #44414If-Modified-Since
header when possibleUh oh!
There was an error while loading.Please reload this page.
Status: needs review |
If-Modified-Since
header when possibleIf-Modified-Since
header when possibleThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Code is ok for me, but we will need@nicolas-grekas or@stof help to fix the failing test, I have difficulties to understand what is wrong here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Adding BC layers for the added constructor parameters should help fixing the failing tests, at least the high-deps one.
For low-deps, we may need to bump thesymfony/translation
requirement in Loco Bridge's composer.json to^6.1
to make it always has the new interfaces.
src/Symfony/Component/Translation/CatalogueMetadataAwareInterface.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Translation/Bridge/Loco/LocoProviderFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
New constructor parameters should be mentioned in CHANGELOG/UPGRADE files also |
Kocal commentedDec 21, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks for your comments@chalasr, the The failures are unrelated IMO. Status: needs review |
...fony/Component/Translation/Bridge/Loco/Tests/LocoProviderFactoryWithoutTranslatorBagTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
...fony/Component/Translation/Bridge/Loco/Tests/LocoProviderFactoryWithoutTranslatorBagTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
...fony/Component/Translation/Bridge/Loco/Tests/LocoProviderFactoryWithoutTranslatorBagTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Review comments have been addressed, deprecations have been removed and some tests fixed. Status: needs review |
...fony/Component/Translation/Bridge/Loco/Tests/LocoProviderFactoryWithoutTranslatorBagTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
*/ | ||
class LocoProviderFactoryWithoutTranslatorBagTest extends LocoProviderFactoryTest | ||
{ | ||
use ExpectDeprecationTrait; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I guess the full test case can be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think it would be nice to ensure theLocoProviderFactory
still works even without theTranslatorBag
. WDYT?
src/Symfony/Component/Translation/Bridge/Loco/Tests/LocoProviderWithoutTranslatorBagTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Translation/Bridge/Loco/Tests/LocoProviderWithoutTranslatorBagTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
The PR has been rebased, failures are not related. |
Is there anything else to do? |
Thank you@Kocal. |
Uh oh!
There was an error while loading.Please reload this page.
This PR is a proposal for#44414.
When pulling translations from Loco, we save the
Last-Modified
response header in eachMessageCatalogue
thanks to the newCatalogueMetadataAwareInterface
.When pulling translations one more time from Loco, we send the previous
Last-Modified
response header asIf-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