Browse Source

fixed lang support in hlsdl

ncannasse 8 years ago
parent
commit
e5d58f6c49
1 changed files with 8 additions and 1 deletions
  1. 8 1
      hxd/System.hx

+ 8 - 1
hxd/System.hx

@@ -540,8 +540,15 @@ class System {
 		return false;
 	}
 
+	@:hlNative("std","sys_locale") static function getLocale() : hl.Bytes { return null; }
+
+	static var _lang : String;
 	static function get_lang() {
-		return "en";
+		if( _lang == null ) {
+			var str = @:privateAccess String.fromUCS2(getLocale());
+			_lang = ~/[.@_-]/g.split(str)[0];
+		}
+		return _lang;
 	}
 
 	static function get_width() {