Skip to content

Commit a3c1145

Browse files
committed
translate CLI
1 parent 9fc988b commit a3c1145

File tree

3 files changed

+120
-25
lines changed

3 files changed

+120
-25
lines changed

locales/en-US/cli.ftl

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ cli-info-tipe-long =
6868

6969
# TEXT FORMATTING
7070
cli-text-heading = TEXT FORMATTING
71-
cli-text-colors =
71+
cli-text-colors-short = Changes the text colors (X X X...)
72+
cli-text-colors-long =
7273
Changes the text colors (X X X...)
7374

7475
Goes in order of title, ~, underline, subtitle, colon, and info
@@ -77,12 +78,18 @@ cli-text-colors =
7778

7879
'--text-colors 9 10 11 12 13 14'
7980
cli-text-iso_time = Use ISO 8601 formatted timestamps
80-
cli-text-number_separator = Which thousands SEPARATOR to use
81+
cli-text-number_separator-short = Which thousands SEPARATOR to use (defautl: ${def}) (possible values: {$pos})
82+
cli-text-number_separator-long =
83+
Which thousands SEPARATOR to use
84+
85+
(default: {$def})
86+
(possible values: {$pos})
8187
cli-text-no_bold = Turns off bold formatting
8288

8389
# ASCII
8490
cli-ascii-heading = ASCII
85-
cli-ascii-ascii_input =
91+
cli-ascii-ascii_input-short = Takes a non-empty STRING as input to replace the ASCII logo
92+
cli-ascii-ascii_input-long =
8693
Takes a non-empty STRING as input to replace the ASCII logo
8794

8895
It is possible to pass a generated STRING by command substitution
@@ -92,16 +99,29 @@ cli-ascii-ascii_input =
9299
'--ascii-input "$(fortune | cowsay -W 25)"'
93100
cli-ascii-ascii_colors = Colors (X X X...) to print the ascii art
94101
cli-ascii-ascii_language = Which LANGUAGE's ascii art to print
95-
cli-ascii-true_color =
102+
cli-ascii-true_color-short = Specify when to use true color (default: {$def}) (possible values: {$pos})
103+
cli-ascii-true_color-long =
96104
Specify when to use true color
97105

98106
If set to auto: true color will be enabled if supported by the terminal
107+
108+
(default: {$def})
109+
(possible values: {$pos})
99110

100111
# IMAGE
101112
cli-image-heading = IMAGE
102113
cli-image-image = Path to the IMAGE file
103-
cli-image-image_protocol = Which image PROTOCOL to use
104-
cli-image-color_resolution = VALUE of color resolution to use with SIXEL backend
114+
cli-image-image_protocol-short = Which image PROTOCOL to use (possible values: {$pos})
115+
cli-image-image_protocol-long =
116+
Which image PROTOCOL to use
117+
118+
(possible values: {$pos})
119+
cli-image-color_resolution-short = VALUE of color resolution to use with SIXEL backend (default: {$def}) (possible values: {$pos})
120+
cli-image-color_resolution-long =
121+
VALUE of color resolution to use with SIXEL backend
122+
123+
(default: {$def})
124+
(possible values: {$pos})
105125

106126
# VISUALS
107127
cli-visuals-heading = VISUALS
@@ -115,8 +135,16 @@ cli-visuals-nerd_fonts =
115135

116136
# DEVELOPER
117137
cli-dev-heading = DEVELOPER
118-
cli-dev-output = Outputs Onefetch in a specific format
119-
cli-dev-completion = If provided, outputs the completion file for given SHELL
138+
cli-dev-output-short = Outputs Onefetch in a specific format (possible values: {$def})
139+
cli-dev-output-long =
140+
Outputs Onefetch in a specific format
141+
142+
(possible values: {$def})
143+
cli-dev-completion-short = If provided, outputs the completion file for given SHELL (possible values: {$def})
144+
cli-dev-completion-long =
145+
If provided, outputs the completion file for given SHELL
146+
147+
(possible values: {$def})
120148

121149
# OTHER
122150
cli-other-heading = OTHER

locales/ru-RU/cli.ftl

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ cli-info-tipe-long =
6868

6969
# TEXT FORMATTING
7070
cli-text-heading = ФОРМАТИРОВАНИЕ ТЕКСТА
71-
cli-text-colors =
71+
cli-text-colors-short = Изменяет цвета текста (X X X...)
72+
cli-text-colors-long =
7273
Изменяет цвета текста (X X X...)
7374

7475
Идет в порядке заголовка, ~, подчеркивания, подзаголовка, двоеточия и информации
@@ -77,12 +78,18 @@ cli-text-colors =
7778

