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

[RFC][Translation] Deprecate resource_files in translator#32735

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

Closed
pierredup wants to merge1 commit intosymfony:4.4frompierredup:translation-paths

Conversation

@pierredup
Copy link
Contributor

@pierreduppierredup commentedJul 25, 2019
edited
Loading

QA
Branch?4.4
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed tickets#32708 (comment)
LicenseMIT
Doc PRTBD

The list of resource files is cached by the container at compile time. This means that any change in translation files (adding/removing a file) needs a rebuilt container t take effect.
This PR proposes to deprecate this behaviour and let the translator manage its own resources fully.

This approach is to pass a list of directories to the translator instead, which the translator can use to determine if the cache needs to be rebuilt. Any change in the directories means only the translator cache will be rebuilt while the container cache stays untouched.

The only time the container needs to be rebuilt is when a new translation directory is added (E.G when adding a new bundle).

I'm not 100% sure what effect this will have on 3rd-party bundles (I.E if a bundle explicitly requires this behaviour and can't pass directories instead), so any insights would be appreciated.

@carsonbotcarsonbot added Status: Needs Review RFCRFC = Request For Comments (proposals about features that you want to be discussed) Translation Feature Deprecation labelsJul 25, 2019
* @dataProvider getDebugModeAndCacheDirCombinations
* @group legacy
*/
publicfunctiontestResourceFilesOptionLoadsBeforeOtherAddedResources($debug,$enableCache)
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

With these changes, the following option is now unsupported

'resource_files' => ['some_locale' => ['messages.some_locale.loader']]

so a work-around will be needed for this scenario (Maybe adding a new option set loaders per locale?)

*
* * cache_dir: The cache directory (or null to disable caching)
* * debug: Whether to enable debugging or not (false by default)
* * resource_files: List of translation resources available grouped by locale.
Copy link
Member

Choose a reason for hiding this comment

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

the new option should be added

@stof
Copy link
Member

I know for sure that this will impacthttps://github.com/willdurand/BazingaJsTranslationBundle, which inspects the definition of the translator service to get the list of resources for its translation finder. The new logic would force the bundle to duplicate the whole location of file resources (maybe this indicates a need for a new service in core, so that they can use the same service than the translator rather than duplicating some internal logic).

@nicolas-grekasnicolas-grekas added this to thenext milestoneJul 26, 2019
@nicolas-grekas
Copy link
Member

BazingaJsTranslationBundle inspects the definition of the translator service to get the list of resources for its translation finder

Then we should ensure the new logic exposes a way to get the list of resources from the translator cache.@pierredup do you think it possible?

@fabpot
Copy link
Member

Closing as there is no more activities on this PR (and it cannot be merged as is). Fee free to reopen if you want to finish it.

@fabpotfabpot closed thisFeb 3, 2020
@nicolas-grekasnicolas-grekas modified the milestones:next,5.1May 4, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

Assignees

No one assigned

Labels

DeprecationFeatureRFCRFC = Request For Comments (proposals about features that you want to be discussed)Status: Needs ReviewTranslation

Projects

None yet

Milestone

5.1

Development

Successfully merging this pull request may close these issues.

5 participants

@pierredup@stof@nicolas-grekas@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp