Skip to content

Commit 2386d1b

Browse files
committed
translate cli
1 parent a4e19c9 commit 2386d1b

File tree

3 files changed

+127
-52
lines changed

3 files changed

+127
-52
lines changed

locales/en-US/cli.ftl

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,55 @@ cli-info-email = Show the email address of each author
3535
cli-info-http-url = Display repository URL as HTTP
3636
cli-info-hide-token = Hide token in repository URL
3737
cli-info-include-hidden = Count hidden files and directories
38-
cli-info-type = Filters output by language type
38+
cli-info-type = Filters output by language type
39+
40+
# TEXT FORMATTING
41+
cli-text-heading = TEXT FORMATTING
42+
cli-text-colors =
43+
Changes the text colors (X X X...)
44+
45+
Goes in order of title, ~, underline, subtitle, colon, and info
46+
47+
For example:
48+
49+
'--text-colors 9 10 11 12 13 14'
50+
cli-text-iso-time = Use ISO 8601 formatted timestamps
51+
cli-text-number-separator = Which thousands SEPARATOR to use
52+
cli-text-no-bold = Turns off bold formatting
53+
54+
# ASCII
55+
cli-ascii-heading = ASCII
56+
cli-ascii-ascii-input =
57+
Takes a non-empty STRING as input to replace the ASCII logo
58+
59+
It is possible to pass a generated STRING by command substitution
60+
61+
For example:
62+
63+
'--ascii-input "$(fortune | cowsay -W 25)"'
64+
cli-ascii-ascii-colors = Colors (X X X...) to print the ascii art
65+
cli-ascii-ascii-language = Which LANGUAGE's ascii art to print
66+
cli-ascii-true-color =
67+
Specify when to use true color
68+
69+
If set to auto: true color will be enabled if supported by the terminal
70+
71+
# VISUALS
72+
cli-visuals-heading = VISUALS
73+
cli-visuals-no-color-palette = Hides the color palette
74+
cli-visuals-no-art = Hides the ascii art or image if provided
75+
cli-visuals-nerd-fonts =
76+
Use Nerd Font icons
77+
78+
Replaces language chips with Nerd Font icons
79+
80+
81+
# DEVELOPER
82+
cli-dev-heading = DEVELOPER
83+
cli-dev-output = Outputs Onefetch in a specific format
84+
cli-dev-completion = If provided, outputs the completion file for given SHELL
85+
86+
# OTHER
87+
cli-other-heading = OTHER
88+
cli-other-languages = Prints out supported languages
89+
cli-other-package-managers = Prints out supported package managers

