diff options
| author | RblSb <msrblsb@gmail.com> | 2021-07-04 03:59:50 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2021-07-05 17:04:25 +0300 |
| commit | ede45cea8706eb8540e466df9861c2af8ebf9c44 (patch) | |
| tree | 74a20a6f082173378f918b48b08542881f31749a /src/Lang.hx | |
| parent | 265b3e1fb56bb0e5f797b3b35227a616b108a0c3 (diff) | |
Reformat
Diffstat (limited to 'src/Lang.hx')
| -rw-r--r-- | src/Lang.hx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Lang.hx b/src/Lang.hx index 7b7642d..3bd6963 100644 --- a/src/Lang.hx +++ b/src/Lang.hx @@ -2,24 +2,25 @@ package; import haxe.Json; import haxe.io.Path; + +using Lambda; + #if (sys || nodejs) import sys.io.File; #else import haxe.Http; #end -using Lambda; private typedef LangMap = Map<String, String>; class Lang { - static final langs:Map<String, LangMap> = []; static var ids = ["en", "ru"]; #if (js && !nodejs) static var lang = js.Browser.navigator.language.substr(0, 2).toLowerCase(); #end - static function request(path:String, callback:(data:String)->Void):Void { + static function request(path:String, callback:(data:String) -> Void):Void { #if (sys || nodejs) callback(File.getContent(path)); #else @@ -29,7 +30,7 @@ class Lang { #end } - public static function init(folderPath:String, ?callback:()->Void):Void { + public static function init(folderPath:String, ?callback:() -> Void):Void { #if (js && !nodejs) // Filter unused languages ids = ids.filter(id -> id == lang || id == "en"); @@ -64,5 +65,4 @@ class Lang { return text == null ? key : text; } #end - } |
