mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-07 16:24:43 +03:00
Check for installation in get_localized_string function
This commit is contained in:
parent
037b823db9
commit
8384a58118
@ -792,8 +792,12 @@ function get_localized_string($string, $locale)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The string is not localized, save it to the database to provide an
|
// The string is not localized, save it to the database to provide an
|
||||||
// ability to translate it from the UI later.
|
// ability to translate it from the UI later. At the same time we cannot
|
||||||
save_message($locale, $string, $string);
|
// rely on the database during installation, thus we should check if the
|
||||||
|
// installation is in progress.
|
||||||
|
if (!installation_in_progress()) {
|
||||||
|
save_message($locale, $string, $string);
|
||||||
|
}
|
||||||
|
|
||||||
// One can change english strings from the UI. Try to use these strings.
|
// One can change english strings from the UI. Try to use these strings.
|
||||||
if ($locale != 'en') {
|
if ($locale != 'en') {
|
||||||
@ -813,13 +817,6 @@ function get_localized_string($string, $locale)
|
|||||||
*/
|
*/
|
||||||
function save_message($locale, $key, $value)
|
function save_message($locale, $key, $value)
|
||||||
{
|
{
|
||||||
if (installation_in_progress()) {
|
|
||||||
// We cannot save a message if the installation is in progres because
|
|
||||||
// there are no guarantees that database is initialized and has all
|
|
||||||
// necessary tables. Just do nothing in that case.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$db = Database::getInstance();
|
$db = Database::getInstance();
|
||||||
|
|
||||||
// Check if the string is already in the database.
|
// Check if the string is already in the database.
|
||||||
|
Loading…
Reference in New Issue
Block a user