[Translation] Fixed the addition of the fallbackLocale catalogue to the current locale catalogue.#116
Merged
3 commits merged intosymfony:masterfrom Feb 27, 2011
cristiangsp:Translation_FallbackLocale
Merged
[Translation] Fixed the addition of the fallbackLocale catalogue to the current locale catalogue.#1163 commits merged intosymfony:masterfrom cristiangsp:Translation_FallbackLocale
3 commits merged intosymfony:masterfrom
cristiangsp:Translation_FallbackLocale
Conversation
Member
|
Can you add some unit tests that show the problem you fix with this patch? |
Author
|
I have modified the actual FallbackLocale test trying to show the behaviour that shows the error. |
added 3 commits
February 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 request
Oct 12, 2015
This PR was merged into the master branch. Discussion ---------- Romanian translation Romanian translations based on symfony#80 Commits ------- 4b89fbc Romanian translation
jderusse
pushed a commit
to jderusse/symfony
that referenced
this pull request
Mar 30, 2020
Add recent CakePHP issue.
jderusse
pushed a commit
to jderusse/symfony
that referenced
this pull request
Mar 30, 2020
I was off by one in one situation and all of 2.5.x is vulnerable. Refs symfony#116
chalasr
pushed a commit
to chalasr/symfony
that referenced
this pull request
Sep 24, 2020
Open DevTools when !headless
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.