1
0
mirror of https://github.com/lise-henry/crowbook synced 2024-09-28 02:59:45 +02:00

Continuing localization

This commit is contained in:
Elisabeth Henry 2016-10-07 22:25:05 +02:00
parent aa6cf82b66
commit 56bab1a4bc
3 changed files with 32 additions and 11 deletions

View File

@ -8,4 +8,25 @@ msgid "{} is not a valid template name."
msgstr "{} n'est pas un nom de template valide."
msgid "Render a Markdown book in EPUB, PDF or HTML."
msgstr "Génère des fichiers EPUB, PDF ou HTML à partir d'un livre écrit en Markdown."
msgstr "Génère des fichiers EPUB, PDF ou HTML à partir d'un livre écrit en Markdown."
msgid "No output file specified, and book doesn't specify an output file for {}"
msgstr "Pas de fichier de sortie spécifié, et le livre n'en spécifie pas pour {}"
msgid "Could not create file '{}'"
msgstr "Impossible de créer le fichier '{}'"
msgid "An odd number of arguments was passed to --set, but it takes a list of key value pairs."
msgstr "Un nombre impair d'arguments a été donné à --set, alors qu'il prend une liste de paires clé-valeur."
msgid "Error in setting key {}: {}"
msgstr "Erreur en initialisant la clé {}: {}"
msgid "Could not create file {}: it already exists!"
msgstr "Impossible de créer le fichier {} : il existe déjà !"
msgid "Created {}, now you'll have to complete it!"
msgstr "{} a été crée, maintenant vous n'avez plus qu'à le compléter !"
msgid "A list of additional files is only valid with the --create option."
msgstr "Une liste de fichiers additionnels n'est valide qu'avec l'option --create."

View File

@ -16,7 +16,7 @@ pub fn get_book_options<'a>(matches: &'a ArgMatches) -> Vec<(&'a str, &'a str)>
if let Some(iter) = matches.values_of("set") {
let v:Vec<_> = iter.collect();
if v.len() %2 != 0 {
print_error("An odd number of arguments was passed to --set, but it takes a list of key value pairs.");
print_error(&lformat!("An odd number of arguments was passed to --set, but it takes a list of key value pairs."));
}
for i in 0..v.len()/2 {
@ -43,7 +43,7 @@ pub fn set_book_options(book: &mut Book, matches: &ArgMatches) -> String {
for (key, value) in options {
let res = book.options.set(key, value);
if let Err(err) = res {
print_error(&format!("Error in setting key {}: {}", key, err));
print_error(&lformat!("Error in setting key {}: {}", key, err));
}
output.push_str(&format!("{}: {}\n", key, value));
}
@ -55,7 +55,7 @@ pub fn set_book_options(book: &mut Book, matches: &ArgMatches) -> String {
pub fn create_book(matches: &ArgMatches) -> ! {
let mut f:Box<Write> = if let Some(book) = matches.value_of("BOOK") {
if fs::metadata(book).is_ok() {
print_error(&format!("Could not create file {}: it already exists!", book));
print_error(&lformat!("Could not create file {}: it already exists!", book));
}
Box::new(fs::File::create(book).unwrap())
} else {
@ -85,7 +85,7 @@ lang: en
f.write_all(&format!("+ {}\n", file).as_bytes()).unwrap();
}
if let Some(s) = matches.value_of("BOOK") {
println!("Created {}, now you'll have to complete it!", s);
println!("{}", lformat!("Created {}, now you\'ll have to complete it!", s));
}
exit(0);
} else {
@ -131,6 +131,6 @@ pub fn create_matches<'a>() -> ArgMatches<'a> {
/// Pre-check the matches to see if there isn't illegal options not detected by clap
fn pre_check(matches: &ArgMatches) {
if matches.is_present("files") && !matches.is_present("create") {
print_error("A list of additional files is only valid with the --create option.");
print_error(&lformat!("A list of additional files is only valid with the --create option."));
}
}

View File

@ -63,7 +63,7 @@ fn render_format(book: &mut Book, matches: &ArgMatches, format: &str) -> ! {
"proofread.html" => book.render_proof_html(&mut io::stdout()),
"tex" => book.render_tex(&mut io::stdout()),
"proofread.tex" => book.render_tex(&mut io::stdout()),
_ => print_error(&format!("No output file specified, and book doesn't specify an output file for {}", format)),
_ => print_error(&lformat!("No output file specified, and book doesn't specify an output file for {}", format)),
}
},
Ok(file) => {
@ -73,28 +73,28 @@ fn render_format(book: &mut Book, matches: &ArgMatches, format: &str) -> ! {
if let Ok(mut f) = File::create(&file) {
book.render_tex(&mut f)
} else {
print_error(&format!("Could not create file '{}'", file));
print_error(&lformat!("Could not create file '{}'", file));
}
},
"proofread.tex" => {
if let Ok(mut f) = File::create(&file) {
book.render_proof_tex(&mut f)
} else {
print_error(&format!("Could not create file '{}'", file));
print_error(&lformat!("Could not create file '{}'", file));
}
},
"html" => {
if let Ok(mut f) = File::create(&file) {
book.render_html(&mut f)
} else {
print_error(&format!("Could not create file '{}'", file));
print_error(&lformat!("Could not create file '{}'", file));
}
},
"proofread.html" => {
if let Ok(mut f) = File::create(&file) {
book.render_proof_html(&mut f)
} else {
print_error(&format!("Could not create file '{}'", file));
print_error(&lformat!("Could not create file '{}'", file));
}
},
"pdf" => book.render_pdf(),