Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/bin/uudoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));

Expand Down Expand Up @@ -246,6 +247,8 @@ fn main() -> io::Result<()> {
}
}
let utils = util_map::<Box<dyn Iterator<Item = OsString>>>();
// 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,
Expand Down Expand Up @@ -693,15 +696,9 @@ fn format_examples(content: String, output_markdown: bool) -> Result<String, std
}
}
writeln!(s)?;
writeln!(
s,
"> 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)
}

Expand Down
4 changes: 4 additions & 0 deletions src/uucore/locales/en-US.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 4 additions & 0 deletions src/uucore/locales/fr-FR.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading