JSPM

@taiga-ui/i18n

2.21.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11196
  • Score
    100M100P100Q144425F
  • License Apache-2.0

A package with tools for Taiga UI library i18n

Package Exports

  • @taiga-ui/i18n
  • @taiga-ui/i18n/bundles/taiga-ui-i18n.umd.js
  • @taiga-ui/i18n/enums
  • @taiga-ui/i18n/fesm5/taiga-ui-i18n.js
  • @taiga-ui/i18n/languages
  • @taiga-ui/i18n/languages/dutch
  • @taiga-ui/i18n/languages/english
  • @taiga-ui/i18n/languages/french
  • @taiga-ui/i18n/languages/german
  • @taiga-ui/i18n/languages/polish
  • @taiga-ui/i18n/languages/portuguese
  • @taiga-ui/i18n/languages/russian
  • @taiga-ui/i18n/languages/spanish
  • @taiga-ui/i18n/languages/turkish
  • @taiga-ui/i18n/languages/ukrainian
  • @taiga-ui/i18n/languages/vietnamese
  • @taiga-ui/i18n/tools

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@taiga-ui/i18n) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Taiga UI — i18n

npm version Discord

WebsiteDocumentationCDK WikiCore team

A package with tools for Taiga UI library i18n

Supported languages:

Language Constant name Coverage
English (by default) TUI_ENGLISH_LANGUAGE 100%
Russian TUI_RUSSIAN_LANGUAGE 100%
Spanish TUI_SPANISH_LANGUAGE 100%
German TUI_GERMAN_LANGUAGE 100%
Turkish TUI_TURKISH_LANGUAGE 100%
Dutch TUI_DUTCH_LANGUAGE 100%
Ukrainian TUI_UKRAINIAN_LANGUAGE 100%
French TUI_FRENCH_LANGUAGE 100%
Vietnamese TUI_VIETNAMESE_LANGUAGE 100%
Portuguese TUI_PORTUGUESE_LANGUAGE 100%
Italian TUI_ITALIAN_LANGUAGE 100%
Polish TUI_POLISH_LANGUAGE 100%

It's a part of Taiga UI that is fully-treeshakable Angular UI Kit consisting of multiple base libraries and several add-ons

How to install

If you have @taiga-ui/core in your app, you do not need to install anything. i18n package is included as a dependency.

How to use

You have English by default.

If you want to change it, you need to provide TUI_LANGUAGE token in your app.module:

import {TUI_LANGUAGE, TUI_RUSSIAN_LANGUAGE} from '@taiga-ui/i18n';

// app.module
@NgModule({
    // ...
    providers: [
        {
            provide: TUI_LANGUAGE,
            useValue: of(TUI_RUSSIAN_LANGUAGE),
        },
    ],
})
export class AppModule {}

You can also switch languages on the fly. Use useFactory or useClass with a service to make a stream of dictionaries.

If you extremely struggle against every byte of your app, you can build a custom language dictionary with constants:

// If we plan to use CORE and KIT packages only
export const CUSTOM_RUSSIAN_LANGUAGE: Language = {
    ...TUI_RUSSIAN_LANGUAGE_CORE,
    ...TUI_RUSSIAN_LANGUAGE_KIT,
    // ...TUI_RUSSIAN_LANGUAGE_ADDON_COMMERCE,
    // ...TUI_RUSSIAN_LANGUAGE_ADDON_TABLE,
};

How to add a language

Feel free to add new languages!

  1. Go to languages folder
  2. Copy english folder and rename new folder with the name of language you speak
  3. Translate entities in files. If you need some clarification, take a look at interfaces of entities. If you need more, please write to us via issues or any other way of contact :)

Thank you!

You do not need to translate "Editor". It is an experimental package