From 2372db32cb6a428f27c7e390ebcdb64c167a55e9 Mon Sep 17 00:00:00 2001 From: Vincent Klaiber Date: Fri, 20 May 2016 16:01:20 +0200 Subject: [PATCH] Add multiline support --- CHANGELOG.md | 1 + src/helpers.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00b5b44..556220d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 1.0.1 (released 2016-05-20) - Add lang to trans helper +- Add multiline support ## 1.0.0 (released 2016-05-11) diff --git a/src/helpers.php b/src/helpers.php index bce1352..d2cf19a 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -16,12 +16,13 @@ * Register translations. * * @param array $groups + * @param bool $multiline * * @throws \BadFunctionCallException * * @return void */ - function register_translations(array $groups) + function register_translations(array $groups, $multiline = false) { if (!function_exists('pll_register_string')) { throw new BadFunctionCallException('Please active the Polylang plugin.'); @@ -29,7 +30,7 @@ function register_translations(array $groups) foreach ($groups as $group => $translations) { foreach ($translations as $key => $description) { - pll_register_string($description, $key, $group); + pll_register_string($description, $key, $group, $multiline); } } }