本文整理汇总了TypeScript中ionic-native.Globalization类的典型用法代码示例。如果您正苦于以下问题:TypeScript Globalization类的具体用法?TypeScript Globalization怎么用?TypeScript Globalization使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Globalization类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: if
this.storage.get('user').then((user) =>{
if(user != "" && user != undefined){
this.user = JSON.parse(user.toString());
}
this.storage.get('firstRun').then((resp) => {
if(this.user)
this.rootPage = TabsPage;
else if(resp != "" && user != undefined)
this.rootPage = LoginPage;
else
this.rootPage = SlidePage;
});
Splashscreen.hide();
Globalization.getPreferredLanguage().then((obj) =>{//get device language
console.log(obj.value);
this.initializeTranslateServiceConfig(obj.value.split('-')[0]);//initialize sending lowercase language
this.storage.set('language', obj.value.split('-')[0]);
}, (err)=>{
console.log(err);
this.initializeTranslateServiceConfig(defaultLanguage);//initialize sending lowercase language default
this.storage.set('language', defaultLanguage);
});
//this.initializeTranslateServiceConfig();
},
开发者ID:GECOR,项目名称:gecor-generic-2016,代码行数:27,代码来源:app.ts
示例2: initializeIosApp
initializeIosApp(){
this.confData.load();
this.rootPage = SlidePage;
this.initializePush();
Globalization.getPreferredLanguage().then((obj) =>{//get device language
console.log(obj.value);
this.initializeTranslateServiceConfig(obj.value.split('-')[0]);//initialize sending lowercase language
}, (err)=>{
console.log(err);
this.initializeTranslateServiceConfig(defaultLanguage);//initialize sending lowercase language default
});
Splashscreen.hide();
}
开发者ID:GECOR,项目名称:gecor-generic-2016,代码行数:17,代码来源:app.ts
示例3: initialize
/**
* @private
* @static
* Initializes the language retriever structure
* @return {void}
*/
private static initialize(): void {
Strings.language = Globalization.getPreferredLanguage()
.then( response => Strings.setLanguage(response.value))
.catch( error => Strings.setLanguage(''))
.then( language => TextMap[language]);
}
开发者ID:lefreire,项目名称:ionic,代码行数:12,代码来源:strings.ts
注:本文中的ionic-native.Globalization类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论