소스 검색

fixed lang support in hlsdl

ncannasse 8 년 전
부모
커밋
e5d58f6c49
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  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() {