From cea2573875f694597ff5a056586b56af486b243d Mon Sep 17 00:00:00 2001 From: JonatanRek Date: Fri, 11 Oct 2019 12:24:20 +0200 Subject: [PATCH] Lang MNG --- app/class/LangManager.php | 41 ++++++++++++++++++++ app/lang/pl.php | 78 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 app/class/LangManager.php create mode 100644 app/lang/pl.php diff --git a/app/class/LangManager.php b/app/class/LangManager.php new file mode 100644 index 0000000..6a218ec --- /dev/null +++ b/app/class/LangManager.php @@ -0,0 +1,41 @@ +lngCode = $lngCode; + } + + function load() + { + $file = './app/lang/en.php'; + $arrayFirst = include($file); + $file = './app/lang/' . $this->lngCode . '.php'; + $arraySecond = include($file); + $this->lngDatabase = array_merge($arrayFirst,$arraySecond); + return true; + } + + function get(string $stringKey) + { + if (isset($this->lngDatabase[$stringKey])) { + return $this->lngDatabase[$stringKey]; + } + return $stringKey; + } + + function echo(string $stringKey) + { + if (isset($this->lngDatabase[$stringKey])) { + return $this->lngDatabase[$stringKey]; + } + return $stringKey; + } +} diff --git a/app/lang/pl.php b/app/lang/pl.php new file mode 100644 index 0000000..6759ada --- /dev/null +++ b/app/lang/pl.php @@ -0,0 +1,78 @@ + 'Home', + 'm_dashboard' => 'Dashboard', + 'm_settings' => 'Setting', + 'm_automatization' => 'Automatization', + 'm_scenes' => 'Scenes', + 'm_log' => 'Log', + + //Buttons + 'b_year' => 'Year', + 'b_month' => 'Month', + 'b_week' => 'Week', + 'b_day' => 'Day', + 'b_hour' => 'Hour', + 'b_next' => 'Next', + 'b_create' => 'Create', + 'b_edit' => 'Edit', + 'b_remove' => 'Remove', + 'b_approve' => 'Approve', + 'b_disable' => 'Disable', + 'b_save' => 'Save', + + + //labels + 'l_choseDevice' => 'Chose device:', + 'l_inHome' => 'When entering', + 'l_outHome' => 'When exiting', + 'l_sunSet' => 'Sun Set', + 'l_sunRice' => 'Sun Rise', + 'l_time' => 'Time', + 'l_deviceValue' => 'Device Valalue', + 'l_runAt' => 'Run at', + 'l_resetAt' => 'Reset at', + 'l_affectedDevices' => 'Affected devices', + 'l_atDays' => 'At days', + 'l_read' => 'Read', + 'l_use' => 'Use', + 'l_edit' => 'Edit', + 'l_owner' => 'Owner', + 'l_member' => 'Home Member', + 'l_permission' => 'Permission', + 'l_inMinutes' => 'in minutes', + 'l_sleepTime' => 'Device sleep Time', + 'l_atHome' => 'At home', + 'l_nameAt' => 'Name', + + //Title + 't_createScene' => 'Create Scene', + 't_editScene' => 'Edit scénu', + + 't_createAutomation' => 'Create Automation', + + 't_editDevice' => 'Edit Device', + + //constants + 'humi' => 'Humidity', + 'temp' => 'Temperature', + 'light' => 'Light', + 'battery' => 'Batteri', + 'on/off' => 'Switch', + + //words + 'w_title' => 'Name', + 'w_icon' => 'Icon', + 'w_no' => 'no', + 'w_noOne' => 'noone', + 'w_someOne' => 'Some', + 'w_room' => 'Room', + 'w_moduls' => 'Moduls', + 'w_home' => 'Home', + 'w_neni' => 'At', + 'w_is' => 'is', + + //example + '' => '', +];