From 719b11aa595cd2a7b41ef23717139f28aef78f7e Mon Sep 17 00:00:00 2001 From: Jay Trees Date: Tue, 22 Mar 2022 14:28:26 +0100 Subject: [PATCH] Make wish priorities translateable --- index.php | 19 ++++++++++++------- src/classes/wish.php | 33 +++++++++++++++++++-------------- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/index.php b/index.php index 1dad28b8..cd5f84a8 100644 --- a/index.php +++ b/index.php @@ -72,13 +72,6 @@ setcookie( $session['httponly'] ); -/** - * API - */ -if (isset($api)) { - return; -} - /** * Language */ @@ -105,6 +98,18 @@ if (file_exists($translationFilepath)) { $translations = $loader->loadFile($translationFilepath); } +/** + * Wish + */ +wishthis\Wish::initialize(); + +/** + * API + */ +if (isset($api)) { + return; +} + /** * Install */ diff --git a/src/classes/wish.php b/src/classes/wish.php index d857ceee..33edffc4 100644 --- a/src/classes/wish.php +++ b/src/classes/wish.php @@ -13,20 +13,25 @@ class Wish /** * Static */ - public static array $priorities = array( - '' => array( - 'name' => 'Default', - 'color' => '', - ), - '1' => array( - 'name' => 'Nice to have', - 'color' => 'black', - ), - '3' => array( - 'name' => 'Would love it', - 'color' => 'orange', - ), - ); + public static array $priorities; + + public static function initialize() + { + self::$priorities = array( + '' => array( + 'name' => __('Default'), + 'color' => '', + ), + '1' => array( + 'name' => __('Nice to have'), + 'color' => 'black', + ), + '3' => array( + 'name' => __('Would love it'), + 'color' => 'orange', + ), + ); + } /** * Non-Static