fix redundant error logs: can not get any translations

This commit is contained in:
xiaomlove
2022-04-27 02:16:36 +08:00
parent e0d0d219b1
commit d002156f78

View File

@@ -607,10 +607,9 @@ function nexus_trans($key, $replace = [], $locale = null)
$getKey = $locale . "." . $key;
$result = arr_get($translations, $getKey);
if (empty($result) && $locale != 'en') {
do_log("original getKey: $getKey can not get any translations", 'error');
$getKey = "en." . $key;
$result = arr_get($translations, $getKey);
} else {
do_log("original getKey: $getKey can not get any translations", 'error');
}
if (!empty($replace)) {
$search = array_map(function ($value) {return ":$value";}, array_keys($replace));