Skip to content
代码片段 群组 项目
提交 f7179a5b 编辑于 作者: yaozm's avatar yaozm
浏览文件

refactor(i18n): update language keys for music command

- Update language keys for the music command to improve clarity and consistency
- Removed the unused 'music-dl.php' language file
- Updated language keys to use more generic terms for better maintainability
上级 25d476f9
No related branches found
No related tags found
无相关合并请求
......@@ -73,13 +73,13 @@ final class MusicCommand extends Command
Prompts\info($this->config['logo']);
$this->laravel->instance('logo', $this->config['logo']);
})
->when(windows_os(), fn () => warning(__('music-dl.windows_hint')))
->when(windows_os(), fn () => warning(__('windows_hint')))
->tap(function () use (&$keyword): void {
$keyword = str($this->argument('keyword') ?? text(
__('music-dl.keyword_label'),
__('music-dl.keyword_placeholder'),
__('music-dl.keyword_default'),
__('music-dl.keyword_label')
__('keyword_label'),
__('keyword_placeholder'),
__('keyword_default'),
__('keyword_label')
))->trim()->toString();
})
->pipe(function () use ($keyword, &$duration): Collection {
......@@ -92,28 +92,28 @@ final class MusicCommand extends Command
return $songs;
},
__('music-dl.searching_hint')
__('searching_hint')
);
})
->whenEmpty(function (): void {
warning(__('music-dl.empty_hint'));
warning(__('empty_hint'));
$this->handle();
})
->tap(function (Collection $songs) use ($keyword, $duration): void {
table(__('music-dl.table_header'), $this->sanitizes($songs, $keyword));
table(__('table_header'), $this->sanitizes($songs, $keyword));
Prompts\info((new ResourceUsageFormatter())->resourceUsage($duration));
})
->tap(fn (): bool => confirm(__('music-dl.confirm_label')) or $this->handle())
->tap(fn (): bool => confirm(__('confirm_label')) or $this->handle())
->tap(function (Collection $songs) use (&$selectedKeys, $keyword): void {
$selectedKeys = $this
->hydrates($songs, $keyword)
->pipe(fn (Collection $options): Collection => collect(multiselect(
__('music-dl.select_label'),
__('select_label'),
$options->all(),
[$options->first()],
20,
__('music-dl.select_label'),
hint: __('music-dl.select_hint'),
__('select_label'),
hint: __('select_hint'),
))->map(static fn (string $selectedValue) => $options->search($selectedValue)));
})
->pipe(
......
{
"table_header": {
"index": "序号",
"name": "歌名",
"artist": "歌手",
"album": "专辑",
"source": "来源",
"size": "大小",
"br": "比特率"
},
"keyword_label": "请输入关键字",
"keyword_placeholder": "关键字",
"keyword_default": "腰乐队",
"windows_hint": "CMD、PowerShell 可能不支持中文搜索,Git Bash、WSL 支持中英文搜索",
"searching_hint": "搜索中...",
"empty_hint": "o(╥﹏╥)o 没有搜索到相关歌曲",
"confirm_label": "是否下载歌曲?",
"all_songs": "全部歌曲",
"select_label": "请选择歌曲",
"select_hint": "空格键选中/取消选项"
}
{
"table_header": {
"index": "序号",
"name": "歌名",
"artist": "歌手",
"album": "专辑",
"source": "来源",
"size": "大小",
"br": "比特率"
},
"keyword_label": "请输入关键字",
"keyword_placeholder": "关键字",
"keyword_default": "腰乐队",
"windows_hint": "CMD、PowerShell 可能不支持中文搜索,Git Bash、WSL 支持中英文搜索",
"searching_hint": "搜索中...",
"empty_hint": "o(╥﹏╥)o 没有搜索到相关歌曲",
"confirm_label": "是否下载歌曲?",
"all_songs": "全部歌曲",
"select_label": "请选择歌曲",
"select_hint": "空格键选中/取消选项"
}
<?php
declare(strict_types=1);
/**
* This file is part of the guanguans/music-dl.
*
* (c) guanguans <ityaozm@gmail.com>
*
* This source file is subject to the MIT license that is bundled.
*/
return [
'table_header' => [
'index' => '序号',
'name' => '歌名',
'artist' => '歌手',
'album' => '专辑',
'source' => '来源',
'size' => '大小',
'br' => '比特率',
],
'keyword_label' => '请输入关键字',
'keyword_placeholder' => '关键字',
'keyword_default' => '腰乐队',
'windows_hint' => 'CMD、PowerShell 可能不支持中文搜索,Git Bash、WSL 支持中英文搜索',
'searching_hint' => '搜索中...',
'empty_hint' => 'o(╥﹏╥)o 没有搜索到相关歌曲',
'confirm_label' => '是否下载歌曲?',
'all_songs' => '全部歌曲',
'select_label' => '请选择歌曲',
'select_hint' => '空格键选中/取消选项',
];
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册