Fix translation syntax errors panicking on hot reload
This commit is contained in:
parent
6c6a129ddb
commit
6ca36aaa8e
@ -23,6 +23,7 @@ pub use hornbeam_interpreter::Params;
|
||||
|
||||
use crate::interpreted::hot_reload::start_hot_reloader;
|
||||
pub use lazy_static::lazy_static;
|
||||
use tokio::io;
|
||||
|
||||
#[cfg(feature = "hot_reload")]
|
||||
pub mod hot_reload;
|
||||
@ -100,7 +101,11 @@ fn load_new_template_system(
|
||||
translation_dir: &Path,
|
||||
) -> Result<LoadedTemplates<FluentLocalisationSystem>, InterpreterError<Infallible, Infallible>> {
|
||||
let localisation_system = FluentLocalisationSystem::new(translation_dir, default_locale)
|
||||
.expect("Failed to create Fluent localisation system for Hornbeam environment");
|
||||
.map_err(|err| {
|
||||
InterpreterError::TemplateFindError(format!(
|
||||
"Failed to create Fluent localisation system for Hornbeam environment: {err:?}"
|
||||
))
|
||||
})?;
|
||||
let mut templates = LoadedTemplates::new(localisation_system);
|
||||
templates.load_templates_from_dir(template_dir)?;
|
||||
Ok(templates)
|
||||
|
Loading…
Reference in New Issue
Block a user