<commit_before># API References

## Global Config

### lang

- **Type:** `String`

- **Default:** `en`

- **Usage:**

  Get or set a translation language code. Default by `en` string value.

  ```javascript
  Vue.config.lang = 'ja'
  ```

### fallbackLang

- **Type:** `String`

- **Default:** `en`

- **Usage:**

  Get or set a translation fallback language code. Default by `en` string value.

  ```javascript
  Vue.config.fallbackLang = 'ja'
  ```

### missingHandler

- **Type:** `Function`

- **Default:** `null`

- **Usage:**

  Assign a handler for translation missing. The handler gets called with the translation target language, translation key and the Vue instance.

  ```javascript
  Vue.config.missingHandler = function (lang, key, vm) {
    // handle translation missing
  }
  ```

### i18nFormatter

- **Type:** `Function`

- **Default:** `null`

- **Usage:**

  Assign a customer message formatter.

  ```javascript
  Vue.config.i18nFormatter = function (string, ...arguments) {
    //...
    //return formattedString;
  }
  ```


## Global Methods

### Vue.locale ( lang, [locale], [cb] )<commit_msg>:pencil: docs(gitbook): add explanation of missingHandler<commit_after># API References

## Global Config

### lang

- **Type:** `String`

- **Default:** `en`

- **Usage:**

  Get or set a translation language code. Default by `en` string value.

  ```javascript
  Vue.config.lang = 'ja'
  ```

### fallbackLang

- **Type:** `String`

- **Default:** `en`

- **Usage:**

  Get or set a translation fallback language code. Default by `en` string value.

  ```javascript
  Vue.config.fallbackLang = 'ja'
  ```

### missingHandler

- **Type:** `Function`

- **Default:** `null`

- **Usage:**

  Assign a handler for translation missing. The handler gets called with the translation target language, translation key and the Vue instance.

  If mssingHandler is assigned, and occured translation missing, it's not warned.

  ```javascript
  Vue.config.missingHandler = function (lang, key, vm) {
    // handle translation missing
  }
  ```

### i18nFormatter

- **Type:** `Function`

- **Default:** `null`

- **Usage:**

  Assign a customer message formatter.

  ```javascript
  Vue.config.i18nFormatter = function (string, ...arguments) {
    //...
    //return formattedString;
  }
  ```


## Global Methods

### Vue.locale ( lang, [locale], [cb] )
{'fraction_non_alphanumeric': 0.16984328674290555, 'fraction_numerical': 0.0033883947479881405, 'mean_word_length': 3.398510242085661, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3460477', 'n_tokens_mistral': 761, 'n_tokens_neox': 725, 'n_words': 232}