i18n: update

This commit is contained in:
iff 2024-12-07 01:01:04 +01:00
parent c10f08a0c2
commit 8e36542f46
4 changed files with 144 additions and 131 deletions

View file

@ -2,150 +2,98 @@ _version = 2
[help] [help]
en = ''' en = '''
Usage: pay-respects [your shell] [--alias [alias]] Usage:
Example 1, manual aliasing: `%{manual}` %{eval}: Add the following line to your configuration file:
%{eval_examples}
The command will output the command that you can use to execute the binary with %{manual}: Add the following output to your configuration file
the correct environment. You can alias such output to a shorter key. Such as %{manual_examples}
`%{manual_example}`)
Example 2, auto aliasing: `%{auto}`
The command will output a declaration that can be directly embedded in your
config file with `%{auto_example}`. For fish, use
`%{auto_example_fish}` instead.
''' '''
es = ''' es = '''
Uso: pay-respects [tu shell] [--alias [alias]] Uso:
Ejemplo 1, alias manual: `%{manual}` %{eval}: Agrega la siguiente línea a tu archivo de configuración:
%{eval_examples}
El comando mostrará el comando que puedes usar para ejecutar el binario con el %{manual}: Agrega la siguiente salida a tu archivo de configuración
entorno correcto. Puedes asociar dicho comando a una tecla más corta. Por ejemplo %{manual_examples}
`%{manual_example}`)
Ejemplo 2, alias automático: `%{auto}`
El comando mostrará una declaración que puede ser incrustada directamente en tu
archivo de configuración con `%{auto_example}`. Para fish, usa
`%{auto_example_fish}` en su lugar.
''' '''
de = ''' de = '''
Verwendung: pay-respects [deine Shell] [--alias [alias]] Verwendung:
Beispiel 1, manuelles Alias: `%{manual}` %{eval}: Fügen Sie die folgende Zeile zu Ihrer Konfigurationsdatei hinzu:
%{eval_examples}
Der Befehl gibt den Befehl aus, den du verwenden kannst, um das Binär mit der %{manual}: Fügen Sie die folgende Ausgabe zu Ihrer Konfigurationsdatei hinzu:
richtigen Umgebung auszuführen. Du kannst ein solches Ergebnis einem kürzeren %{manual_examples}
Schlüssel zuordnen. Zum Beispiel `%{manual_example}`)
Beispiel 2, automatisches Alias: `%{auto}`
Der Befehl gibt eine Deklaration aus, die direkt in deine Konfigurationsdatei
mit `%{auto_example}` eingebettet werden kann. Für fish, verwende
`%{auto_example_fish}` stattdessen.
''' '''
fr = ''' fr = '''
Utilisation: pay-respects [votre shell] [--alias [alias]] Utilisation :
Exemple 1, alias manuel: `%{manual}` %{eval} : Ajoutez la ligne suivante à votre fichier de configuration :
%{eval_examples}
La commande affichera la commande que vous pouvez utiliser pour exécuter le %{manual} : Ajoutez la sortie suivante à votre fichier de configuration :
binaire avec l'environnement correct. Vous pouvez associer une telle sortie à
une touche plus courte. Par exemple `%{manual_example}`)
Exemple 2, alias automatique: `%{auto}` %{manual_examples}
La commande affichera une déclaration qui peut être directement intégrée dans
votre fichier de configuration avec `%{auto_example}`. Pour fish, utilisez
`%{auto_example_fish}` à la place.
''' '''
it = ''' it = '''
Utilizzo: pay-respects [la tua shell] [--alias [alias]] Utilizzo:
Esempio 1, alias manuale: `%{manual}` %{eval}: Aggiungi la seguente riga al tuo file di configurazione:
%{eval_examples}
Il comando restituirà il comando che puoi utilizzare per eseguire il binario con %{manual}: Aggiungi l'output seguente al tuo file di configurazione:
l'ambiente corretto. Puoi associare tale output a una chiave più corta. Ad %{manual_examples}
esempio `%{manual_example}`)
Esempio 2, alias automatico: `%{auto}`
Il comando restituirà una dichiarazione che può essere incorporata direttamente
nel tuo file di configurazione con `%{auto_example}`. Per fish, utilizza
`%{auto_example_fish}` invece.
''' '''
pt = ''' pt = '''
Uso: pay-respects [seu shell] [--alias [alias]] Uso:
Exemplo 1, alias manual: `%{manual}` %{eval}: Adicione a seguinte linha ao seu arquivo de configuração:
%{eval_examples}
O comando exibirá o comando que você pode usar para executar o binário com o %{manual}: Adicione a seguinte saída ao seu arquivo de configuração:
ambiente correto. Você pode associar tal saída a uma tecla mais curta. Por %{manual_examples}
exemplo `%{manual_example}`)
Exemplo 2, alias automático: `%{auto}`
O comando exibirá uma declaração que pode ser incorporada diretamente em seu
arquivo de configuração com `%{auto_example}`. Para fish, use
`%{auto_example_fish}` em vez disso.
''' '''
ru = ''' ru = '''
Использование: pay-respects [ваш shell] [--alias [alias]] Использование:
Пример 1, ручное создание псевдонима: `%{manual}` %{eval}: Добавьте следующую строку в ваш файл конфигурации:
%{eval_examples}
Команда выведет команду, которую вы можете использовать для выполнения бинарного %{manual}: Добавьте следующий вывод в ваш файл конфигурации:
файла с правильной средой. Вы можете создать псевдоним для такого вывода с %{manual_examples}
помощью более короткого ключа. Например, `%{manual_example}`)
Пример 2, автоматическое создание псевдонима: `%{auto}`
Команда выведет декларацию, которую можно непосредственно встроить в ваш файл
конфигурации с помощью `%{auto_example}`. Для fish используйте
`%{auto_example_fish}` вместо этого.
''' '''
ja = ''' ja = '''
使: pay-respects [] [--alias [alias]] 使:
1: `%{manual}` %{eval}: :
%{eval_examples}
%{manual}: :
`%{manual_example}`) %{manual_examples}
2: `%{auto}`
`%{auto_example}`
fish`%{auto_example_fish}`使
''' '''
ko = ''' ko = '''
: pay-respects [ ] [--alias [alias]] :
1, : `%{manual}` %{eval}: :
%{eval_examples}
. %{manual}: :
. `%{manual_example}`) %{manual_examples}
2, : `%{auto}`
`%{auto_example}` . fish
`%{auto_example_fish}` .
''' '''
zh = ''' zh = '''
: pay-respects [ shell] [--alias [alias]] 使:
1: `%{manual}` %{eval}:
%{eval_examples}
使 %{manual}:
`%{manual_example}`) %{manual_examples}
2: `%{auto}`
`%{auto_example}`
fish 使`%{auto_example_fish}`
''' '''
[no-env-setup] [no-env-setup]
en = "No %{var} in environment. Have you aliased the command with the correct argument?\n\nUse `%{help}` for help." en = "No %{var} in environment. Have you aliased the command with the correct argument?\n\nUse `%{help}` for help."
es = "No se encontró %{var} en el entorno. ¿Has aliado el comando con el argumento correcto?\n\nUsa `%{help}` para obtener ayuda." es = "No se encontró %{var} en el entorno. ¿Has aliado el comando con el argumento correcto?\n\nUsa `%{help}` para obtener ayuda."
@ -170,17 +118,29 @@ ja = "シェルが指定されていません。シェルを指定してくだ
ko = "쉘이 지정되지 않았습니다. 쉘을 지정하십시오." ko = "쉘이 지정되지 않았습니다. 쉘을 지정하십시오."
zh = "未指定 shell。请指定一个 shell。" zh = "未指定 shell。请指定一个 shell。"
[no-command] [multi-suggest]
en = "No command found." en = "%{num} suggestions found"
es = "No se encontró ningún comando." es = "%{num} sugerencias encontradas"
de = "Kein Befehl gefunden." de = "%{num} Vorschläge gefunden"
fr = "Aucune commande trouvée." fr = "%{num} suggestions trouvées"
it = "Nessun comando trovato." it = "%{num} proposte trovate"
pt = "Nenhum comando encontrado." pt = "%{num} sugestões encontradas"
ru = "Команда не найдена." ru = "Найдено %{num} предложений"
ja = "コマンドが見つかりません。" ja = "%{num} 件の提案が見つかりました"
ko = "명령을 찾을 수 없습니다." ko = "%{num} 개의 제안이 발견되었습니다"
zh = "找不到命令。" zh = "找到 %{num} 个建议"
[install-package]
en = "Install one of the following package?"
es = "¿Instalar uno de los siguientes paquetes?"
de = "Eines der folgenden Pakete installieren?"
fr = "Installer l'un des paquets suivants ?"
it = "Installare uno dei seguenti pacchetti?"
pt = "Instalar um dos seguintes pacotes?"
ru = "Установить один из следующих пакетов?"
ja = "次のパッケージのいずれかをインストールしますか?"
ko = "다음 패키지 중 하나를 설치하시겠습니까?"
zh = "安装以下包之一?"
[ai-suggestion] [ai-suggestion]
en = "Suggestion from AI" en = "Suggestion from AI"
@ -242,6 +202,30 @@ ja = "コマンドの提案が見つかりません"
ko = "명령에 대한 제안을 찾을 수 없습니다" ko = "명령에 대한 제안을 찾을 수 없습니다"
zh = "找不到命令的建议" zh = "找不到命令的建议"
[command-not-found]
en = "Command not found"
es = "Comando no encontrado"
de = "Befehl nicht gefunden"
fr = "Commande introuvable"
it = "Comando non trovato"
pt = "Comando não encontrado"
ru = "Команда не найдена"
ja = "コマンドが見つかりません"
ko = "명령을 찾을 수 없습니다"
zh = "找不到命令"
[package-not-found]
en = "No matching package found"
es = "No se encontró ningún paquete coincidente"
de = "Kein passendes Paket gefunden"
fr = "Aucun paquet correspondant trouvé"
it = "Nessun pacchetto corrispondente trovato"
pt = "Nenhum pacote correspondente encontrado"
ru = "Совпадающий пакет не найден"
ja = "一致するパッケージが見つかりません"
ko = "일치하는 패키지를 찾을 수 없습니다"
zh = "找不到匹配的包"
[contribute] [contribute]
en = "If you think there should be a suggestion, please open an issue or send a pull request!" en = "If you think there should be a suggestion, please open an issue or send a pull request!"
es = "Si crees que debería haber una sugerencia, ¡por favor abre un issue o envía un pull request!" es = "Si crees que debería haber una sugerencia, ¡por favor abre un issue o envía un pull request!"

