pub fn new(locale: String, json_string: String) -> Result<Self, TranslatorError> {
        // Deserialize the JSON
        let translations =
            serde_json::from_str::<HashMap<String, String>>(&json_string).map_err(|err| {
                TranslatorError::TranslationsStrSerFailed {
                    locale: locale.to_string(),
                    source: err.into(),
                }
            })?;

        Ok(Self {
            translations,
            locale,
        })
    }
Creates a new translator for a given locale, passing in translations in
JSON form.
packages/perseus/src/translator/lightweight.rs