Add i18n by using rust i18n (#807)

* feat: initial i18n setup

* style: fmt

* feat: i18n support for new steps

* fix: build on Linux

* fix: build on Linux

* refactor: rm unused translation keys

---------

Co-authored-by: Steve Lau <stevelauc@outlook.com>
This commit is contained in:
Florian Nagel
2024-10-03 12:47:35 +02:00
committed by GitHub
parent c33d396489
commit 29c555c394
33 changed files with 1222 additions and 524 deletions

View File

@@ -16,6 +16,7 @@ use crate::{
utils::{which, PathExt},
};
use rust_i18n::t;
#[cfg(unix)]
use std::os::unix::process::CommandExt as _;
@@ -158,7 +159,7 @@ pub fn run_in_tmux(config: TmuxConfig) -> Result<()> {
TmuxSessionMode::AttachIfNotInSession => {
if is_inside_tmux {
// Only attach to the newly-created session if we're not currently in a tmux session.
println!("Topgrade launched in a new tmux session");
println!("{}", t!("Topgrade launched in a new tmux session"));
return Ok(());
} else {
tmux.build().args(["attach-client", "-t", &session]).exec()