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] Fixed the addition of the fallbackLocale catalogue to the current locale catalogue.#116

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
3 commits merged intosymfony:masterfromcristiangsp:Translation_FallbackLocale
Feb 27, 2011
Merged

[Translation] Fixed the addition of the fallbackLocale catalogue to the current locale catalogue.#116

3 commits merged intosymfony:masterfromcristiangsp:Translation_FallbackLocale
Feb 27, 2011

Conversation

@cristiangsp
Copy link

When loading a catalogue the function "optimizeCatalogue" add the fallback catalogue to the current locale catalogue. This should be done by first adding the language catalogue and finally adding the fallbacklocale catalogue specified in the configuration. This subsequent additions are done by the "loadCatalogue" function.

The problem is that in the "loadCatalogue" function exists an if statement that checks if the resource of a given locale exists before loading it. If not, the function simply returns. This return implies that the subsequent addition of the fallbacklocale wouldn't be done.

This has been fixed by simply replacing the current if statement and adding a new one that, if the resource exists, then executes the process of resource loading. Finally, the function continue calling the "optimizeCatalogue" function.

@fabpot
Copy link
Member

Can you add some unit tests that show the problem you fix with this patch?

@cristiangsp
Copy link
Author

I have modified the actual FallbackLocale test trying to show the behaviour that shows the error.

cgonzalez added3 commitsFebruary 27, 2011 12:32
When the current locale catalogue doesn't contain the id searched, the code doesn't search in the fallbacklocale catalogue (as is explained in the documentation).Added the search to the fallbacklocale catalogue to the translation function.
…he current locale catalogue.When loading a catalogue the function "optimizeCatalogue" add the fallback catalogue to the current locale catalogue. This should be done by first adding the language catalogue and finally adding the fallbacklocale catalogue specified in the configuration. This subsequent additions are done by the "loadCatalogue" function.The problem is that in the "loadCatalogue" function exists an if statement that checks if the resource of a given locale exists before loading it. If not, the function simply returns. This return implies that the subsequent addition of the fallbacklocale wouldn't be done.This has been fixed by simply replacing the current if statement and adding a new one that, if the resource exists, then executes the process of resource loading. Finally, the function continue calling the "optimizeCatalogue" function.
…cale"Now the test shows the behavior when is requested a translation to an undefined locale catalogue and, therefore, the fallbacklocale catalogue must be queried. The original test function only checks the step to reach the language catalog not to the fallbacklocale one (even the fallbacklocale isn't set). This test gives error in the current version of symfony/symfony.
SofHad pushed a commit to SofHad/symfony that referenced this pull requestOct 12, 2015
This PR was merged into the master branch.Discussion----------Romanian translationRomanian translations based onsymfony#80Commits-------4b89fbc Romanian translation
jderusse pushed a commit to jderusse/symfony that referenced this pull requestMar 30, 2020
jderusse pushed a commit to jderusse/symfony that referenced this pull requestMar 30, 2020
I was off by one in one situation and all of 2.5.x is vulnerable.Refssymfony#116
chalasr pushed a commit to chalasr/symfony that referenced this pull requestSep 24, 2020
This pull request wasclosed.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@cristiangsp@fabpot@stof

[8]ページ先頭

©2009-2025 Movatter.jp