當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript angular-l10n.LocaleService類代碼示例

本文整理匯總了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;未經允許,請勿轉載。