Skip to content

Commit 0952346

Browse files
committed
translate cli info section to eng and rus
1 parent 459ed26 commit 0952346

File tree

3 files changed

+79
-35
lines changed

3 files changed

+79
-35
lines changed

locales/en-US/cli.ftl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,28 @@
11
cli-input = Run as if onefetch was started in <input> instead of the current working directory
2+
3+
# Value name
4+
cli-value-num = NUM
5+
cli-value-field = FIELD
6+
cli-value-regex = REGEX
7+
cli-value-exclude = EXCLUDE
8+
9+
# INFO
10+
cli-info-heading = INFO
11+
cli-info-disabled-fields = Allows you to disable FIELD(s) from appearing in the output
12+
cli-info-no-title = Hides the title
13+
cli-info-number-of-authors = Maximum NUM of authors to be shown
14+
cli-info-number-of-languages = Maximum NUM of languages to be shown
15+
cli-info-number-of-file-churns = Maximum NUM of file churns to be shown
16+
cli-info-churn-pool-size =
17+
Minimum NUM of commits from HEAD used to compute the churn summary
18+
19+
By default, the actual value is non-deterministic due to time-based computation
20+
and will be displayed under the info title "Churn (NUM)"
21+
cli-info-exclude = Ignore all files & directories matching EXCLUDE
22+
cli-info-no-bots = Exclude [bot] commits. Use <REGEX> to override the default pattern
23+
cli-info-no-merges = Ignores merge commits
24+
cli-info-email = Show the email address of each author
25+
cli-info-http-url = Display repository URL as HTTP
26+
cli-info-hide-token = Hide token in repository URL
27+
cli-info-include-hidden = Count hidden files and directories
28+
cli-info-type = Filters output by language type

locales/ru-RU/cli.ftl

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,28 @@
1-
cli-input = Запустить так, как будто onefetch был запущен в <input> вместо текущего рабочего каталога
1+
cli-input = Запустить так, как будто onefetch был запущен в <input> вместо текущего рабочего каталога
2+
3+
# Value name
4+
cli-value-num = КОЛ-ВО
5+
cli-value-field = ПОЛЕ
6+
cli-value-regex = РЕГ. ВЫРАЖЕНИЕ
7+
cli-value-exclude = ИСКЛЮЧЕННОЕ
8+
9+
# INFO
10+
cli-info-heading = ИНФОРМАЦИЯ
11+
cli-info-disabled-fields = Позволяет отключить отображение ПОЛЯ(ПОЛЕЙ) в выводе
12+
cli-info-no-title = Скрывает заголовок
13+
cli-info-number-of-authors = Максимальное КОЛ-ВО авторов для отображения
14+
cli-info-number-of-languages = Максимальное КОЛ-ВО языков для отображения
15+
cli-info-number-of-file-churns = Максимальное КОЛ-ВО изменений файлов для отображения
16+
cli-info-churn-pool-size =
17+
Минимальное КОЛ-ВО коммитов от HEAD, используемых для вычисления сводки изменений
18+
19+
По умолчанию фактическое значение недетерминировано из-за вычислений на основе времени
20+
и будет отображаться под заголовком информации "Изменения (КОЛ-ВО)"
21+
cli-info-exclude = Игнорировать все файлы и каталоги, соответствующие ИСКЛЮЧЕННОМУ
22+
cli-info-no-bots = Исключить коммиты [ботов]. Используйте <РЕГ. ВЫРАЖЕНИЕ> для переопределения шаблона по умолчанию
23+
cli-info-no-merges = Игнорировать коммиты слияния
24+
cli-info-email = Показать адрес электронной почты каждого автора
25+
cli-info-http-url = Отображать URL репозитория как HTTP
26+
cli-info-hide-token = Скрыть токен в URL репозитория
27+
cli-info-include-hidden = Учитывать скрытые файлы и каталоги
28+
cli-info-type = Фильтровать вывод по типу языка

src/cli.rs

Lines changed: 24 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use crate::i18n::tr;
12
use crate::info::langs::language::{Language, LanguageType};
23
use crate::info::utils::info_field::InfoType;
34
use crate::ui::printer::SerializationFormat;
@@ -9,7 +10,6 @@ use clap_complete::{generate, Generator, Shell};
910
use num_format::CustomFormat;
1011
use onefetch_image::ImageProtocol;
1112
use onefetch_manifest::ManifestType;
12-
use crate::i18n::tr;
1313
use regex::Regex;
1414
use serde::Serialize;
1515
use std::env;
@@ -24,8 +24,12 @@ pub const NO_BOTS_DEFAULT_REGEX_PATTERN: &str = r"(?:-|\s)[Bb]ot$|\[[Bb]ot\]";
2424
#[derive(Clone, Debug, Parser, PartialEq, Eq)]
2525
#[command(version, about)]
2626
pub struct CliOptions {
27-
#[arg(help = tr!("cli-input"))]
28-
#[arg(default_value = ".", hide_default_value = true, value_hint = ValueHint::DirPath)]
27+
#[arg(
28+
default_value = ".",
29+
hide_default_value = true,
30+
value_hint = ValueHint::DirPath,
31+
help = tr!("cli-input")
32+
)]
2933
pub input: PathBuf,
3034
#[command(flatten)]
3135
pub info: InfoCliOptions,
@@ -44,70 +48,56 @@ pub struct CliOptions {
4448
}
4549

4650
#[derive(Clone, Debug, Args, PartialEq, Eq)]
47-
#[command(next_help_heading = "INFO")]
51+
#[command(next_help_heading = tr!("cli-info-heading"))]
4852
pub struct InfoCliOptions {
49-
/// Allows you to disable FIELD(s) from appearing in the output
5053
#[arg(
5154
long,
5255
short,
56+
help = tr!("cli-info-disabled-fields"),
5357
num_args = 1..,
5458
hide_possible_values = true,
5559
value_enum,
56-
value_name = "FIELD"
60+
value_name = tr!("cli-value-field")
5761
)]
5862
pub disabled_fields: Vec<InfoType>,
59-
/// Hides the title
60-
#[arg(long)]
63+
#[arg(long, help = tr!("cli-info-no-title"))]
6164
pub no_title: bool,
62-
/// Maximum NUM of authors to be shown
63-
#[arg(long, default_value_t = 3usize, value_name = "NUM")]
65+
#[arg(long, default_value_t = 3usize, value_name = tr!("cli-value-num"), help = tr!("cli-info-number-of-authors"))]
6466
pub number_of_authors: usize,
65-
/// Maximum NUM of languages to be shown
66-
#[arg(long, default_value_t = 6usize, value_name = "NUM")]
67+
#[arg(long, default_value_t = 6usize, value_name = tr!("cli-value-num"), help = tr!("cli-info-number-of-languages"))]
6768
pub number_of_languages: usize,
68-
/// Maximum NUM of file churns to be shown
69-
#[arg(long, default_value_t = 3usize, value_name = "NUM")]
69+
#[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-
/// Minimum NUM of commits from HEAD used to compute the churn summary
72-
///
73-
/// By default, the actual value is non-deterministic due to time-based computation
74-
/// and will be displayed under the info title "Churn (NUM)"
75-
#[arg(long, value_name = "NUM")]
71+
#[arg(long, value_name = "NUM", help = tr!("cli-info-churn-pool-size"))]
7672
pub churn_pool_size: Option<usize>,
77-
/// Ignore all files & directories matching EXCLUDE
78-
#[arg(long, short, num_args = 1..)]
73+
#[arg(long, short, num_args = 1.., help = tr!("cli-info-exclude"), value_name = tr!("cli-value-exclude"))]
7974
pub exclude: Vec<String>,
80-
/// Exclude [bot] commits. Use <REGEX> to override the default pattern
8175
#[arg(
8276
long,
8377
num_args = 0..=1,
8478
require_equals = true,
8579
default_missing_value = NO_BOTS_DEFAULT_REGEX_PATTERN,
86-
value_name = "REGEX"
80+
value_name = tr!("cli-value-regex"),
81+
help = tr!("cli-info-no-bots")
8782
)]
8883
pub no_bots: Option<MyRegex>,
89-
/// Ignores merge commits
90-
#[arg(long)]
84+
#[arg(long, help = tr!("cli-info-no-merges"))]
9185
pub no_merges: bool,
92-
/// Show the email address of each author
93-
#[arg(long, short = 'E')]
86+
#[arg(long, short = 'E', help = tr!("cli-info-email"))]
9487
pub email: bool,
95-
/// Display repository URL as HTTP
96-
#[arg(long)]
88+
#[arg(long, help = tr!("cli-info-http-url"))]
9789
pub http_url: bool,
98-
/// Hide token in repository URL
99-
#[arg(long)]
90+
#[arg(long, help = tr!("cli-info-hide-token"))]
10091
pub hide_token: bool,
101-
/// Count hidden files and directories
102-
#[arg(long)]
92+
#[arg(long, help = tr!("cli-info-include-hidden"))]
10393
pub include_hidden: bool,
104-
/// Filters output by language type
10594
#[arg(
10695
long,
10796
num_args = 1..,
10897
default_values = &["programming", "markup"],
10998
short = 'T',
11099
value_enum,
100+
help = tr!("cli-info-type")
111101
)]
112102
pub r#type: Vec<LanguageType>,
113103
}

0 commit comments

Comments
 (0)