mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-12 10:31:09 +03:00
Save unknown localization strings to the database
This commit is contained in:
parent
1a3982d1b7
commit
1f899a3d80
@ -799,10 +799,19 @@ function get_localized_string($string, $locale)
|
|||||||
if (isset($localized[$string])) {
|
if (isset($localized[$string])) {
|
||||||
return $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') {
|
if ($locale != 'en') {
|
||||||
return get_localized_string($string, 'en');
|
return get_localized_string($string, 'en');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The string is not localized at all. Use it "as is".
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user