Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 694 Bytes

Dictionary.md

File metadata and controls

31 lines (24 loc) · 694 Bytes

import { dictionary } from 'svelte-i18n'

$dictionary

The $dictionary store is responsible for holding all loaded message definitions for each locale. A dictionary of messages can be a shallow or deep object:

en-shallow.json
{
  "title": "Sign up",
  "field.name": "Name",
  "field.birth": "Date of birth",
  "field.genre": "Genre"
}
en-deep.json
{
  "title": "Sign up",
  "field": {
    "name": "Name",
    "birth": "Date of birth",
    "genre": "Genre"
  }
}

It's recommended to use the addMessages() and register() methods to add new message dictionaries to your app.