View file

@ -1,4 +1,5 @@
use crate::shell::initialization; use crate::shell::initialization;
use colored::Colorize;
pub enum Status { pub enum Status {
Continue, Continue,
@ -67,11 +68,17 @@ fn print_help() {
"{}", "{}",
t!( t!(
"help", "help",
manual = "pay-respects bash", eval = "Bash / Zsh / Fish".bold(),
manual_example = "alias f=$(pay-respects bash)", eval_examples = r#"
auto = "pay-respects bash --alias f", eval "$(pay-respects bash --alias)"
auto_example = "eval $(pay-respects bash --alias f)", eval "$(pay-respects zsh --alias)"
auto_example_fish = "pay-respects fish --alias | source", pay-respects fish --alias | source
"#,
manual = "Nushell / PowerShell".bold(),
manual_examples = r#"
pay-respects nushell [--alias <alias>]
pay-respects pwsh [--alias <alias>] [--nocnf]
"#
) )
); );
} }

View file

@ -55,6 +55,12 @@ pub fn cnf(data: &mut Data) {
let mut split_command = data.split.clone(); let mut split_command = data.split.clone();
let executable = split_command[0].as_str(); let executable = split_command[0].as_str();
eprintln!(
"{}: {}: {}\n",
shell.red(),
t!("command-not-found"),
executable
);
let best_match = best_match_path(executable); let best_match = best_match_path(executable);
if best_match.is_some() { if best_match.is_some() {
@ -87,22 +93,37 @@ pub fn cnf(data: &mut Data) {
} }
}; };
let packages = match system::get_packages(&shell, &package_manager, executable) { let packages = match system::get_packages(&shell, &package_manager, executable)
{
Some(packages) => packages, Some(packages) => packages,
None => { None => {
eprintln!("no package found"); eprintln!(
"{}: {}",
"pay-respects".red(),
t!("package-not-found")
);
return; return;
} }
}; };
let ans = Select::new("Select a package to install", packages).prompt(); let style = ui::Styled::default();
let package = match ans { let render_config = ui::RenderConfig::default()
Ok(package) => package, .with_prompt_prefix(style);
Err(_) => { let msg = format!("{}", t!("install-package"))
eprintln!("no package selected"); .bold()
return; .blue();
} let hint = format!(
}; "{} {} {}",
"[↑/↓]".blue(),
t!("confirm-yes").green(),
"[Ctrl+C]".red()
);
eprintln!("{}", msg);
eprintln!("{}", hint);
let package = Select::new("\n", packages)
.without_help_message()
.with_render_config(render_config)
.prompt().unwrap();
// retry after installing package // retry after installing package
if system::install_package(&shell, &package_manager, &package) { if system::install_package(&shell, &package_manager, &package) {

View file

@ -92,13 +92,14 @@ pub fn select_candidate(data: &mut Data) {
.with_answered_prompt_prefix(style) .with_answered_prompt_prefix(style)
.with_highlighted_option_prefix(style); .with_highlighted_option_prefix(style);
let msg = format!("{} suggestions found:", candidates.len()) let msg = format!("{}", t!("multi-suggest", num = candidates.len()))
.bold() .bold()
.blue(); .blue();
let confirm = format!("[{}]", t!("confirm-yes")).green();
let hint = format!( let hint = format!(
"{} {} {}", "{} {} {}",
"[↑/↓]".blue(), "[↑/↓]".blue(),
t!("confirm-yes").green(), confirm,
"[Ctrl+C]".red() "[Ctrl+C]".red()
); );
eprintln!("{}", msg); eprintln!("{}", msg);