locales/ru-RU/cli.ftl

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,55 @@ cli-info-email = Показать адрес электронной почты
3535
cli-info-http-url = Отображать URL репозитория как HTTP
3636
cli-info-hide-token = Скрыть токен в URL репозитория
3737
cli-info-include-hidden = Учитывать скрытые файлы и каталоги
38-
cli-info-type = Фильтровать вывод по типу языка
38+
cli-info-type = Фильтровать вывод по типу языка
39+
40+
# TEXT FORMATTING
41+
cli-text-heading = ФОРМАТИРОВАНИЕ ТЕКСТА
42+
cli-text-colors =
43+
Изменяет цвета текста (X X X...)
44+
45+
Идет в порядке заголовка, ~, подчеркивания, подзаголовка, двоеточия и информации
46+
47+
Например:
48+
49+
'--text-colors 9 10 11 12 13 14'
50+
cli-text-iso-time = Использовать временные метки в формате ISO 8601
51+
cli-text-number-separator = Какой РАЗДЕЛИТЕЛЬ тысяч использовать
52+
cli-text-no-bold = Отключает жирное форматирование
53+
54+
# ASCII
55+
cli-ascii-heading = ASCII
56+
cli-ascii-ascii-input =
57+
Принимает непустую СТРОКУ в качестве входных данных для замены ASCII логотипа
58+
59+
Можно передать сгенерированную СТРОКУ с помощью подстановки команд
60+
61+
Например:
62+
63+
'--ascii-input "$(fortune | cowsay -W 25)"'
64+
cli-ascii-ascii-colors = Цвета (X X X...) для печати ASCII арта
65+
cli-ascii-ascii-language = ASCII арт какого ЯЗЫКА печатать
66+
cli-ascii-true-color =
67+
Указать, когда использовать true-color
68+
69+
Если установлено в auto: true-color будет включен, если он поддерживается терминалом
70+
71+
# VISUALS
72+
cli-visuals-heading = ВИЗУАЛЬНЫЕ ЭЛЕМЕНТЫ
73+
cli-visuals-no-color-palette = Скрывает цветовую палитру
74+
cli-visuals-no-art = Скрывает ASCII арт или изображение, если оно предоставлено
75+
cli-visuals-nerd-fonts =
76+
Использовать иконки Nerd Font
77+
78+
Заменяет языковые чипы иконками Nerd Font
79+
# not sure if ↑ this ↑ is right translation for "chips"
80+
81+
# DEVELOPER
82+
cli-dev-heading = ДЛЯ РАЗРАБОТЧИКОВ
83+
cli-dev-output = Выводит Onefetch в определенном формате
84+
cli-dev-completion = Выводит файл автозаполнения для указанной ОБОЛОЧКИ
85+
86+
# OTHER
87+
cli-other-heading = ПРОЧЕЕ
88+
cli-other-languages = Выводит поддерживаемые языки
89+
cli-other-package-managers = Выводит поддерживаемые менеджеры пакетов

src/cli.rs

Lines changed: 23 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -104,39 +104,29 @@ pub struct InfoCliOptions {
104104
}
105105

106106
#[derive(Clone, Debug, Args, PartialEq, Eq)]
107-
#[command(next_help_heading = "ASCII")]
107+
#[command(next_help_heading = tr!("cli-ascii-heading"))]
108108
pub struct AsciiCliOptions {
109-
/// Takes a non-empty STRING as input to replace the ASCII logo
110-
///
111-
/// It is possible to pass a generated STRING by command substitution
112-
///
113-
/// For example:
114-
///
115-
/// '--ascii-input "$(fortune | cowsay -W 25)"'
116-
#[arg(long, value_name = tr!("cli-value-string"), value_hint = ValueHint::CommandString)]
109+
#[arg(long, value_name = tr!("cli-value-string"), value_hint = ValueHint::CommandString, help = tr!("cli-ascii-ascii-input"))]
117110
pub ascii_input: Option<String>,
118-
/// Colors (X X X...) to print the ascii art
119111
#[arg(
120112
long,
121113
num_args = 1..,
122114
value_name = "X",
123115
short = 'c',
124116
value_parser = value_parser!(u8).range(..16),
117+
help = tr!("cli-ascii-ascii-colors")
125118
)]
126119
pub ascii_colors: Vec<u8>,
127-
/// Which LANGUAGE's ascii art to print
128120
#[arg(
129121
long,
130122
short,
131123
value_name = tr!("cli-value-language"),
132124
value_enum,
133-
hide_possible_values = true
125+
hide_possible_values = true,
126+
help = tr!("cli-ascii-ascii-language")
134127
)]
135128
pub ascii_language: Option<Language>,
136-
/// Specify when to use true color
137-
///
138-
/// If set to auto: true color will be enabled if supported by the terminal
139-
#[arg(long, default_value = "auto", value_name = tr!("cli-value-when"), value_enum)]
129+
#[arg(long, default_value = "auto", value_name = tr!("cli-value-when"), value_enum, help = tr!("cli-ascii-true-color"))]
140130
pub true_color: When,
141131
}
142132

@@ -162,68 +152,51 @@ pub struct ImageCliOptions {
162152
}
163153

