-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[#18637][TranslationDebug] workaround for getFallbackLocales. #20465
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Q | A |
---|---|
Branch? | 2.7 |
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | #18637 |
License | MIT |
Doc PR | ~ |
if (is_dir($path)) { | ||
$loader->loadMessages($path, $fallbackCatalogue); | ||
} | ||
$fallbackLocales = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
array()
} catch (\Throwable $e) { | ||
} | ||
} elseif ($translator instanceof Translator) { | ||
$fallbackLocales = $translator->getFallbackLocales(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about a new interface for this? Or at least actually define this method? Imo. we should not rely on the magic __call
behavior of these translators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about a new interface for this?
seems better!
Imo. we should not rely on the magic __call behavior of these translators.
right, It was added for BC and I think we should deprecate this behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I defined this method for the moment
991d20a
to
31deea1
Compare
@aitboudad since you introduced two new public method, could you please add tests for them ? |
Thank you @aitboudad. |
…es. (aitboudad) This PR was merged into the 2.7 branch. Discussion ---------- [#18637][TranslationDebug] workaround for getFallbackLocales. | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #18637 | License | MIT | Doc PR | ~ Commits ------- 31deea1 [TranslationDebug] workaround for getFallbackLocales.