创新互联Angular教程:Angular 国际化-应用示例

浏览翻译后的范例应用

要浏览 Angular 国际化指南中使用的带法语翻译的范例应用,参见live example / 下载范例。

公司主营业务:成都网站制作、成都网站设计、外贸营销网站建设、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。创新互联公司是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。创新互联公司推出河南免费做网站回馈大家。

fr-CA 和 en-US 范例

以下选项卡显示示例应用程序和相关的翻译文件。

  • src/app/app.component.html
  • Hello i18n!

    I don't output any element
    Angular logo
    Updated {minutes, plural, =0 {just now} =1 {one minute ago} other {{{minutes}} minutes ago}} ({{minutes}})

    The author is {gender, select, male {male} female {female} other {other}}

    Updated: {minutes, plural, =0 {just now} =1 {one minute ago} other {{{minutes}} minutes ago by {gender, select, male {male} female {female} other {other}}}}
  • src/app/app.component.ts
    import { Component } from '@angular/core';
    
    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html'
    })
    export class AppComponent {
      minutes = 0;
      gender = 'female';
      fly = true;
      logo = 'https://angular.io/assets/images/logos/angular/angular.png';
      inc(i: number) {
        this.minutes = Math.min(5, Math.max(0, this.minutes + i));
      }
      male() { this.gender = 'male'; }
      female() { this.gender = 'female'; }
      other() { this.gender = 'other'; }
    }
  • src/app/app.module.ts
    import { NgModule } from '@angular/core';
    import { BrowserModule } from '@angular/platform-browser';
    
    import { AppComponent } from './app.component';
    
    @NgModule({
      imports: [ BrowserModule ],
      declarations: [ AppComponent ],
      bootstrap: [ AppComponent ]
    })
    export class AppModule { }
  • src/main.ts
    import { enableProdMode } from '@angular/core';
    import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
    
    import { AppModule } from './app/app.module';
    import { environment } from './environments/environment';
    
    if (environment.production) {
      enableProdMode();
    }
    
    platformBrowserDynamic().bootstrapModule(AppModule);
  • src/locale/messages.fr.xlf
    
    
      
        
          
            Hello i18n!
            An introduction header for this sample
            User welcome
          
          
            Hello i18n!
            Bonjour i18n !
            An introduction header for this sample
            User welcome
          
          
            I don't output any element
            Je n'affiche aucun élément
          
          
            Angular logo
            Logo d'Angular
          
          
            {VAR_PLURAL, plural, =0 {just now} =1 {one minute ago} other { minutes ago} }
            {VAR_PLURAL, plural, =0 {à l'instant} =1 {il y a une minute} other {il y a  minutes} }
          
          
            The author is 
            L'auteur est 
          
          
            {VAR_SELECT, select, male {male} female {female} other {other} }
            {VAR_SELECT, select, male {un homme} female {une femme} other {autre} }
          
          
            Updated: 
            Mis à jour: 
          
          
            {VAR_PLURAL, plural, =0 {just now} =1 {one minute ago} other { minutes ago by {VAR_SELECT, select, male {male} female {female} other {other} }} }
            {VAR_PLURAL, plural, =0 {à l'instant} =1 {il y a une minute} other {il y a  minutes par {VAR_SELECT, select, male {un homme} female {une femme} other {autre} }} }
          
          
            Hello
            Bonjour
          
        
      
    

本文标题:创新互联Angular教程:Angular 国际化-应用示例
分享网址:http://www.shufengxianlan.com/qtweb/news37/550787.html

网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联