From 578d21120a4aa43b4f42837af60dcbbea481a260 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 20 May 2015 08:34:40 +0200 Subject: make design elements translateable --- include/bbcode.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'include/bbcode.php') diff --git a/include/bbcode.php b/include/bbcode.php index c6d756cdd..1f5a65399 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -175,12 +175,29 @@ function bb_parse_element($match) { $j = json_decode(base64url_decode($match[1]),true); if ($j) { - $o = EOL . '' . t('Install ' . $j['type'] . ' element: ') . $j['pagetitle'] . '' . EOL; + $text = sprintf( t('Install %s element: '), translate_design_element($j['type'])) . $j['pagetitle']; + $o = EOL . '' . $text . '' . EOL; } return $o; } +function translate_design_element($type) { + switch($type) { + case 'webpage': + $ret = t('webpage'); + break; + case 'layout': + $ret = t('layout'); + break; + case 'block': + $ret = t('block'); + break; + } + + return $ret; +} + /** * @brief Returns an QR-code image from a value given in $match[1]. * -- cgit v1.2.3