Internationalization

Provide a uniform localization support for @delon/* class library built-in text of components.

Usage

Providers

Provides the token of DELON_LOCALE for configuring antd locale text globally.

import { DELON_LOCALE, en_US } from '@delon/theme';
@NgModule({
  ...
  providers   : [ { provide: DELON_LOCALE, useValue: en_US } ]
})
export class AppModule { }

Service

Provides the service of DelonLocaleService to dynamic change the locale text.

import { en_US, DelonLocaleService } from '@delon/theme';
...
constructor(private delonLocaleService: DelonLocaleService) {
}

switchLanguage() {
  this.delonLocaleService.setLocale(en_US);
}

Note: en_US is the package name, follow below.

Supported languages

LanguageFilename
Englishen_US
Chinese (Simplified)zh_CN
Chinese (Traditional)zh_TW
Turkishtr_TR
Polishpl_PL
Greekel_GR
Koreanko_KR
Croatianhr_HR
Japaneseja_JP
Sloveniansl_SI
Frenchfr_FR
Spanishes_ES
Italianit_IT

Add a new language

If you can't find your language, you are welcome to create a locale package based on en_US (You can also refer to #308 to contribute language package to us) and send us a pull req