164154
#[derive(Clone, Debug, Args, PartialEq, Eq)]
165-
#[command(next_help_heading = "TEXT FORMATTING")]
155+
#[command(next_help_heading = tr!("cli-text-heading"))]
166156
pub struct TextForamttingCliOptions {
167-
/// Changes the text colors (X X X...)
168-
///
169-
/// Goes in order of title, ~, underline, subtitle, colon, and info
170-
///
171-
/// For example:
172-
///
173-
/// '--text-colors 9 10 11 12 13 14'
157+
174158
#[arg(
175159
long,
176160
short,
177161
value_name = "X",
178162
value_parser = value_parser!(u8).range(..16),
179-
num_args = 1..=6
163+
num_args = 1..=6,
164+
help = tr!("cli-text-colors")
180165
)]
181166
pub text_colors: Vec<u8>,
182-
/// Use ISO 8601 formatted timestamps
183-
#[arg(long, short = 'z')]
167+
#[arg(long, short = 'z', help = tr!("cli-text-iso-time"))]
184168
pub iso_time: bool,
185-
/// Which thousands SEPARATOR to use
186-
#[arg(long, value_name = tr!("cli-value-separator"), default_value = "plain", value_enum)]
169+
#[arg(long, value_name = tr!("cli-value-separator"), default_value = "plain", value_enum, help = tr!("cli-text-number-separator"))]
187170
pub number_separator: NumberSeparator,
188-
/// Turns off bold formatting
189-
#[arg(long)]
171+
#[arg(long, help = tr!("cli-text-no-bold"))]
190172
pub no_bold: bool,
191173
}
192174
#[derive(Clone, Debug, Args, PartialEq, Eq, Default)]
193-
#[command(next_help_heading = "VISUALS")]
175+
#[command(next_help_heading = tr!("cli-visuals-heading"))]
194176
pub struct VisualsCliOptions {
195-
/// Hides the color palette
196-
#[arg(long)]
177+
#[arg(long, help = tr!("cli-visuals-no-color-palette"))]
197178
pub no_color_palette: bool,
198-
/// Hides the ascii art or image if provided
199-
#[arg(long)]
179+
#[arg(long, help = tr!("cli-visuals-no-art"))]
200180
pub no_art: bool,
201-
/// Use Nerd Font icons
202-
///
203-
/// Replaces language chips with Nerd Font icons
204-
#[arg(long)]
181+
#[arg(long, help = tr!("cli-visuals-nerd-fonts"))]
205182
pub nerd_fonts: bool,
206183
}
207184

208185
#[derive(Clone, Debug, Args, PartialEq, Eq, Default)]
209-
#[command(next_help_heading = "DEVELOPER")]
186+
#[command(next_help_heading = tr!("cli-dev-heading"))]
210187
pub struct DeveloperCliOptions {
211-
/// Outputs Onefetch in a specific format
212-
#[arg(long, short, value_name = tr!("cli-value-format"), value_enum)]
188+
#[arg(long, short, value_name = tr!("cli-value-format"), value_enum, help = tr!("cli-dev-output"))]
213189
pub output: Option<SerializationFormat>,
214-
/// If provided, outputs the completion file for given SHELL
215-
#[arg(long = "generate", value_name = tr!("cli-value-shell"), value_enum)]
190+
#[arg(long = "generate", value_name = tr!("cli-value-shell"), value_enum, help = tr!("cli-dev-completion"))]
216191
pub completion: Option<Shell>,
217192
}
218193

219194
#[derive(Clone, Debug, Args, PartialEq, Eq, Default)]
220-
#[command(next_help_heading = "OTHER")]
195+
#[command(next_help_heading = tr!("cli-other-heading"))]
221196
pub struct OtherCliOptions {
222-
/// Prints out supported languages
223-
#[arg(long, short)]
197+
#[arg(long, short, help = tr!("cli-other-languages"))]
224198
pub languages: bool,
225-
/// Prints out supported package managers
226-
#[arg(long, short)]
199+
#[arg(long, short, help = tr!("cli-other-package-managers"))]
227200
pub package_managers: bool,
228201
}
229202

0 commit comments

Comments
 (0)