aboutsummaryrefslogtreecommitdiffstats
path: root/src/Lang.hx
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2023-04-23 12:34:38 +0300
committerRblSb <msrblsb@gmail.com>2023-04-23 12:34:38 +0300
commit341ec5ce86d1220060f63d2681b6e8eae11ec488 (patch)
treeaa232347348a0bdc75814bed30e057c8af00d237 /src/Lang.hx
parentb25ebe9ce888b516c6478be2592052a7916a736f (diff)
Use null coalescing op
Diffstat (limited to 'src/Lang.hx')
-rw-r--r--src/Lang.hx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Lang.hx b/src/Lang.hx
index 3bd6963..a146e3d 100644
--- a/src/Lang.hx
+++ b/src/Lang.hx
@@ -56,13 +56,13 @@ class Lang {
public static function get(lang:String, ?key:String):String {
if (langs[lang] == null) lang = "en";
final text = langs[lang][key];
- return text == null ? key : text;
+ return text ?? key;
}
#else
public static function get(key:String):String {
if (langs[lang] == null) lang = "en";
final text = langs[lang][key];
- return text == null ? key : text;
+ return text ?? key;
}
#end
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage