JSON Get Text
This is a library for getting text from JSON usually for internationalization.
Example
extern crate json_gettext;
let ctx = static_json_gettext_build!.unwrap;
assert_eq!;
assert_eq!;
Rocket Support
This crate supports the Rocket framework. In order to reload changed json files instead of recompiling the program you have to enable the rocketly
feature for this crate.
[]
= "*"
= ["rocketly"]
Then, use the static_json_gettext_build_rocketly
macro instead of the static_json_gettext_build
macro to build a JSONGetText
(JSONGetTextManager
).
extern crate json_gettext;
extern crate rocket;
use State;
use Redirect;
use JSONGetTextManager;
If you are not using the release
profile, JSONGetTextManager
can reload the json files automatically if needed.
Crates.io
https://crates.io/crates/json-gettext