From 230b6cdfd421b6ad165d10cf3626e6d7fffadca4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 9 Sep 2020 15:14:52 +0200 Subject: [PATCH] Add method isLoaded($domain) --- htdocs/core/class/translate.class.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 549c82a9033..e711fc528a7 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -517,12 +517,21 @@ class Translate if ($fileread) $this->_tab_loaded[$newdomain] = 1; // Set domain file as loaded - if (empty($this->_tab_loaded[$newdomain])) $this->_tab_loaded[$newdomain] = 2; // Marque ce cas comme non trouve (no lines found for language) + if (empty($this->_tab_loaded[$newdomain])) $this->_tab_loaded[$newdomain] = 2; // Mark this case as not found (no lines found for language) return 1; } - + /** + * Get information with result of loading data for domain + * + * @param string $domain Domain to check + * @return int True if loaded + */ + public function isLoaded($domain) + { + return $this->_tab_loaded[$domain]; + } /** * Return translated value of key for special keys ("Currency...", "Civility...", ...).