Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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
Member
fabpot commentedFeb 27, 2011
Can you add some unit tests that show the problem you fix with this patch? |
Author
cristiangsp commentedFeb 27, 2011
I have modified the actual FallbackLocale test trying to show the behaviour that shows the error. |
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
Add recent CakePHP issue.
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
Open DevTools when !headless
This pull request wasclosed.
Sign up for freeto 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.