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

Appearance settings

Commit ab57eed

Browse filesBrowse files
committed
minor #6170 change translation getMessages() to getCatalogue() (snoek09)
This PR was squashed before being merged into the 2.8 branch (closes #6170). Discussion ---------- change translation getMessages() to getCatalogue() | Q | A | ------------- | --- | Doc fix? | no | New docs? | no | Applies to | 2.8 | Fixed tickets | #6137 I'm assuming here that the structure of the ``$messages`` variable didn't change. Commits ------- 06ca405 change translation getMessages() to getCatalogue()
2 parents 41e4f30 + 06ca405 commit ab57eed
Copy full SHA for ab57eed

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed

‎components/translation/usage.rst

Copy file name to clipboardExpand all lines: components/translation/usage.rst
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,11 @@ In case you want to use the same translation catalogue outside your application
376376
(e.g. use translation on the client side), it's possible to fetch raw translation
377377
messages. Just specify the required locale::
378378

379-
$messages = $translator->getMessages('fr_FR');
379+
$catalogue = $translator->getCatalogue('fr_FR');
380+
$messages = $catalogue->all();
381+
while ($catalogue = $catalogue->getFallbackCatalogue()) {
382+
$messages = array_replace_recursive($catalogue->all(), $messages);
383+
}
380384

381385
The ``$messages`` variable will have the following structure::
382386

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.