transla-x
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

TranslateX: Angular Internationalization and Localization for Free | Format Data Locale

Transla-X is an Angular translation library that provides localization support for multi-language applications. It offers a translation service, a translation pipe, and an interceptor for loading translations dynamically. It allows you to easily translate your application's content based on the selected language.

Table of Contents

Features

  • Dynamic loading of translations for supported languages
  • Translation service for retrieving translated values
  • Translation pipe for translating content in templates
  • Interceptor for intercepting HTTP requests and loading translations

Installation

To install the Transla-X library, you can use npm or yarn. Run the following command in your Angular project:

Run bash `npm install transla-x` or Run bash `yarn add transla-x`

Usage

  1. Import the TranslaXModule in your Angular application's module and configure it with the supported languages:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { TranslaXModule } from 'transla-x';

const translationConfig = {
  supportedLanguages: ['en', 'ar'] // Set the supported languages here
};

@NgModule({
  imports: [BrowserModule, TranslaXModule.configure(translationConfig)],
  declarations: [AppComponent],
  bootstrap: [AppComponent]
})
export class AppModule {}

Use the translation pipe in your component template to translate content:

<p>English: {{ 'HELLO' | translation: 'en' }}</p>
<p>Arabic: {{ 'HELLO' | translation: 'ar' }}</p>

Contribution

Contributions to Transla-X are welcome! If you find a bug, have a feature request, or want to contribute code, please open an issue or submit a pull request. Please make sure to follow the project's code of conduct.

License

This project is licensed under the MIT License.

Package Sidebar

Install

npm i transla-x

Weekly Downloads

1

Version

1.0.2

License

none

Unpacked Size

52.8 kB

Total Files

20

Last publish

Collaborators

  • lumossparrow