mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-07 16:24:43 +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])) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user