Skip to content

Commit

Permalink
Add multiline support
Browse files Browse the repository at this point in the history
  • Loading branch information
vinkla committed May 20, 2016
1 parent 5feb57e commit 2372db3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
5 changes: 3 additions & 2 deletions src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@
* 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.');
}

foreach ($groups as $group => $translations) {
foreach ($translations as $key => $description) {
pll_register_string($description, $key, $group);
pll_register_string($description, $key, $group, $multiline);
}
}
}
Expand Down

0 comments on commit 2372db3

Please sign in to comment.