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]
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
the correct environment. You can alias such output to a shorter key. Such as
`%{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.
%{manual}: Add the following output to your configuration file
%{manual_examples}
'''
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
entorno correcto. Puedes asociar dicho comando a una tecla más corta. Por ejemplo
`%{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.
%{manual}: Agrega la siguiente salida a tu archivo de configuración
%{manual_examples}
'''
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
richtigen Umgebung auszuführen. Du kannst ein solches Ergebnis einem kürzeren
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.
%{manual}: Fügen Sie die folgende Ausgabe zu Ihrer Konfigurationsdatei hinzu:
%{manual_examples}
'''
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
binaire avec l'environnement correct. Vous pouvez associer une telle sortie à
une touche plus courte. Par exemple `%{manual_example}`)
%{manual} : Ajoutez la sortie suivante à votre fichier de configuration :
Exemple 2, alias automatique: `%{auto}`
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.
%{manual_examples}
'''
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
l'ambiente corretto. Puoi associare tale output a una chiave più corta. Ad
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.
%{manual}: Aggiungi l'output seguente al tuo file di configurazione:
%{manual_examples}
'''
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
ambiente correto. Você pode associar tal saída a uma tecla mais curta. Por
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.
%{manual}: Adicione a seguinte saída ao seu arquivo de configuração:
%{manual_examples}
'''
ru = '''
Использование: pay-respects [ваш shell] [--alias [alias]]
Использование:
Пример 1, ручное создание псевдонима: `%{manual}`
%{eval}: Добавьте следующую строку в ваш файл конфигурации:
%{eval_examples}
Команда выведет команду, которую вы можете использовать для выполнения бинарного
файла с правильной средой. Вы можете создать псевдоним для такого вывода с
помощью более короткого ключа. Например, `%{manual_example}`)
Пример 2, автоматическое создание псевдонима: `%{auto}`
Команда выведет декларацию, которую можно непосредственно встроить в ваш файл
конфигурации с помощью `%{auto_example}`. Для fish используйте
`%{auto_example_fish}` вместо этого.
%{manual}: Добавьте следующий вывод в ваш файл конфигурации:
%{manual_examples}
'''
ja = '''
使: pay-respects [] [--alias [alias]]
使:
1: `%{manual}`
%{eval}: :
%{eval_examples}
`%{manual_example}`)
2: `%{auto}`
`%{auto_example}`
fish`%{auto_example_fish}`使
%{manual}: :
%{manual_examples}
'''
ko = '''
: pay-respects [ ] [--alias [alias]]
:
1, : `%{manual}`
%{eval}: :
%{eval_examples}
.
. `%{manual_example}`)
2, : `%{auto}`
`%{auto_example}` . fish
`%{auto_example_fish}` .
%{manual}: :
%{manual_examples}
'''
zh = '''
: pay-respects [ shell] [--alias [alias]]
使:
1: `%{manual}`
%{eval}:
%{eval_examples}
使
`%{manual_example}`)
2: `%{auto}`
`%{auto_example}`
fish 使`%{auto_example_fish}`
%{manual}:
%{manual_examples}
'''
[no-env-setup]
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."
@ -170,17 +118,29 @@ ja = "シェルが指定されていません。シェルを指定してくだ
ko = "쉘이 지정되지 않았습니다. 쉘을 지정하십시오."
zh = "未指定 shell。请指定一个 shell。"
[no-command]
en = "No command found."
es = "No se encontró ningún comando."
de = "Kein Befehl gefunden."
fr = "Aucune commande trouvée."
it = "Nessun comando trovato."
pt = "Nenhum comando encontrado."
ru = "Команда не найдена."
ja = "コマンドが見つかりません。"
ko = "명령을 찾을 수 없습니다."
zh = "找不到命令。"
[multi-suggest]
en = "%{num} suggestions found"
es = "%{num} sugerencias encontradas"
de = "%{num} Vorschläge gefunden"
fr = "%{num} suggestions trouvées"
it = "%{num} proposte trovate"
pt = "%{num} sugestões encontradas"
ru = "Найдено %{num} предложений"
ja = "%{num} 件の提案が見つかりました"
ko = "%{num} 개의 제안이 발견되었습니다"
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]
en = "Suggestion from AI"
@ -242,6 +202,30 @@ ja = "コマンドの提案が見つかりません"
ko = "명령에 대한 제안을 찾을 수 없습니다"
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]
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!"

View file

@ -1,4 +1,5 @@
use crate::shell::initialization;
use colored::Colorize;
pub enum Status {
Continue,
@ -67,11 +68,17 @@ fn print_help() {
"{}",
t!(
"help",
manual = "pay-respects bash",
manual_example = "alias f=$(pay-respects bash)",
auto = "pay-respects bash --alias f",
auto_example = "eval $(pay-respects bash --alias f)",
auto_example_fish = "pay-respects fish --alias | source",
eval = "Bash / Zsh / Fish".bold(),
eval_examples = r#"
eval "$(pay-respects bash --alias)"
eval "$(pay-respects zsh --alias)"
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 executable = split_command[0].as_str();
eprintln!(
"{}: {}: {}\n",
shell.red(),
t!("command-not-found"),
executable
);
let best_match = best_match_path(executable);
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,
None => {
eprintln!("no package found");
eprintln!(
"{}: {}",
"pay-respects".red(),
t!("package-not-found")
);
return;
}
};
let ans = Select::new("Select a package to install", packages).prompt();
let package = match ans {
Ok(package) => package,
Err(_) => {
eprintln!("no package selected");
return;
}
};
let style = ui::Styled::default();
let render_config = ui::RenderConfig::default()
.with_prompt_prefix(style);
let msg = format!("{}", t!("install-package"))
.bold()
.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
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_highlighted_option_prefix(style);
let msg = format!("{} suggestions found:", candidates.len())
let msg = format!("{}", t!("multi-suggest", num = candidates.len()))
.bold()
.blue();
let confirm = format!("[{}]", t!("confirm-yes")).green();
let hint = format!(
"{} {} {}",
"[↑/↓]".blue(),
t!("confirm-yes").green(),
confirm,
"[Ctrl+C]".red()
);
eprintln!("{}", msg);