# Class: i18n

## vcs.vcm.i18n

the i18n singleton is used to get translated strings. For the ui, it is advised to use the i18n mechanism provided by vue-i18n

### Methods

#### vcs.vcm.i18n.getInstance(){vcs.vcm.i18n}

  Singleton getter for this class

#### vcs.vcm.i18n.getMessage(message_token)

  returns a translated message depending on the current locale in the framework.

  Name | Type | Description
  --- | --- | ---
  `message_token` | string | the message token

#### vcs.vcm.i18n.registerLanguage(token, language, data)

  is used to register a new language

  Name | Type | Description
  --- | --- | ---
  `token` | string | language token (en, de..)
  `language` | string | full language description
  `data` | Object.<string, string> |

#### vcs.vcm.i18n.setMessage(language, token, value)

  overwrites the default translation or creates a new for a given language and String

  Name | Type | Description
  --- | --- | ---
  `language` | string | language shortcut for example: de, en, nl
  `token` | string | the message_token to overwrite
  `value` | string | the new message value

#### vcs.vcm.i18n.updateElement(elementToUpdate)

  updates the textContent of an element after an data-{0,1,2,..} attribute of the element has changed

  Name | Type | Description
  --- | --- | ---
  `elementToUpdate` | Element |

#### getLocale(){string}

  returns the current locale

  ##### Returns:

  lang

#### getLocaleAwareString(value){string}

  replaces $locale$ with the current locale string

  Name | Type | Description
  --- | --- | ---
  `value` | string |

#### getRegisteredLanguages()

  returns an array of registered locales

#### setLocale(lang)

  sets the new locale

  Name | Type | Description
  --- | --- | ---
  `lang` | string | null |