AWS Amplify API
AWS Amplify Home
Options
All

- Public
- Public/Protected
- All

Inherited Externals Only exported
Menu

Language transition class Export I18n APIs

### Hierarchy

- I18n

## Index

### Constructors

- constructor

### Properties

- _dict
- _lang
- _options

### Methods

- get
- getByLanguage
- putVocabularies
- putVocabulariesForLanguage
- setLanguage
- checkConfig
- configure
- createInstance
- get
- getModuleName
- putVocabularies
- putVocabulariesForLanguage
- setLanguage

## Constructors

### constructor

- new I18n(options: I18nOptions): I18n

- - Defined in core/src/I18n/I18n.ts:36
  constructor

    Initialize with configurations

  #### Parameters

  - ##### options: I18nOptions

  #### Returns I18n

## Properties

### Private _dict

_dict: object

- Defined in core/src/I18n/I18n.ts:36

#### Type declaration

### Private _lang

_lang: any = null

- Defined in core/src/I18n/I18n.ts:31

### Private _options

_options: I18nOptions = null

- Defined in core/src/I18n/I18n.ts:26

## Methods

### get

- get(key: any, defVal?: any): any

- - Defined in core/src/I18n/I18n.ts:69
  method

    Get value

  #### Parameters

  - ##### key: any

  - ##### Default value defVal: any = undefined

    Default value

  #### Returns any

### getByLanguage

- getByLanguage(key: any, language: any, defVal?: any): any

- - Defined in core/src/I18n/I18n.ts:93
  method

    Get value according to specified language

  #### Parameters

  - ##### key: any

  - ##### language: any

    Specified langurage to be used

  - ##### Default value defVal: any = null

    Default value

  #### Returns any

### putVocabularies

- putVocabularies(vocabularies: any): void

- - Defined in core/src/I18n/I18n.ts:120
  method

    Add vocabularies for one language

  #### Parameters

  - ##### vocabularies: any

    Object that has language as key, vocabularies of each language as value

  #### Returns void

### putVocabulariesForLanguage

- putVocabulariesForLanguage(language: any, vocabularies: any): void

- - Defined in core/src/I18n/I18n.ts:108
  method

    Add vocabularies for one language

  #### Parameters

  - ##### language: any

  - ##### vocabularies: any

    Object that has key-value as dictionary entry

  #### Returns void

### setLanguage

- setLanguage(lang: string): void

- - Defined in core/src/I18n/I18n.ts:59
  method

    Explicitly setting language

  #### Parameters

  - ##### lang: string

  #### Returns void

### Static checkConfig

- checkConfig(): boolean

- - Defined in core/src/I18n/index.ts:109

  #### Returns boolean

### Static configure

- configure(config: any): any

- - Defined in core/src/I18n/index.ts:34
  static
  method

    Configure I18n part

  #### Parameters

  - ##### config: any

    Configuration of the I18n

  #### Returns any

### Static createInstance

- createInstance(): void

- - Defined in core/src/I18n/index.ts:54
  static
  method

    Create an instance of I18n for the library

  #### Returns void

### Static get

- get(key: any, defVal?: any): any

- - Defined in core/src/I18n/index.ts:77
  static

    @method Get value

  #### Parameters

  - ##### key: any

  - ##### Optional defVal: any

    Default value

  #### Returns any

### Static getModuleName

- getModuleName(): string

- - Defined in core/src/I18n/index.ts:45

  #### Returns string

### Static putVocabularies

- putVocabularies(vocabularies: any): any

- - Defined in core/src/I18n/index.ts:103
  static
  method

    Add vocabularies for one language

  #### Parameters

  - ##### vocabularies: any

    Object that has language as key, vocabularies of each language as value

  #### Returns any

### Static putVocabulariesForLanguage

- putVocabulariesForLanguage(language: any, vocabularies: any): any

- - Defined in core/src/I18n/index.ts:90
  static
  method

    Add vocabularies for one language

  #### Parameters

  - ##### language: any

  - ##### vocabularies: any

    Object that has key-value as dictionary entry

  #### Returns any

### Static setLanguage

- setLanguage(lang: any): any

- - Defined in core/src/I18n/index.ts:65
  static

    @method Explicitly setting language

  #### Parameters

  - ##### lang: any

  #### Returns any