mirror of
https://github.com/lise-henry/crowbook
synced 2024-05-28 14:06:29 +02:00
Continue i18n change
This commit is contained in:
parent
682cc039a3
commit
e2fa7aff3c
|
@ -9,3 +9,7 @@ error:
|
||||||
no_char: "%{s} is not a char"
|
no_char: "%{s} is not a char"
|
||||||
no_i32: "%{s} is not an i32"
|
no_i32: "%{s} is not an i32"
|
||||||
no_f32: "%{s} is not a f32"
|
no_f32: "%{s} is not a f32"
|
||||||
|
renderer:
|
||||||
|
no_output: This renderer does not support the auto output
|
||||||
|
file_creation: "could not create file '%{file}': '%{err}"
|
||||||
|
write: "could not write book content to file '{file}': {err}"
|
||||||
|
|
|
@ -21,6 +21,7 @@ use crate::error::{Error, Result, Source};
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
use rust_i18n::t;
|
||||||
|
|
||||||
/// Trait that must be implemented by the various renderers to render a whole book.
|
/// Trait that must be implemented by the various renderers to render a whole book.
|
||||||
|
|
||||||
|
@ -29,7 +30,7 @@ pub trait BookRenderer: Sync {
|
||||||
fn auto_path(&self, _book_file: &str) -> Result<String> {
|
fn auto_path(&self, _book_file: &str) -> Result<String> {
|
||||||
Err(Error::default(
|
Err(Error::default(
|
||||||
Source::empty(),
|
Source::empty(),
|
||||||
lformat!("This renderer does not support the auto output"),
|
t!("error.renderer.no_output"),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,8 +48,8 @@ pub trait BookRenderer: Sync {
|
||||||
let mut file = File::create(path).map_err(|err| {
|
let mut file = File::create(path).map_err(|err| {
|
||||||
Error::default(
|
Error::default(
|
||||||
Source::empty(),
|
Source::empty(),
|
||||||
lformat!(
|
t!(
|
||||||
"could not create file '{file}': {err}",
|
"error.renderer.file_creation",
|
||||||
file = path.display(),
|
file = path.display(),
|
||||||
err = err
|
err = err
|
||||||
),
|
),
|
||||||
|
@ -57,8 +58,8 @@ pub trait BookRenderer: Sync {
|
||||||
file.write_all(&content).map_err(|err| {
|
file.write_all(&content).map_err(|err| {
|
||||||
Error::default(
|
Error::default(
|
||||||
Source::empty(),
|
Source::empty(),
|
||||||
lformat!(
|
t!(
|
||||||
"could not write book content to file '{file}': {err}",
|
"error.renderer.write",
|
||||||
file = path.display(),
|
file = path.display(),
|
||||||
err = err
|
err = err
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue