diff --git a/CHANGELOG-1.0.md b/CHANGELOG-1.0.md index ab5c8bb..7b6af46 100644 --- a/CHANGELOG-1.0.md +++ b/CHANGELOG-1.0.md @@ -3,6 +3,10 @@ CHANGELOG for 1.0.x This changelog references any relevant changes introduced in 1.0 minor versions. +* 1.0.6 (2020-04-17) + * **Misc. Updates:** + * Change processing function and removed unnecessary code for speed up.. + * 1.0.5 (2020-03-17) * **Misc. Updates:** * Added Missing translations. diff --git a/UIComponents/Dashboard/Homepage/Items/Articles.php b/UIComponents/Dashboard/Homepage/Items/Articles.php index d251b41..591e204 100644 --- a/UIComponents/Dashboard/Homepage/Items/Articles.php +++ b/UIComponents/Dashboard/Homepage/Items/Articles.php @@ -20,7 +20,7 @@ public static function getIcon() : string public static function getTitle() : string { - return self::dynamicTranslation("Articles"); + return "Articles"; } public static function getRouteName() : string diff --git a/UIComponents/Dashboard/Homepage/Items/Categories.php b/UIComponents/Dashboard/Homepage/Items/Categories.php index 3001713..16f391e 100644 --- a/UIComponents/Dashboard/Homepage/Items/Categories.php +++ b/UIComponents/Dashboard/Homepage/Items/Categories.php @@ -20,7 +20,7 @@ public static function getIcon() : string public static function getTitle() : string { - return self::dynamicTranslation("Categories"); + return "Categories"; } public static function getRouteName() : string diff --git a/UIComponents/Dashboard/Homepage/Items/Folders.php b/UIComponents/Dashboard/Homepage/Items/Folders.php index dc7018e..5d33690 100644 --- a/UIComponents/Dashboard/Homepage/Items/Folders.php +++ b/UIComponents/Dashboard/Homepage/Items/Folders.php @@ -20,7 +20,7 @@ public static function getIcon() : string public static function getTitle() : string { - return self::dynamicTranslation("Folders"); + return "Folders"; } public static function getRouteName() : string diff --git a/UIComponents/Dashboard/Homepage/Items/SpamSettings.php b/UIComponents/Dashboard/Homepage/Items/SpamSettings.php index 9bbc682..1d7ac49 100644 --- a/UIComponents/Dashboard/Homepage/Items/SpamSettings.php +++ b/UIComponents/Dashboard/Homepage/Items/SpamSettings.php @@ -20,7 +20,7 @@ public static function getIcon() : string public static function getTitle() : string { - return self::dynamicTranslation("Spam Settings"); + return "Spam Settings"; } public static function getRouteName() : string diff --git a/UIComponents/Dashboard/Homepage/Sections/Knowledgebase.php b/UIComponents/Dashboard/Homepage/Sections/Knowledgebase.php index 4ad4dce..1a9aa77 100644 --- a/UIComponents/Dashboard/Homepage/Sections/Knowledgebase.php +++ b/UIComponents/Dashboard/Homepage/Sections/Knowledgebase.php @@ -8,12 +8,12 @@ class Knowledgebase extends HomepageSection { public static function getTitle() : string { - return self::dynamicTranslation("Knowledgebase"); + return "Knowledgebase"; } public static function getDescription() : string { - return self::dynamicTranslation("Knowledgebase is a source of rigid and complex information which helps Customers to help themselves"); + return "Knowledgebase is a source of rigid and complex information which helps Customers to help themselves"; } public static function getRoles() : array diff --git a/UIComponents/Dashboard/Navigation/Knowledgebase.php b/UIComponents/Dashboard/Navigation/Knowledgebase.php index 1b95ec4..fad09fd 100644 --- a/UIComponents/Dashboard/Navigation/Knowledgebase.php +++ b/UIComponents/Dashboard/Navigation/Knowledgebase.php @@ -22,7 +22,7 @@ public static function getIcon() : string public static function getTitle() : string { - return self::dynamicTranslation("Knowledgebase"); + return "Knowledgebase"; } public static function getRouteName() : string @@ -39,50 +39,4 @@ public function getChildrenRoutes() : array { return []; } - - public static function dynamicTranslation($data) : string - { - $request = Request::createFromGlobals(); - $path = $request->getPathInfo(); - $locale = explode("/", $path); - $translator = new Translator($locale[1]); - - switch($locale[1]) - { - case 'en': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.en.yml", 'en'); - break; - case 'es': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.es.yml", 'es'); - break; - case 'fr': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.fr.yml", 'fr'); - break; - case 'da': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.da.yml", 'da'); - break; - case 'de': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.de.yml", 'de'); - break; - case 'it': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.it.yml", 'it'); - break; - case 'ar': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.ar.yml", 'ar'); - break; - case 'tr': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.tr.yml", 'tr'); - break; - } - - return $translator->trans($data); - } } diff --git a/UIComponents/Dashboard/Search/Articles.php b/UIComponents/Dashboard/Search/Articles.php index 62e654c..49163d6 100644 --- a/UIComponents/Dashboard/Search/Articles.php +++ b/UIComponents/Dashboard/Search/Articles.php @@ -22,7 +22,7 @@ public static function getIcon() : string public static function getTitle() : string { - return self::dynamicTranslation("Articles"); + return "Articles"; } public static function getRouteName() : string @@ -34,50 +34,4 @@ public function getChildrenRoutes() : array { return []; } - - public static function dynamicTranslation($data) : string - { - $request = Request::createFromGlobals(); - $path = $request->getPathInfo(); - $locale = explode("/", $path); - $translator = new Translator($locale[1]); - - switch($locale[1]) - { - case 'en': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.en.yml", 'en'); - break; - case 'es': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.es.yml", 'es'); - break; - case 'fr': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.fr.yml", 'fr'); - break; - case 'da': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.da.yml", 'da'); - break; - case 'de': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.de.yml", 'de'); - break; - case 'it': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.it.yml", 'it'); - break; - case 'ar': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.ar.yml", 'ar'); - break; - case 'tr': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.tr.yml", 'tr'); - break; - } - - return $translator->trans($data); - } } diff --git a/UIComponents/Dashboard/Search/Categories.php b/UIComponents/Dashboard/Search/Categories.php index 0399310..9e26d06 100644 --- a/UIComponents/Dashboard/Search/Categories.php +++ b/UIComponents/Dashboard/Search/Categories.php @@ -22,7 +22,7 @@ public static function getIcon() : string public static function getTitle() : string { - return self::dynamicTranslation("Categories"); + return "Categories"; } public static function getRouteName() : string @@ -34,50 +34,4 @@ public function getChildrenRoutes() : array { return []; } - - public static function dynamicTranslation($data) : string - { - $request = Request::createFromGlobals(); - $path = $request->getPathInfo(); - $locale = explode("/", $path); - $translator = new Translator($locale[1]); - - switch($locale[1]) - { - case 'en': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.en.yml", 'en'); - break; - case 'es': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.es.yml", 'es'); - break; - case 'fr': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.fr.yml", 'fr'); - break; - case 'da': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.da.yml", 'da'); - break; - case 'de': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.de.yml", 'de'); - break; - case 'it': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.it.yml", 'it'); - break; - case 'ar': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.ar.yml", 'ar'); - break; - case 'tr': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.tr.yml", 'tr'); - break; - } - - return $translator->trans($data); - } } diff --git a/UIComponents/Dashboard/Search/Customers.php b/UIComponents/Dashboard/Search/Customers.php index 19902c8..0fae43a 100644 --- a/UIComponents/Dashboard/Search/Customers.php +++ b/UIComponents/Dashboard/Search/Customers.php @@ -22,7 +22,7 @@ public static function getIcon() : string public static function getTitle() : string { - return self::dynamicTranslation("Customers"); + return "Customers"; } public static function getRouteName() : string @@ -34,50 +34,4 @@ public function getChildrenRoutes() : array { return []; } - - public static function dynamicTranslation($data) : string - { - $request = Request::createFromGlobals(); - $path = $request->getPathInfo(); - $locale = explode("/", $path); - $translator = new Translator($locale[1]); - - switch($locale[1]) - { - case 'en': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.en.yml", 'en'); - break; - case 'es': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.es.yml", 'es'); - break; - case 'fr': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.fr.yml", 'fr'); - break; - case 'da': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.da.yml", 'da'); - break; - case 'de': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.de.yml", 'de'); - break; - case 'it': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.it.yml", 'it'); - break; - case 'ar': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.ar.yml", 'ar'); - break; - case 'tr': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.tr.yml", 'tr'); - break; - } - - return $translator->trans($data); - } } diff --git a/UIComponents/Dashboard/Search/Folders.php b/UIComponents/Dashboard/Search/Folders.php index f9373ee..ea17d8b 100644 --- a/UIComponents/Dashboard/Search/Folders.php +++ b/UIComponents/Dashboard/Search/Folders.php @@ -22,7 +22,7 @@ public static function getIcon() : string public static function getTitle() : string { - return self::dynamicTranslation("Folders"); + return "Folders"; } public static function getRouteName() : string @@ -34,50 +34,4 @@ public function getChildrenRoutes() : array { return []; } - - public static function dynamicTranslation($data) : string - { - $request = Request::createFromGlobals(); - $path = $request->getPathInfo(); - $locale = explode("/", $path); - $translator = new Translator($locale[1]); - - switch($locale[1]) - { - case 'en': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.en.yml", 'en'); - break; - case 'es': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.es.yml", 'es'); - break; - case 'fr': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.fr.yml", 'fr'); - break; - case 'da': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.da.yml", 'da'); - break; - case 'de': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.de.yml", 'de'); - break; - case 'it': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.it.yml", 'it'); - break; - case 'ar': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.ar.yml", 'ar'); - break; - case 'tr': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.tr.yml", 'tr'); - break; - } - - return $translator->trans($data); - } } diff --git a/UIComponents/Dashboard/Search/SpamSettings.php b/UIComponents/Dashboard/Search/SpamSettings.php index 479831f..7ebd1b4 100644 --- a/UIComponents/Dashboard/Search/SpamSettings.php +++ b/UIComponents/Dashboard/Search/SpamSettings.php @@ -22,7 +22,7 @@ public static function getIcon() : string public static function getTitle() : string { - return self::dynamicTranslation("Spam Settings"); + return "Spam Settings"; } public static function getRouteName() : string @@ -34,50 +34,4 @@ public function getChildrenRoutes() : array { return []; } - - public static function dynamicTranslation($data) : string - { - $request = Request::createFromGlobals(); - $path = $request->getPathInfo(); - $locale = explode("/", $path); - $translator = new Translator($locale[1]); - - switch($locale[1]) - { - case 'en': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.en.yml", 'en'); - break; - case 'es': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.es.yml", 'es'); - break; - case 'fr': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.fr.yml", 'fr'); - break; - case 'da': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.da.yml", 'da'); - break; - case 'de': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.de.yml", 'de'); - break; - case 'it': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.it.yml", 'it'); - break; - case 'ar': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.ar.yml", 'ar'); - break; - case 'tr': - $translator->addLoader('yaml', new YamlFileLoader()); - $translator->addResource('yaml',__DIR__."/../../../../../../translations/messages.tr.yml", 'tr'); - break; - } - - return $translator->trans($data); - } }