translate options use null coalesce

This commit is contained in:
Yurii
2026-03-14 09:42:10 +02:00
parent f23634ee61
commit 1aabf6eea6
+2 -6
View File
@@ -139,13 +139,9 @@ class Language {
* @returns {string}
*/
translateOption(value, field, scope) {
let translation = this.translate(field, 'options', scope);
const map = this.translate(field, 'options', scope) ?? {};
if (typeof translation !== 'object') {
translation = {};
}
return translation[value] || value;
return map[value] || value;
}
/**