本文整理汇总了TypeScript中angular-l10n.LocaleService类的典型用法代码示例。如果您正苦于以下问题:TypeScript LocaleService类的具体用法?TypeScript LocaleService怎么用?TypeScript LocaleService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LocaleService类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(public locale: LocaleService, public translation: TService) {
this.locale.addConfiguration()
.addLanguages(['en', 'es'])
.setCookieExpiration(30)
.defineLanguage('es')
this.translation.addConfiguration()
.addProvider('./assets/locale-')
this.translation.init()
}
开发者ID:caom92,项目名称:Espresso,代码行数:11,代码来源:app.module.ts
示例2: constructor
// Constructor del modulo raiz importa aquellos servicios que seran globales
// para todos los demas modulos
constructor(
private home: HomeElementsService,
private langManager: LanguageService,
public locale: LocaleService,
public translation: TService
) {
this.locale.addConfiguration()
.addLanguages(['en', 'es'])
.setCookieExpiration(30)
.defineLanguage('es');
this.translation.addConfiguration()
.addProvider('./assets/locale-');
this.translation.init()
}
开发者ID:caom92,项目名称:Espresso,代码行数:18,代码来源:app.root.ts
示例3: selectLanguage
public selectLanguage(language: string): void {
this.locale.setCurrentLanguage(language)
/*setTimeout(function () {
$("select").material_select()
}, 200)*/
localStorage.lang = language
}
开发者ID:caom92,项目名称:Espresso,代码行数:7,代码来源:app.translation.ts
示例4: load
load(): Promise<any> {
this.locale.addConfiguration()
.addLanguages(['en', 'sr'])
.setCookieExpiration(30)
.defineDefaultLocale('sr', 'RS').defineCurrency('RSD');
this.locale.init();
this.translation.addConfiguration()
.addProvider('./assets/locale/locale-');
this.translation.init();
const promise: Promise<any> = new Promise((resolve: any) => {
this.translation.translationChanged.subscribe(() => {
resolve(true);
});
});
this.translation.init();
return promise;
}
开发者ID:imijatovic16,项目名称:vocarescar,代码行数:23,代码来源:app.module.ts
示例5: selectLocale
selectLocale(language: string, country: string, currency: string): void {
this.locale.setDefaultLocale(language, country);
this.locale.setCurrentCurrency(currency);
location.reload();
}
开发者ID:imijatovic16,项目名称:vocarescar,代码行数:5,代码来源:header.component.ts
示例6: selectLanguage
public selectLanguage(language: string): void {
this.locale.setCurrentLanguage(language)
this.locale.setDefaultLocale(language, "US");
this.locale.setCurrentCurrency("USD");
this.storage.set("lang", language)
}
开发者ID:caom92,项目名称:Espresso,代码行数:6,代码来源:app.translation.ts
注:本文中的angular-l10n.LocaleService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论