From 7cf88556b3e86f57a13ca39be74348063e1fb505 Mon Sep 17 00:00:00 2001 From: stephaneDiot Date: Mon, 6 Mar 2017 11:27:33 +0100 Subject: [PATCH] PlatformUI translation doc --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 9be9db013..7174c1b62 100644 --- a/README.md +++ b/README.md @@ -157,3 +157,22 @@ Then, you can run the unit tests with: ``` $ php vendor/bin/phpunit ``` + +* Translation + +To use translations in PlatformUI you have to use : + In the javascript files: + +```javascript + Y.eZ.trans('the.string.identifier', {}, 'domainname') + ``` + + In templates : + +```template + {{ translate 'the.string.identifier' 'domainname' }} + ``` + +To generate the .xlf translation file (in PlatformUIBundle/Ressources/translations) +you need to use the script defined in PlatformUIBundle/bin/extract-translations.sh +(https://github.com/ezsystems/PlatformUIBundle/blob/master/bin/extract-translations.sh)