From 1f899a3d80dcc93a7cf5fea489cbd6f12484cee8 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Fri, 27 Jun 2014 11:35:14 +0000 Subject: [PATCH] Save unknown localization strings to the database --- src/mibew/libs/common/locale.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mibew/libs/common/locale.php b/src/mibew/libs/common/locale.php index b7190e0c..9d870f3d 100644 --- a/src/mibew/libs/common/locale.php +++ b/src/mibew/libs/common/locale.php @@ -799,10 +799,19 @@ function get_localized_string($string, $locale) if (isset($localized[$string])) { return $localized[$string]; } + + // The string is not localized, save it to the database to provide an + // ability to translate it from the UI later. + if (!installation_in_progress()) { + save_message($locale, $string, $string); + } + + // One can change english strings from the UI. Try to use these strings. if ($locale != 'en') { return get_localized_string($string, 'en'); } + // The string is not localized at all. Use it "as is". return $string; }