7879
'--text-colors 9 10 11 12 13 14'
7980
cli-text-iso_time = Использовать временные метки в формате ISO 8601
80-
cli-text-number_separator = Какой РАЗДЕЛИТЕЛЬ тысяч использовать
81+
cli-text-number_separator-short = Какой РАЗДЕЛИТЕЛЬ тысяч использовать (по умолчанию: {$def}) (возможные значения: {$pos})
82+
cli-text-number_separator-long =
83+
Какой РАЗДЕЛИТЕЛЬ тысяч использовать
84+
85+
(по умолчанию: {$def})
86+
(возможные значения: {$pos})
8187
cli-text-no_bold = Отключает жирное форматирование
8288

8389
# ASCII
8490
cli-ascii-heading = ASCII
85-
cli-ascii-ascii_input =
91+
cli-ascii-ascii_input-short = Принимает непустую СТРОКУ в качестве входных данных для замены ASCII логотипа
92+
cli-ascii-ascii_input-long =
8693
Принимает непустую СТРОКУ в качестве входных данных для замены ASCII логотипа
8794

8895
Можно передать сгенерированную СТРОКУ с помощью подстановки команд
@@ -92,16 +99,29 @@ cli-ascii-ascii_input =
9299
'--ascii-input "$(fortune | cowsay -W 25)"'
93100
cli-ascii-ascii_colors = Цвета (X X X...) для печати ASCII арта
94101
cli-ascii-ascii_language = ASCII арт какого ЯЗЫКА печатать
95-
cli-ascii-true_color =
102+
cli-ascii-true_color-short = Указать, когда использовать true-color (по умолчанию: {$def}) (возможные значения: {$pos})
103+
cli-ascii-true_color-long =
96104
Указать, когда использовать true-color
97105

98106
Если установлено в auto: true-color будет включен, если он поддерживается терминалом
107+
108+
(по умолчанию: {$def})
109+
(возможные значения: {$pos})
99110

100111
# IMAGE
101112
cli-image-heading = ИЗОБРАЖЕНИЕ
102113
cli-image-image = Путь к файлу ИЗОБРАЖЕНИЯ
103-
cli-image-image_protocol = Какой ПРОТОКОЛ изображения использовать
104-
cli-image-color_resolution = ЗНАЧЕНИЕ разрешения цвета, используемого с бэкендом SIXEL
114+
cli-image-image_protocol-short = Какой ПРОТОКОЛ изображения использовать (возможные значения: {$pos})
115+
cli-image-image_protocol-short =
116+
Какой ПРОТОКОЛ изображения использовать
117+
118+
(возможные значения: ${pos})
119+
cli-image-color_resolution-short = ЗНАЧЕНИЕ разрешения цвета, используемого с бэкендом SIXEL (по умолчанию: {$def}) (возможные значения: {$pos})
120+
cli-image-color_resolution-long =
121+
ЗНАЧЕНИЕ разрешения цвета, используемого с бэкендом SIXEL
122+
123+
(по умолчанию: {$def})
124+
(возможные значения: {$pos})
105125

106126
# VISUALS
107127
cli-visuals-heading = ВИЗУАЛЬНЫЕ ЭЛЕМЕНТЫ
@@ -115,8 +135,16 @@ cli-visuals-nerd_fonts =
115135

116136
# DEVELOPER
117137
cli-dev-heading = ДЛЯ РАЗРАБОТЧИКОВ
118-
cli-dev-output = Выводит Onefetch в определенном формате
119-
cli-dev-completion = Выводит файл автозаполнения для указанной ОБОЛОЧКИ
138+
cli-dev-output-short = Выводит Onefetch в определенном формате (возможные значения: {$pos})
139+
cli-dev-output-long =
140+
Выводит Onefetch в определенном формате
141+
142+
(возможные значения: {$pos})
143+
cli-dev-completion-short = Выводит файл автозаполнения для указанной ОБОЛОЧКИ (возможные значения: {$pos})
144+
cli-dev-completion-long =
145+
Выводит файл автозаполнения для указанной ОБОЛОЧКИ
146+
147+
(возможные значения: {$pos})
120148

121149
# OTHER
122150
cli-other-heading = ПРОЧЕЕ

src/cli.rs

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,11 @@ pub struct InfoCliOptions {
181181
#[derive(Clone, Debug, Args, PartialEq, Eq)]
182182
#[command(next_help_heading = tr!(ascii::HEADING))]
183183
pub struct AsciiCliOptions {
184-
#[arg(long, value_name = tr!(value::STRING), value_hint = ValueHint::CommandString, help = tr!(ascii::ASCII_INPUT))]
184+
#[arg(long, value_name = tr!(value::STRING), value_hint = ValueHint::CommandString)]
185+
#[arg(
186+
help = tr!(ascii::ascii_input::SHORT),
187+
long_help = tr!(ascii::ascii_input::LONG)
188+
)]
185189
pub ascii_input: Option<String>,
186190
#[arg(
187191
long,
@@ -201,7 +205,13 @@ pub struct AsciiCliOptions {
201205
help = tr!(ascii::ASCII_LANGUAGE)
202206
)]
203207
pub ascii_language: Option<Language>,
204-
#[arg(long, default_value = "auto", value_name = tr!(value::WHEN), value_enum, help = tr!(ascii::TRUE_COLOR))]
208+
#[arg(long, value_name = tr!(value::WHEN), value_enum, default_value = "auto")]
209+
#[arg(
210+
help = tr!(ascii::true_color::SHORT, def => "auto", pos => "auto, never, always"),
211+
long_help = tr!(ascii::true_color::LONG, def => "auto", pos => "auto, never, always"),
212+
hide_possible_values = true,
213+
hide_default_value = true
214+
)]
205215
pub true_color: When,
206216
}
207217

