Skip to content

Commit

Permalink
better locale detection
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Oct 4, 2023
1 parent 4051d3a commit 650ba7b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion haxe/ui/backend/PlatformImpl.hx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@ class PlatformImpl extends PlatformBase {
}

public override function getSystemLocale():String {
return Browser.navigator.language;
var systemLocale = null;
var htmlTag = Browser.document.body.parentElement;
if (htmlTag != null) {
systemLocale = htmlTag.lang;
}

if (systemLocale == null) {
systemLocale = Browser.navigator.language;
}
return systemLocale;
}

private static var _vscrollWidth:Float = -1;
Expand Down

0 comments on commit 650ba7b

Please sign in to comment.