@@ -18,6 +18,7 @@ use etcetera::base_strategy::Windows;
18
18
#[ cfg( unix) ]
19
19
use etcetera:: base_strategy:: Xdg ;
20
20
use once_cell:: sync:: Lazy ;
21
+ use rust_i18n:: { i18n, t} ;
21
22
use tracing:: debug;
22
23
23
24
use self :: config:: { CommandLineArgs , Config , Step } ;
@@ -54,6 +55,8 @@ pub(crate) static XDG_DIRS: Lazy<Xdg> = Lazy::new(|| Xdg::new().expect("No home
54
55
#[ cfg( windows) ]
55
56
pub ( crate ) static WINDOWS_DIRS : Lazy < Windows > = Lazy :: new ( || Windows :: new ( ) . expect ( "No home directory" ) ) ;
56
57
58
+ i18n ! ( "locales" , fallback = "en" ) ;
59
+
57
60
fn run ( ) -> Result < ( ) > {
58
61
install_color_eyre ( ) ?;
59
62
ctrlc:: set_handler ( ) ;
@@ -97,7 +100,7 @@ fn run() -> Result<()> {
97
100
} ;
98
101
99
102
if opt. show_config_reference ( ) {
100
- print ! ( "{}" , config:: EXAMPLE_CONFIG ) ;
103
+ print ! ( "{}" , config:: EXAMPLE_CONFIG ) ; // TODO: Find a way to use a translated example config
101
104
return Ok ( ( ) ) ;
102
105
}
103
106
@@ -210,7 +213,7 @@ fn run() -> Result<()> {
210
213
runner. execute ( Step :: System , "System update" , || distribution. upgrade ( & ctx) ) ?;
211
214
}
212
215
Err ( e) => {
213
- println ! ( "Error detecting current distribution: {e}" ) ;
216
+ println ! ( "{} {e}" , t! ( " Error detecting current distribution:" ) ) ;
214
217
}
215
218
}
216
219
runner. execute ( Step :: ConfigUpdate , "config-update" , || linux:: run_config_update ( & ctx) ) ?;
@@ -524,7 +527,7 @@ fn main() {
524
527
// The `Debug` implementation of `eyre::Result` prints a multi-line
525
528
// error message that includes all the 'causes' added with
526
529
// `.with_context(...)` calls.
527
- println ! ( "Error: {error:?}" ) ;
530
+ println ! ( "{} {error:?}" , t! ( "Error:" ) ) ;
528
531
}
529
532
exit ( 1 ) ;
530
533
}
0 commit comments