class JSONSchema::I18N
- JSONSchema::I18N
- Reference
- Object
Overview
Allows translation of generated messages (mostly exceptions). Generally you do not need to interact with this class, other than to set the lang to a custom configuration.
To create your own translation, copy the value EN_US
from the source and define it in your
application (with a different constant name). Translate the strings, ensuring that the keys are not changed. Then, call #set_lang
:
require "jsonschema"
LANG = {
0 => "..",
# ...etc
}
JSONSchema.i18n.set_lang(LANG)
Defined in:
i18n.crInstance Method Summary
-
#get(key)
Used internally to display translated messages.
- #get(key, *strings)
-
#set_lang(lang : Lang)
Set a user-created lang.
Instance Method Detail
Set a user-created lang. A lang
is just a Hash
where the keys of the Hash
are identical to the expected keys for the lang.
See the constant value EN_US
for a reference.