From 6a59e538229b998418795a362202ea029ab78dd8 Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Sat, 11 Nov 2017 19:59:28 -0800 Subject: [PATCH 1/2] PHPdoc2 nit: Should be `@return`, not `@returns` --- src/Translator/TranslatorServiceFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Translator/TranslatorServiceFactory.php b/src/Translator/TranslatorServiceFactory.php index 552d18f4..45d5d971 100644 --- a/src/Translator/TranslatorServiceFactory.php +++ b/src/Translator/TranslatorServiceFactory.php @@ -41,7 +41,7 @@ public function __invoke(ContainerInterface $container, $requestedName, array $o * Proxies to `__invoke()`. * * @param ServiceLocatorInterface $serviceLocator - * @returns Translator + * @return Translator */ public function createService(ServiceLocatorInterface $serviceLocator) { From 6e8b23ea2150eb2bc5ef56e5aab4e1d16b1888fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Thu, 18 Jan 2018 13:29:53 +0100 Subject: [PATCH 2/2] Update view-helpers.md Enable use of `xgettext` to work with `translatePlural()` too --- doc/book/view-helpers.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/book/view-helpers.md b/doc/book/view-helpers.md index f4342fe6..48d93612 100644 --- a/doc/book/view-helpers.md +++ b/doc/book/view-helpers.md @@ -426,7 +426,7 @@ The `xgettext` utility can be used to compile `*.po` files from PHP source files translate view helper. ```bash -$ xgettext --language=php --add-location --keyword=translate my-view-file.phtml +$ xgettext --language=php --add-location --keyword=translate --keyword=translatePlural:1,2 my-view-file.phtml ``` See the [Gettext Wikipedia page](http://en.wikipedia.org/wiki/Gettext) for more information. @@ -489,6 +489,17 @@ where: `en_US`). If unset, it will use the default locale (return value of `Locale::getDefault()`). +### Gettext + +The `xgettext` utility can be used to compile `*.po` files from PHP source files containing the +translate view helper. + +```bash +$ xgettext --language=php --add-location --keyword=translate --keyword=translatePlural:1,2 my-view-file.phtml +``` + +See the [Gettext Wikipedia page](http://en.wikipedia.org/wiki/Gettext) for more information. + ### Public Methods Public methods for setting a `Zend\I18n\Translator\Translator` and a default