瀏覽代碼

implemented System.lang in HL

Nicolas Cannasse 8 年之前
父節點
當前提交
193e8469bc
共有 1 個文件被更改,包括 9 次插入2 次删除
  1. 9 2
      hxd/System.hx

+ 9 - 2
hxd/System.hx

@@ -778,8 +778,15 @@ class System {
 		return 72.;
 		return 72.;
 	}
 	}
 
 
+	@:hlNative("std","sys_locale") static function getLocale() : hl.Bytes { return null; }
+
+	static var _lang : String;
 	static function get_lang() {
 	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_isAndroid() {
 	static function get_isAndroid() {
@@ -821,7 +828,7 @@ class System {
 	}
 	}
 
 
 	public static function isVSync() {
 	public static function isVSync() {
-		#if hl
+		#if hlsdl
 		return win.vsync;
 		return win.vsync;
 		#else
 		#else
 		return true;
 		return true;