Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle] [Security] Remove trans from the security/core in 2.3 & dir loading #16141

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

Merged
merged 1 commit into from
Oct 6, 2015
Merged

[FrameworkBundle] [Security] Remove trans from the security/core in 2.3 & dir loading #16141

merged 1 commit into from
Oct 6, 2015

Conversation

ogizanagi
Copy link
Contributor

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

See #16139 (comment).

I think the most efficient solution is to remove translations from Security/Core in 2.3 only (should not be propagated to newest branches!) and load both folders if they exist.

@nicolas-grekas
Copy link
Member

👍

@ogizanagi
Copy link
Contributor Author

Another solution is to load Security/Core/Resources/translations only if the Security/Core/composer.json file exists (since 2.4).

$dirs[] = $translationsDir;
if (file_exists($translationsDir = dirname($r->getFilename()).'/../Resources/translations')) {
// with Symfony 2.4, the Security component was split into several subpackages
// and the translations have been moved to the symfony/security-core package
Copy link
Member

Choose a reason for hiding this comment

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

Actually, this comment is not completely right (we have translations in both packages). And by the way, having duplicated translations directories leads to inconsistent translations (for example, #15955 changed only one of the two translation files).

Copy link
Member

Choose a reason for hiding this comment

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

Well, we have them outside of Core for BC reasons (using them is deprecated and they are removed in 3.0)

Copy link
Member

Choose a reason for hiding this comment

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

Well, but then removing them from core in Symfony 2.3 is confusing for users imho if they should rely on them again after upgrading.

Copy link
Member

Choose a reason for hiding this comment

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

Well, they should be no translation in security-core in 2.3 (they have been moved there in 2.4). the existing ones there in the 2.3 branch are mistakes when switching branch for merges IMO

@stof
Copy link
Member

stof commented Oct 6, 2015

You should not load both folders in the translator IMO. this would create more work for the loader by loading security translations twice, while the second one will be overwritten.

What we should have to avoid missing translations in the new location is a unit test checking that both files are in sync in 2.4+ (actually 2.7+ because of maintained branches)

@ogizanagi
Copy link
Contributor Author

Ok. I've just updated the PR. If the Security/Core/composer.json file exists, that means the installed version of the symfony/security-core is 2.4 since it only exists as a subpackage since 2.4.
Then, we'll only load Security/Core/Resources/translations.

Otherwise, use Security/Resources/translations.

@stof
Copy link
Member

stof commented Oct 6, 2015

👍 for this.

@nicolas-grekas be careful when merging. the removal of the 2 translation files should be reverted when propagating the merge to newer branches

@xabbuh
Copy link
Member

xabbuh commented Oct 6, 2015

👍

Status: Reviewed

@nicolas-grekas
Copy link
Member

Thank you @ogizanagi.

@nicolas-grekas nicolas-grekas merged commit 1ed07a0 into symfony:2.3 Oct 6, 2015
nicolas-grekas added a commit that referenced this pull request Oct 6, 2015
…ity/core in 2.3 & dir loading (ogizanagi)

This PR was merged into the 2.3 branch.

Discussion
----------

[FrameworkBundle] [Security] Remove trans from the security/core in 2.3 & dir loading

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

See #16139 (comment).

I think the most efficient solution is to remove translations from `Security/Core` in 2.3 only (should not be propagated to newest branches!) and load both folders if they exist.

Commits
-------

1ed07a0 [FrameworkBundle] [Security] Remove trans from the security/core in 2.3 & dir loading
@ogizanagi ogizanagi deleted the framework_ext_trans_load branch October 6, 2015 13:18
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.

5 participants