diff options
Diffstat (limited to 'application')
-rw-r--r-- | application/Languages.php | 21 | ||||
-rw-r--r-- | application/PageBuilder.php | 1 |
2 files changed, 22 insertions, 0 deletions
diff --git a/application/Languages.php b/application/Languages.php new file mode 100644 index 00000000..c8b0a25a --- /dev/null +++ b/application/Languages.php | |||
@@ -0,0 +1,21 @@ | |||
1 | <?php | ||
2 | |||
3 | /** | ||
4 | * Wrapper function for translation which match the API | ||
5 | * of gettext()/_() and ngettext(). | ||
6 | * | ||
7 | * Not doing translation for now. | ||
8 | * | ||
9 | * @param string $text Text to translate. | ||
10 | * @param string $nText The plural message ID. | ||
11 | * @param int $nb The number of items for plural forms. | ||
12 | * | ||
13 | * @return String Text translated. | ||
14 | */ | ||
15 | function t($text, $nText = '', $nb = 0) { | ||
16 | if (empty($nText)) { | ||
17 | return $text; | ||
18 | } | ||
19 | $actualForm = $nb > 1 ? $nText : $text; | ||
20 | return sprintf($actualForm, $nb); | ||
21 | } | ||
diff --git a/application/PageBuilder.php b/application/PageBuilder.php index 1ca0260a..42932f32 100644 --- a/application/PageBuilder.php +++ b/application/PageBuilder.php | |||
@@ -80,6 +80,7 @@ class PageBuilder | |||
80 | if (!empty($GLOBALS['plugin_errors'])) { | 80 | if (!empty($GLOBALS['plugin_errors'])) { |
81 | $this->tpl->assign('plugin_errors', $GLOBALS['plugin_errors']); | 81 | $this->tpl->assign('plugin_errors', $GLOBALS['plugin_errors']); |
82 | } | 82 | } |
83 | $this->tpl->assign('token', getToken($this->conf)); | ||
83 | // To be removed with a proper theme configuration. | 84 | // To be removed with a proper theme configuration. |
84 | $this->tpl->assign('conf', $this->conf); | 85 | $this->tpl->assign('conf', $this->conf); |
85 | } | 86 | } |