mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-05-18 06:37:28 +08:00
fix redundant error logs: can not get any translations
This commit is contained in:
@@ -607,10 +607,9 @@ function nexus_trans($key, $replace = [], $locale = null)
|
|||||||
$getKey = $locale . "." . $key;
|
$getKey = $locale . "." . $key;
|
||||||
$result = arr_get($translations, $getKey);
|
$result = arr_get($translations, $getKey);
|
||||||
if (empty($result) && $locale != 'en') {
|
if (empty($result) && $locale != 'en') {
|
||||||
|
do_log("original getKey: $getKey can not get any translations", 'error');
|
||||||
$getKey = "en." . $key;
|
$getKey = "en." . $key;
|
||||||
$result = arr_get($translations, $getKey);
|
$result = arr_get($translations, $getKey);
|
||||||
} else {
|
|
||||||
do_log("original getKey: $getKey can not get any translations", 'error');
|
|
||||||
}
|
}
|
||||||
if (!empty($replace)) {
|
if (!empty($replace)) {
|
||||||
$search = array_map(function ($value) {return ":$value";}, array_keys($replace));
|
$search = array_map(function ($value) {return ":$value";}, array_keys($replace));
|
||||||
|
|||||||
Reference in New Issue
Block a user