Idiom.Local (idiom v0.6.8)
Local data provider for Idiom.
Idiom is backend-agnostic and can be used with many different providers. As a backup for when the selected source is unavailable, Idiom loads data from the local file system on startup.
Directory structure
You can set the data directory changing the :data_dir
setting Idiom.Local
will use as such:
config :idiom, data_dir: "priv/idiom"
Inside that directory, the structure should be as follows:
priv/idiom
└── en
├── default.json
└── login.json
Where en
is the target locale and default
and login
are namespaces.
File format
The json
files expected by Idiom.Local
are a subset of the i18next format. The following example shows all of
its features that Idiom currently supports.
{
"key": "value",
"keyDeep": {
"inner": "value"
},
"keyInterpolate": "replace this {{value}}",
"keyPluralSimple_one": "the singular",
"keyPluralSimple_other": "the plural",
"keyPluralMultipleEgArabic_zero": "the plural form 0",
"keyPluralMultipleEgArabic_one": "the plural form 1",
"keyPluralMultipleEgArabic_two": "the plural form 2",
"keyPluralMultipleEgArabic_few": "the plural form 3",
"keyPluralMultipleEgArabic_many": "the plural form 4",
"keyPluralMultipleEgArabic_other": "the plural form 5",
}
Summary
Functions
Parses all local data.
Functions
Link to this function
read(opts \\ [])
Parses all local data.