Skip to content

[Translation][cache fallback] keep only missing messages in fallbackCatalogue. #14318

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

aitboudad
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets #14315
Tests pass? yes
License MIT

@@ -444,6 +430,14 @@ private function getFallbackContent(MessageCatalogue $catalogue)
$fallbackSuffix = ucfirst(preg_replace($replacementPattern, '_', $fallback));
$currentSuffix = ucfirst(preg_replace($replacementPattern, '_', $current));

$fallbackMessages = $fallbackCatalogue->all();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in else to avoid call if not needed as you replace it if not in debug anyway...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@mpdude
Copy link
Contributor

mpdude commented Apr 12, 2015

I don't think this optimizes anything?

@aitboudad aitboudad force-pushed the translation_catalogue_merge branch from 547c8a9 to 41fd50a Compare April 12, 2015 09:14
@aitboudad aitboudad force-pushed the translation_catalogue_merge branch from 41fd50a to 41f1ecc Compare April 12, 2015 11:08
@stof
Copy link
Member

stof commented Apr 12, 2015

@mpdude this PR is about fixing a bug in the previous optimization. and keeping only the missing messages rather than the whole fallback catalogue is about optimizing memory usage.

@stof
Copy link
Member

stof commented Apr 12, 2015

@nicolas-grekas we have a Fatal Error related to the Debug component in the deps=high build when running the TwigBundle tests. It would be great to investigate it

@mpdude
Copy link
Contributor

mpdude commented Apr 12, 2015

@stof sure, I understand what it is about. The thing is that this optimization and dropping the messages causes unintuitive and possibly BC breaking behaviour when getting the catalogue from the translator (#14315).

As this PR passes the tests from #14315 I wonder if it really fixes the problem or if the actual optimization does not happen anymore at all, although (at a glimpse) the code suggests it.

@aitboudad
Copy link
Contributor Author

@mpdude I removed your last commit(e9cb79d) as It won't pass and I think it's useless

@mpdude
Copy link
Contributor

mpdude commented Apr 12, 2015

No, it's not useless. It shows that your fix here does not suffice. Run it against a Symfony version before the optimization was introduced and it will pass.

@aitboudad
Copy link
Contributor Author

@mpdude ok no problem for me :)

@aitboudad aitboudad closed this Apr 12, 2015
@mpdude
Copy link
Contributor

mpdude commented Apr 12, 2015

I have an idea how we might be able to rescue this. It's not gonna be beautiful, but might work. Need to think about it a little more and will get back to you.

@aitboudad aitboudad deleted the translation_catalogue_merge branch April 14, 2015 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants