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

Commitf701f73

Browse files
committed
[Translation] added method to expose collected message
1 parent47fe03a commitf701f73

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

‎components/translation/usage.rst‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,3 +371,25 @@ use for translation::
371371

372372
.. _`L10n`:http://en.wikipedia.org/wiki/Internationalization_and_localization
373373
.. _`ISO 31-11`:http://en.wikipedia.org/wiki/Interval_(mathematics)#Notations_for_intervals
374+
375+
Retrieving the Message Catalogue
376+
--------------------------------
377+
378+
In case you want to use the same translation catalogue outside your application
379+
(e.g. use translation on a client side), it's possible to fetch raw translation messages.
380+
You just need to specify required locale::
381+
382+
$messages = $translator->getMessages('fr_FR');
383+
384+
``$messages`` will have the following structure::
385+
386+
array(
387+
'messages' => array(
388+
'Hello world' => 'Bonjour tout le monde',
389+
),
390+
'validators' => array(
391+
'Value should not be empty' => 'Valeur ne doit pas être vide',
392+
'Value is too long' => 'Valeur est trop long',
393+
),
394+
);
395+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp