Save unknown localization strings to the database

This commit is contained in:
Dmitriy Simushev 2014-06-27 11:35:14 +00:00
parent 1a3982d1b7
commit 1f899a3d80

View File

@ -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;
}