diff --git a/src/bin/uudoc.rs b/src/bin/uudoc.rs index a2395d3ae..64959bc12 100644 --- a/src/bin/uudoc.rs +++ b/src/bin/uudoc.rs @@ -25,6 +25,7 @@ use zip::ZipArchive; use coreutils::validation; use uucore::Args; +use uucore::locale::get_message; include!(concat!(env!("OUT_DIR"), "/uutils_map.rs")); @@ -246,6 +247,8 @@ fn main() -> io::Result<()> { } } let utils = util_map::>>(); + // Initialize localization for uucore common strings (used by tldr example attribution) + let _ = uucore::locale::setup_localization("uudoc"); match std::fs::create_dir("docs/src/utils/") { Err(e) if e.kind() == io::ErrorKind::AlreadyExists => Ok(()), x => x, @@ -693,15 +696,9 @@ fn format_examples(content: String, output_markdown: bool) -> Result The examples are provided by the [tldr-pages project](https://tldr.sh) under the [CC BY 4.0 License](https://github.com/tldr-pages/tldr/blob/main/LICENSE.md)." - )?; + writeln!(s, "> {}", get_message("uudoc-tldr-attribution"))?; writeln!(s, ">")?; - writeln!( - s, - "> Please note that, as uutils is a work in progress, some examples might fail." - )?; + writeln!(s, "> {}", get_message("uudoc-tldr-disclaimer"))?; Ok(s) } diff --git a/src/uucore/locales/en-US.ftl b/src/uucore/locales/en-US.ftl index 158962095..93a761577 100644 --- a/src/uucore/locales/en-US.ftl +++ b/src/uucore/locales/en-US.ftl @@ -80,3 +80,7 @@ checksum-failed-open-file = { $count -> *[other] { $count } listed files could not be read } checksum-error-algo-bad-format = { $file }: { $line }: improperly formatted { $algo } checksum line + +# uudoc tldr examples messages +uudoc-tldr-attribution = The examples are provided by the [tldr-pages project](https://tldr.sh) under the [CC BY 4.0 License](https://github.com/tldr-pages/tldr/blob/main/LICENSE.md). +uudoc-tldr-disclaimer = Please note that, as uutils is a work in progress, some examples might fail. diff --git a/src/uucore/locales/fr-FR.ftl b/src/uucore/locales/fr-FR.ftl index e9ff4abe4..98a18fbce 100644 --- a/src/uucore/locales/fr-FR.ftl +++ b/src/uucore/locales/fr-FR.ftl @@ -74,3 +74,7 @@ checksum-failed-open-file = { $count -> *[other] { $count } fichiers passés n'ont pas pu être lu } checksum-error-algo-bad-format = { $file }: { $line }: ligne invalide pour { $algo } + +# Messages uudoc pour les exemples tldr +uudoc-tldr-attribution = Les exemples sont fournis par le [projet tldr-pages](https://tldr.sh) sous la [licence CC BY 4.0](https://github.com/tldr-pages/tldr/blob/main/LICENSE.md). +uudoc-tldr-disclaimer = Veuillez noter que, uutils étant en cours de développement, certains exemples peuvent échouer.