@@ -210,16 +220,26 @@ pub struct AsciiCliOptions {
210220
pub struct ImageCliOptions {
211221
#[arg(long, short, value_name = tr!(value::IMAGE), value_hint = ValueHint::FilePath, help = tr!(image::IMAGE))]
212222
pub image: Option<PathBuf>,
213-
#[arg(long, value_enum, requires = "image", value_name = tr!(value::PROTOCOL), help = tr!(image::IMAGE_PROTOCOL))]
223+
#[arg(long, value_enum, requires = "image", value_name = tr!(value::PROTOCOL))]
224+
#[arg(
225+
help = tr!(image::image_protocol::SHORT, pos => "kitty, sixel, iterm"),
226+
long_help = tr!(image::image_protocol::LONG, pos => "kitty, sixel, iterm"),
227+
hide_possible_values = true
228+
)]
214229
pub image_protocol: Option<ImageProtocol>,
215230
#[arg(
216231
long,
217232
value_name = tr!(value::VALUE),
218233
requires = "image",
219234
default_value_t = 16usize,
220235
value_parser = PossibleValuesParser::new(COLOR_RESOLUTIONS)
221-
.map(|s| s.parse::<usize>().unwrap()),
222-
help = tr!(image::COLOR_RESOLUTION)
236+
.map(|s| s.parse::<usize>().unwrap())
237+
)]
238+
#[arg(
239+
help = tr!(image::color_resolution::SHORT, def => 16, pos => COLOR_RESOLUTIONS.join(", ")),
240+
long_help = tr!(image::color_resolution::LONG, def => 16, pos => COLOR_RESOLUTIONS.join(", ")),
241+
hide_default_value = true,
242+
hide_possible_values = true
223243
)]
224244
pub color_resolution: usize,
225245
}
@@ -233,12 +253,21 @@ pub struct TextForamttingCliOptions {
233253
value_name = "X",
234254
value_parser = value_parser!(u8).range(..16),
235255
num_args = 1..=6,
236-
help = tr!(text::COLORS)
256+
)]
257+
#[arg(
258+
help = tr!(text::colors::SHORT),
259+
long_help = tr!(text::colors::LONG)
237260
)]
238261
pub text_colors: Vec<u8>,
239262
#[arg(long, short = 'z', help = tr!(text::ISO_TIME))]
240263
pub iso_time: bool,
241-
#[arg(long, value_name = tr!(value::SEPARATOR), default_value = "plain", value_enum, help = tr!(text::NUMBER_SEPARATOR))]
264+
#[arg(long, value_name = tr!(value::SEPARATOR), value_enum, default_value = "plain")]
265+
#[arg(
266+
help = tr!(text::number_separator::SHORT, def => "plain", pos => "plain, comma, space, underscore"),
267+
long_help = tr!(text::number_separator::LONG, def => "plain", pos => "plain, comma, space, underscore"),
268+
hide_default_value = true,
269+
hide_possible_values = true,
270+
)]
242271
pub number_separator: NumberSeparator,
243272
#[arg(long, help = tr!(text::NO_BOLD))]
244273
pub no_bold: bool,
@@ -257,9 +286,19 @@ pub struct VisualsCliOptions {
257286
#[derive(Clone, Debug, Args, PartialEq, Eq, Default)]
258287
#[command(next_help_heading = tr!(dev::HEADING))]
259288
pub struct DeveloperCliOptions {
260-
#[arg(long, short, value_name = tr!(value::FORMAT), value_enum, help = tr!(dev::OUTPUT))]
289+
#[arg(long, short, value_name = tr!(value::FORMAT), value_enum)]
290+
#[arg(
291+
help = tr!(dev::output::SHORT, pos => "json, yaml"),
292+
long_help = tr!(dev::output::LONG, pos => "json, yaml"),
293+
hide_possible_values = true
294+
)]
261295
pub output: Option<SerializationFormat>,
262-
#[arg(long = "generate", value_name = tr!(value::SHELL), value_enum, help = tr!(dev::COMPLETION))]
296+
#[arg(long = "generate", value_name = tr!(value::SHELL), value_enum)]
297+
#[arg(
298+
help = tr!(dev::completion::SHORT, pos => "bash, elvish, fish, powershell, zsh"),
299+
long_help = tr!(dev::completion::LONG, pos => "bash, elvish, fish, powershell, zsh"),
300+
hide_possible_values = true,
301+
)]
263302
pub completion: Option<Shell>,
264303
}
265304

0 commit comments

Comments
 (0)