mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
region property added;chnage in how to get the language in android
This commit is contained in:
@@ -15,6 +15,7 @@ export class device implements definition.device {
|
||||
private static _sdkVersion: string;
|
||||
private static _deviceType: string;
|
||||
private static _language: string;
|
||||
private static _region: string;
|
||||
|
||||
static get manufacturer(): string {
|
||||
return "Apple";
|
||||
@@ -84,6 +85,14 @@ export class device implements definition.device {
|
||||
|
||||
return device._language;
|
||||
}
|
||||
|
||||
static get region(): string {
|
||||
if(!device._region) {
|
||||
device._region = NSLocale.currentLocale().objectForKey(NSLocaleCountryCode);
|
||||
}
|
||||
|
||||
return device._region;
|
||||
}
|
||||
}
|
||||
|
||||
var mainScreen: MainScreen;
|
||||
|
||||
Reference in New Issue
Block a user