Skip to content

[FrameworkBundle][Translation] moved cache to Translation component #11197

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? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #10628
License MIT

@@ -75,68 +63,10 @@ public function getLocale()
/**
* {@inheritdoc}
*/
protected function loadCatalogue($locale)
protected function initializeCatalogue($locale)
Copy link
Contributor

Choose a reason for hiding this comment

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

as this method is protected, and not private, this should be considered as a BC break

Copy link
Member

Choose a reason for hiding this comment

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

@romainneutron loadCatalogue still exists in the parent class. The change here is simply which method gets extended in FrameworkBundle. So it is not a BC break

Copy link
Contributor

Choose a reason for hiding this comment

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

that's right

@romainneutron
Copy link
Contributor

This is nice, it would solve the issue I had in Silex silexphp/Silex#875

@@ -54,17 +55,24 @@ class Translator implements TranslatorInterface
private $selector;

/**
* @var array
*/
private $options = array();
Copy link
Member

Choose a reason for hiding this comment

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

these should be protected for BC (they are protected in the FrameworkBundle translator currently)

@ddeboer
Copy link
Contributor

ddeboer commented Jun 22, 2014

👍

@rvanlaak
Copy link
Contributor

Awesome 👍 could this be introduced in 2.5.1 ? It also would be nice to see some test-results about the performance improvements.

@romainneutron
Copy link
Contributor

@rvanlaak If this PR is merged, it would be in master (2.6-dev), as new features are not added in stable banches (see http://symfony.com/doc/current/contributing/code/patches.html#choose-the-right-branch).

*
* @api
*/
public function __construct($locale, MessageSelector $selector = null)
public function __construct($locale, MessageSelector $selector = null, array $options = array())
Copy link
Member

Choose a reason for hiding this comment

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

Passing an array of options looks wrong to me.

@aitboudad
Copy link
Contributor Author

Closing in favor of #11373

@aitboudad aitboudad closed this Jul 17, 2014
fabpot added a commit that referenced this pull request Sep 5, 2014
…ion component (new PR) (aitboudad, OwlyCode)

This PR was merged into the 2.6-dev branch.

Discussion
----------

[FrameworkBundle][Translation] moved cache to Translation component (new PR)

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #10628
| License       | MIT
| Doc PR        |

This supersedes the PR #11197 (while including the changes made by it). I removed the `$options` argument for `Symfony\Component\Translation\Translator` and replaced it by a public method `enableCache($cacheDir, $debug = false)`. It aims to solve what @fabpot said about passing an array of options in #11197 <s>while not modifying the existing constructors</s>.

Commits
-------

30fed6a [Translation][Cache] Removed the options from the arguments of Translator
8b2d9a8 [FrameworkBundle][Translation] moved cache to Translation component
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.

6 participants