דלגו לתוכן
Angular i18n

פתרון Angular i18n

תמיכה ב-Standalone Components, Signals ו-SSR עבור אפליקציות Angular.

Get started in 3 steps

1

Install

Add the Better I18N Angular package to your project.

terminal
npm install @better-i18n/angular
2

Import the module

Import BetterI18nModule in your AppModule or standalone component.

app.module.ts
import { BetterI18nModule } from '@better-i18n/angular';

@NgModule({
  imports: [
    BetterI18nModule.forRoot({
      projectId: 'your-org/your-project',
      defaultLocale: 'en',
    }),
  ],
})
export class AppModule {}
3

Use the translate pipe

Use the translate pipe or directive in your templates to display translations.

app.component.html
<h1>{{ 'welcome' | translate }}</h1>
<p>{{ 'greeting' | translate: { name: userName } }}</p>

תכונות

תמיכה ב-Standalone Components
Pipes לתרגום
דירקטיבות i18n
שירותים להזרקה
מודולים בטעינה עצלה
תמיכה בקומפילציית AOT
Angular Universal SSR
תמיכה ב-Signals
אינטגרציה עם Angular CLI

התחלה מהירה

הוסף i18n לאפליקציית Angular שלך עם pipes ושירותים.

// app.component.ts
import { Component } from '@angular/core';
import { TranslateService } from '@better-i18n/angular';

@Component({
  selector: 'app-root',
  template: `
    <h1>{{ 'welcome' | translate }}</h1>
    <p>{{ 'greeting' | translate: { name: 'World' } }}</p>
  `
})
export class AppComponent {
  constructor(private translate: TranslateService) {
    translate.setDefaultLang('en');
  }
}

עובד עם ספריות i18n פופולריות של Angular

Better I18N משלים את ספריית ה-i18n של Angular — נהל תרגומים ויזואלית, שתף פעולה עם מתרגמים ופרוס דרך CDN.

Better I18N + @ngx-translate/core

ספריית התרגום הנפוצה ביותר ל-Angular. תרגומי runtime עם pipes, directives והזרקת שירותים.

Better I18N מייצא לפורמט JSON של ngx-translate. ערוך תרגומים בדשבורד, סנכרן אוטומטית עם הריפו שלך.

Better I18N + Angular i18n (built-in)

מערכת ה-i18n הרשמית של Angular עם קומפילציית AOT, ביטויי ICU וחילוץ תרגומים בזמן בנייה.

ייצוא לפורמט Angular XLIFF. Better I18N מנהל את תהליך התרגום, Angular CLI בונה חבילות ספציפיות ל-locale.

Better I18N + Transloco

ספריית i18n מודרנית וקלת משקל ל-Angular עם טעינה עצלנית, פלאגינים עשירים ותמיכה מצוינת ב-TypeScript.

סנכרן תרגומים לפורמט JSON של Transloco דרך אינטגרציית GitHub של Better I18N. עדכונים בזמן אמת עם הפצת CDN.

התחילו לבנות עם Angular i18n

יש תוכנית חינמית. אין צורך בכרטיס אשראי.