pub(crate) async fn set_translator_for_locale<'a>(
        &'a self,
        locale: &'a str,
    ) -> Result<(), ClientError> {
        if self.preflight_check(locale)? {
            let path_prefix = get_path_prefix_client();
            // Get the translations data
            let asset_url = format!("{}/.perseus/translations/{}", path_prefix, locale);
            // If this doesn't exist, then it's a 404 (we went here by explicit navigation
            // after checking the locale, so that's a bug)
            let translations_str = fetch(&asset_url, AssetType::Translations).await?;
            match translations_str {
                Some(translations_str) => {
                    // All good, turn the translations into a translator
                    self.set_translator_for_translations_str(locale, &translations_str)?;
                    // Only set `lang` if everything else worked (otherwise we'd end up with state
                    // inconsistencies)
                    Self::set_html_lang(locale);
                }
                // If we get a 404 for a supported locale, that's an exception
                None => {
                    return Err(ClientInvariantError::ValidLocaleNotProvided {
                        locale: locale.to_string(),
                    }
                    .into())
                }
            };
        }

        Ok(())
    }
Caches a `Translator` for the given locale. This will use the
internally cached `Translator` if possible, and will otherwise fetch
the translations from the server. This manages mutability for caching
internally.

This will imperatively update the `lang` attribute on the root `<html>`
element.

# Panics

This will panic if the given locale is not supported.
packages/perseus/src/i18n/client_translations_manager.rs