Selaa lähdekoodia

implemented System.lang in HL

Nicolas Cannasse 8 vuotta sitten
vanhempi
commit
193e8469bc
1 muutettua tiedostoa jossa 9 lisäystä ja 2 poistoa
  1. 9 2
      hxd/System.hx

+ 9 - 2
hxd/System.hx

@@ -778,8 +778,15 @@ class System {
 		return 72.;
 	}
 
+	@: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_isAndroid() {
@@ -821,7 +828,7 @@ class System {
 	}
 
 	public static function isVSync() {
-		#if hl
+		#if hlsdl
 		return win.vsync;
 		#else
 		return true;