Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Translation] Introduce a way to configure the enabled locales#32433

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

Merged
fabpot merged 1 commit intosymfony:masterfromjaviereguiluz:fix_31563
Feb 4, 2020

Conversation

javiereguiluz
Copy link
Member

QA
Branch?4.4
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#31563
LicenseMIT
Doc PR-

This implements the idea#31563 so we can decide if we want to add this or not. I tested it in the "Symfony Demo" app. Before: 107 catalogs created in cache/dev/translations/. After: 43 catalogs. But that's because the app is translated into lots of languages. In most cases, only 2 catalog files will be generated (vs 107 before).

If this idea is approved, I'll add tests and docs. Thanks.

yceruto, jvasseur, ro0NL, and andreybolonin reacted with thumbs up emoji
@fabpot
Copy link
Member

@javiereguiluz Can you rebase on current master? I'm wondering it we could use this new settings to automatically restrict_locale in URLs if no explicit requirement is set? Would that make sense?

apfelbox, keichinger, and Pierstoval reacted with thumbs up emoji

@javiereguiluz
Copy link
MemberAuthor

I've rebased and added a test, but please tell me any other test that you think it may be necessary. Thanks!

@javiereguiluzjaviereguiluz changed the base branch from4.4 tomasterDecember 3, 2019 16:43
@javiereguiluz
Copy link
MemberAuthor

I tweaked a bit the behavior of this option. It now works as follows:

# config/packages/translation.yamlframework:translator:# if you don't define this option or set it to null or [], all# catalogs are generated (same behavior as current versions)enabled_locales:nullenabled_locales:[]# if you define some values in this option, only those catalogs are generatedenabled_locales:['es', 'en']

@fabpot
Copy link
Member

Thank you@javiereguiluz.

fabpot added a commit that referenced this pull requestFeb 4, 2020
… locales (javiereguiluz)This PR was merged into the 5.1-dev branch.Discussion----------[Translation] Introduce a way to configure the enabled locales| Q             | A| ------------- | ---| Branch?       | 4.4| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#31563| License       | MIT| Doc PR        | -This implements the idea#31563 so we can decide if we want to add this or not. I tested it in the "Symfony Demo" app. Before: 107 catalogs created in cache/dev/translations/. After: 43 catalogs. But that's because the app is translated into lots of languages. In most cases, only 2 catalog files will be generated (vs 107 before).If this idea is approved, I'll add tests and docs. Thanks.Commits-------7658434 [Translation] Introduce a way to configure the enabled locales
@fabpotfabpot merged commit7658434 intosymfony:masterFeb 4, 2020
fabpot added a commit that referenced this pull requestFeb 4, 2020
…ales to build routes' default "_locale" requirement (nicolas-grekas)This PR was merged into the 5.1-dev branch.Discussion----------[FrameworkBundle] use framework.translator.enabled_locales to build routes' default "_locale" requirement| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| Deprecations? | no| Tickets       | -| License       | MIT| Doc PR        | -No need to configure the same requirements for `_locale` in all routes any more thanks to the `framework.translator.enabled_locales` config option introduced in#32433.Commits-------5eebd37 [FrameworkBundle] use framework.translator.enabled_locales to build routes' default "_locale" requirement
@nicolas-grekasnicolas-grekas modified the milestones:next,5.1May 4, 2020
@fabpotfabpot mentioned this pull requestMay 5, 2020
fabpot added a commit that referenced this pull requestJun 1, 2020
This PR was merged into the 5.1 branch.Discussion----------[FrameworkBundle] Fix enabled_locales behavior| Q             | A| ------------- | ---| Branch?       | 5.1| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       | -| License       | MIT| Doc PR        | -I was experimenting with enabled_locales on my application and I noticed the cache didn't actually change. It seems the generated service definition was invalid: the file `var/cache/dev/ContainerFEQLy1x/App_KernelDevDebugContainer.php` defined `getTranslator_DefaultService` by calling `new Translator` with 7 arguments instead of 6.It seems to be due to the fact that the DI extension does not replace the right argument. With the following fix applied the behavior works as expected.However, reading the comment of Javier in#32433, it seems he tested it against Demo and it worked with the previous code. I'm not sure why,@javiereguiluz I'd be interested in knowing if I'm missing something here :) .Commits-------e2ce7f5 Fix enabled_locales behavior
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ycerutoycerutoyceruto left review comments

@PierstovalPierstovalPierstoval left review comments

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@dunglasdunglasAwaiting requested review from dunglas

@lyrixxlyrixxAwaiting requested review from lyrixx

@srozesrozeAwaiting requested review from sroze

@xabbuhxabbuhAwaiting requested review from xabbuh

Assignees
No one assigned
Projects
None yet
Milestone
5.1
Development

Successfully merging this pull request may close these issues.

6 participants
@javiereguiluz@fabpot@nicolas-grekas@yceruto@Pierstoval@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp