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;
|
use crate::interpreted::hot_reload::start_hot_reloader;
|
||||||
pub use lazy_static::lazy_static;
|
pub use lazy_static::lazy_static;
|
||||||
|
use tokio::io;
|
||||||
|
|
||||||
#[cfg(feature = "hot_reload")]
|
#[cfg(feature = "hot_reload")]
|
||||||
pub mod hot_reload;
|
pub mod hot_reload;
|
||||||
@ -100,7 +101,11 @@ fn load_new_template_system(
|
|||||||
translation_dir: &Path,
|
translation_dir: &Path,
|
||||||
) -> Result<LoadedTemplates<FluentLocalisationSystem>, InterpreterError<Infallible, Infallible>> {
|
) -> Result<LoadedTemplates<FluentLocalisationSystem>, InterpreterError<Infallible, Infallible>> {
|
||||||
let localisation_system = FluentLocalisationSystem::new(translation_dir, default_locale)
|
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);
|
let mut templates = LoadedTemplates::new(localisation_system);
|
||||||
templates.load_templates_from_dir(template_dir)?;
|
templates.load_templates_from_dir(template_dir)?;
|
||||||
Ok(templates)
|
Ok(templates)
|
||||||
|
Loading…
Reference in New Issue
Block a user