From 21b85d0316482f4d522e40a866af1f2f8cde11c9 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Tue, 18 Nov 2025 09:35:28 -0700 Subject: [PATCH] Get the language from settings and re-use it --- .../resources/classes/destinations.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/destinations/resources/classes/destinations.php b/app/destinations/resources/classes/destinations.php index 40ade37edd..bd68ad9b18 100644 --- a/app/destinations/resources/classes/destinations.php +++ b/app/destinations/resources/classes/destinations.php @@ -83,6 +83,7 @@ private $table; private $uuid_prefix; private $select_mode; + private $language; /** * Called when the object is created @@ -113,6 +114,9 @@ //set the select_mode $this->select_mode = $this->settings->get('destinations', 'select_mode', 'default'); + + //get the language + $this->language = $this->settings->get('domain', 'language'); } /** @@ -401,7 +405,7 @@ //add multi-lingual support if (file_exists($_SERVER["PROJECT_ROOT"]."/app/".$name."/app_languages.php")) { - $text2 = $language2->get($this->settings->get('domain', 'language'), 'app/'.$name); + $text2 = $language2->get($this->language, 'app/'.$name); } if (!empty($row['result']['data']) && !empty($row['select_value'][$destination_type])) { @@ -536,11 +540,11 @@ //add multi-lingual support if (file_exists($_SERVER["PROJECT_ROOT"]."/app/".$key."/app_languages.php")) { - $text2 = $language2->get($this->settings->get('domain', 'language'), 'app/'.$key); + $text2 = $language2->get($this->language, 'app/'.$key); $found = 'true'; } if ($key == 'other') { - $text2 = $language2->get($this->settings->get('domain', 'language'), 'app/dialplans'); + $text2 = $language2->get($this->language, 'app/dialplans'); } //add the application to the select list $response .= " \n"; @@ -614,7 +618,7 @@ //add multi-lingual support if (file_exists($_SERVER["PROJECT_ROOT"]."/app/".$name."/app_languages.php")) { $language2 = new text; - $text2 = $language2->get($this->settings->get('domain', 'language'), 'app/'.$name); + $text2 = $language2->get($this->language, 'app/'.$name); } if (!empty($row['result']['data']) && !empty($row['select_value'][$destination_type])) { @@ -726,7 +730,7 @@ //add multi-lingual support if (file_exists($_SERVER["PROJECT_ROOT"]."/app/".$name."/app_languages.php")) { $language2 = new text; - $text2 = $language2->get($this->settings->get('domain', 'language'), 'app/'.$name); + $text2 = $language2->get($this->language, 'app/'.$name); } if (isset($row['result']) && isset($row['result']['data'][0]) && !empty($row['select_value'][$destination_type])) {