Skip to content

Commit a4e19c9

Browse files
committed
translate value names
1 parent a44cc38 commit a4e19c9

File tree

3 files changed

+31
-10
lines changed

3 files changed

+31
-10
lines changed

locales/en-US/cli.ftl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ cli-value-num = NUM
55
cli-value-field = FIELD
66
cli-value-regex = REGEX
77
cli-value-exclude = EXCLUDE
8+
cli-value-type = TYPE
9+
cli-value-separator = SEPARATOR
10+
cli-value-string = STRING
11+
cli-value-language = LANGUAGE
12+
cli-value-when = WHEN
13+
cli-value-image = IMAGE
14+
cli-value-protocol = PROTOCOL
15+
cli-value-value = VALUE
16+
cli-value-format = FORMAT
17+
cli-value-shell = SHELL
818
919
# INFO
1020
cli-info-heading = INFO

locales/ru-RU/cli.ftl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ cli-value-num = КОЛ-ВО
55
cli-value-field = ПОЛЕ
66
cli-value-regex = РЕГ. ВЫРАЖЕНИЕ
77
cli-value-exclude = ИСКЛЮЧЕННОЕ
8+
cli-value-type = ТИП
9+
cli-value-separator = РАЗДЕЛИТЕЛЬ
10+
cli-value-string = СТРОКА
11+
cli-value-language = ЯЗЫК
12+
cli-value-when = КОГДА
13+
cli-value-image = ИЗОБРАЖЕНИЕ
14+
cli-value-protocol = ПРОТОКОЛ
15+
cli-value-value = ЗНАЧЕНИЕ
16+
cli-value-format = ФОРМАТ
17+
cli-value-shell = ОБОЛОЧКА
818
919
# INFO
1020
cli-info-heading = ИНФОРМАЦИЯ

src/cli.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ pub struct InfoCliOptions {
6868
pub number_of_languages: usize,
6969
#[arg(long, default_value_t = 3usize, value_name = tr!("cli-value-num"), help = tr!("cli-info-number-of-file-churns"))]
7070
pub number_of_file_churns: usize,
71-
#[arg(long, value_name = "NUM", help = tr!("cli-info-churn-pool-size"))]
71+
#[arg(long, value_name = tr!("cli-value-num"), help = tr!("cli-info-churn-pool-size"))]
7272
pub churn_pool_size: Option<usize>,
7373
#[arg(long, short, num_args = 1.., help = tr!("cli-info-exclude"), value_name = tr!("cli-value-exclude"))]
7474
pub exclude: Vec<String>,
@@ -94,6 +94,7 @@ pub struct InfoCliOptions {
9494
#[arg(
9595
long,
9696
num_args = 1..,
97+
value_name = tr!("cli-value-type"),
9798
default_values = &["programming", "markup"],
9899
short = 'T',
99100
value_enum,
@@ -112,7 +113,7 @@ pub struct AsciiCliOptions {
112113
/// For example:
113114
///
114115
/// '--ascii-input "$(fortune | cowsay -W 25)"'
115-
#[arg(long, value_name = "STRING", value_hint = ValueHint::CommandString)]
116+
#[arg(long, value_name = tr!("cli-value-string"), value_hint = ValueHint::CommandString)]
116117
pub ascii_input: Option<String>,
117118
/// Colors (X X X...) to print the ascii art
118119
#[arg(
@@ -127,31 +128,31 @@ pub struct AsciiCliOptions {
127128
#[arg(
128129
long,
129130
short,
130-
value_name = "LANGUAGE",
131+
value_name = tr!("cli-value-language"),
131132
value_enum,
132133
hide_possible_values = true
133134
)]
134135
pub ascii_language: Option<Language>,
135136
/// Specify when to use true color
136137
///
137138
/// If set to auto: true color will be enabled if supported by the terminal
138-
#[arg(long, default_value = "auto", value_name = "WHEN", value_enum)]
139+
#[arg(long, default_value = "auto", value_name = tr!("cli-value-when"), value_enum)]
139140
pub true_color: When,
140141
}
141142

142143
#[derive(Clone, Debug, Args, PartialEq, Eq)]
143144
#[command(next_help_heading = "IMAGE")]
144145
pub struct ImageCliOptions {
145146
/// Path to the IMAGE file
146-
#[arg(long, short, value_hint = ValueHint::FilePath)]
147+
#[arg(long, short, value_name = tr!("cli-value-image"), value_hint = ValueHint::FilePath)]
147148
pub image: Option<PathBuf>,
148149
/// Which image PROTOCOL to use
149-
#[arg(long, value_enum, requires = "image", value_name = "PROTOCOL")]
150+
#[arg(long, value_enum, requires = "image", value_name = tr!("cli-value-protocol"))]
150151
pub image_protocol: Option<ImageProtocol>,
151152
/// VALUE of color resolution to use with SIXEL backend
152153
#[arg(
153154
long,
154-
value_name = "VALUE",
155+
value_name = tr!("cli-value-value"),
155156
requires = "image",
156157
default_value_t = 16usize,
157158
value_parser = PossibleValuesParser::new(COLOR_RESOLUTIONS)
@@ -182,7 +183,7 @@ pub struct TextForamttingCliOptions {
182183
#[arg(long, short = 'z')]
183184
pub iso_time: bool,
184185
/// Which thousands SEPARATOR to use
185-
#[arg(long, value_name = "SEPARATOR", default_value = "plain", value_enum)]
186+
#[arg(long, value_name = tr!("cli-value-separator"), default_value = "plain", value_enum)]
186187
pub number_separator: NumberSeparator,
187188
/// Turns off bold formatting
188189
#[arg(long)]
@@ -208,10 +209,10 @@ pub struct VisualsCliOptions {
208209
#[command(next_help_heading = "DEVELOPER")]
209210
pub struct DeveloperCliOptions {
210211
/// Outputs Onefetch in a specific format
211-
#[arg(long, short, value_name = "FORMAT", value_enum)]
212+
#[arg(long, short, value_name = tr!("cli-value-format"), value_enum)]
212213
pub output: Option<SerializationFormat>,
213214
/// If provided, outputs the completion file for given SHELL
214-
#[arg(long = "generate", value_name = "SHELL", value_enum)]
215+
#[arg(long = "generate", value_name = tr!("cli-value-shell"), value_enum)]
215216
pub completion: Option<Shell>,
216217
}
217218

0 commit comments

Comments
 (0)