From ec825b751d9b71f5983c27fe5387b0258d62864f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 18 Nov 2020 12:08:34 +0100 Subject: [sysconfig] Screensaver: Restructure translations --- .../sysconfig/addmodule_screensaver.inc.php | 40 ++++++++++++---------- 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'modules-available/sysconfig/addmodule_screensaver.inc.php') diff --git a/modules-available/sysconfig/addmodule_screensaver.inc.php b/modules-available/sysconfig/addmodule_screensaver.inc.php index 889a94e5..d8c189f7 100644 --- a/modules-available/sysconfig/addmodule_screensaver.inc.php +++ b/modules-available/sysconfig/addmodule_screensaver.inc.php @@ -25,22 +25,22 @@ class Screensaver_Start extends AddModule_Base } else { $this->session_data = array( 'title' => '', - 'qss' => Dictionary::translateFileModule('sysconfig', 'template-tags', 'lang_screenQssDefault', true), + 'qss' => Dictionary::translate('saver_QssDefault', true), 'messages' => array( 'General' => array( - 'shutdown' => Dictionary::translateFileModule('sysconfig', 'template-tags', 'lang_screenMessageDefaultShutdown', true), - 'shutdown-locked' => Dictionary::translateFileModule('sysconfig', 'template-tags', 'lang_screenMessageDefaultShutdownLocked', true), - 'idle-kill' => Dictionary::translateFileModule('sysconfig', 'template-tags', 'lang_screenMessageDefaultIdleKill', true), - 'idle-kill-locked' => Dictionary::translateFileModule('sysconfig', 'template-tags', 'lang_screenMessageDefaultIdleKillLocked', true), - 'no-timeout' => Dictionary::translateFileModule('sysconfig', 'template-tags', 'lang_screenMessageDefaultNoTimeout', true), - 'no-timeout-locked' => Dictionary::translateFileModule('sysconfig', 'template-tags', 'lang_screenMessageDefaultNoTimeoutLocked', true), + 'shutdown' => Dictionary::translate('saver_MessageDefaultShutdown', true), + 'shutdown-locked' => Dictionary::translate('saver_MessageDefaultShutdownLocked', true), + 'idle-kill' => Dictionary::translate('saver_MessageDefaultIdleKill', true), + 'idle-kill-locked' => Dictionary::translate('saver_MessageDefaultIdleKillLocked', true), + 'no-timeout' => Dictionary::translate('saver_MessageDefaultNoTimeout', true), + 'no-timeout-locked' => Dictionary::translate('saver_MessageDefaultNoTimeoutLocked', true), ) ), 'texts' => array( - 'text-shutdown' => Dictionary::translateFileModule('sysconfig', 'template-tags', 'lang_screenTextDefaultShutdown', true), + 'text-shutdown' => Dictionary::translate('saver_TextDefaultShutdown', true), 'text-shutdown-locked' => '', - 'text-idle-kill' => Dictionary::translateFileModule('sysconfig', 'template-tags', 'lang_screenTextDefaultIdleKill', true), - 'text-idle-kill-locked' => Dictionary::translateFileModule('sysconfig', 'template-tags', 'lang_screenTextDefaultIdleKillLocked', true), + 'text-idle-kill' => Dictionary::translate('saver_TextDefaultIdleKill', true), + 'text-idle-kill-locked' => Dictionary::translate('saver_TextDefaultIdleKillLocked', true), 'text-no-timeout' => '', 'text-no-timeout-locked' => '', ), @@ -110,14 +110,18 @@ class Screensaver_Text extends AddModule_Base /* Prepare and translate labels for the frontend */ $data['id'] = $next; /* Convert the id to a language tag (camelCase) styled string */ - $tag = explode('-', $next); - foreach ($tag as $key => $value) { - $tag[$key] = ucwords($value); - } - $tag = implode($tag); - - $data['title'] = Dictionary::translateFileModule('sysconfig', 'template-tags', 'lang_screenTitle' . $tag, true); - $data['description'] = Dictionary::translateFileModule('sysconfig', 'template-tags', 'lang_screenDescription' . $tag, true);; + $tag = implode(array_map('ucwords', explode('-', $next))); + + /* For translate module: + * Dictionary::translate('saver_TitleNoTimeout'); + * Dictionary::translate('saver_DescriptionNoTimeout'); + * Dictionary::translate('saver_TitleIdleKill'); + * Dictionary::translate('saver_DescriptionIdleKill'); + * Dictionary::translate('saver_TitleShutdown'); + * Dictionary::translate('saver_DescriptionShutdown'); + */ + $data['title'] = Dictionary::translate('saver_Title' . $tag, true); + $data['description'] = Dictionary::translate('saver_Description' . $tag, true);; $data['msg_value'] = $this->session_data['messages']['General'][$next]; $data['msg_locked_value'] = $this->session_data['messages']['General'][$next . '-locked']; $data['text_value'] = $this->session_data['texts']['text-' . $next]; -- cgit v1.2.3-55-g7522