We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent47fe03a commitf701f73Copy full SHA for f701f73
components/translation/usage.rst
@@ -371,3 +371,25 @@ use for translation::
371
372
.. _`L10n`:http://en.wikipedia.org/wiki/Internationalization_and_localization
373
.. _`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