Skip to content

[2.8][Translation] added message cache. #14526

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 1 commit into from

Conversation

aitboudad
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets #13676
Tests pass? yes
License MIT
# app/config/config.yml
framework:
    translator:
        cache: translation.cache.default

The message cache Interface contains now only one method:

interface MessageCacheInterface
{
    public function cache($locale, array $options = array());
}

for more details see #13986.

@aitboudad aitboudad force-pushed the translation_message_cache branch 2 times, most recently from cf5dd74 to cc6556d Compare May 3, 2015 00:53
use Symfony\Component\Config\ConfigCacheFactory;

/**
* @author Abdellatif Ait Boudad <a.aitboudad@gmail.com>
Copy link
Contributor

Choose a reason for hiding this comment

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

boudad is lowercase 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😴

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 thanks

Copy link
Contributor

Choose a reason for hiding this comment

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

on his own last name nice @pborreli

@aitboudad aitboudad force-pushed the translation_message_cache branch from cc6556d to 3d1a39f Compare May 3, 2015 00:59
@mpdude
Copy link
Contributor

mpdude commented May 3, 2015

Why do you think do we need another interface for this and make the Translator aware of it?

I mean, why can't we just decorate the Translator with a caching layer that keeps the results of trans() and transChoice() in (shared) memory?

@aitboudad
Copy link
Contributor Author

@mpdude The current implementation try to simplify the Translator itself and to not be aware of how to caching and also it provide the consistant way to override MessageCatalogue.
Decorating solve the issue but it isn't ideal as it's attempt to not call trans() and transChoice() of the Translator which can make hard to handle other decorated class like LoggingTranslator or DataCollectorTranslator for example.

@aitboudad
Copy link
Contributor Author

closed in favor of #14671.

@aitboudad aitboudad closed this May 18, 2015
@aitboudad aitboudad deleted the translation_message_cache branch May 18, 2015 18:11
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