fix: Add i18n for playlist context menu (#734)

This commit is contained in:
Changjian Gao 2021-06-01 18:04:35 +08:00 committed by GitHub
parent 347bc1665d
commit a00d27d0c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 12 deletions

View File

@ -170,6 +170,9 @@ export default {
addToPlaylist: 'Add to playlist',
searchInPlaylist: 'Search in playlist',
copyUrl: 'Copy URL',
allPlaylists: 'All Playlists',
minePlaylists: 'My Playlists',
likedPlaylists: 'Liked Playlists',
},
toast: {
savedToPlaylist: 'Saved to playlist',

View File

@ -171,6 +171,9 @@ export default {
addToPlaylist: '添加到歌单',
searchInPlaylist: '歌单内搜索',
copyUrl: '复制链接',
allPlaylists: '全部歌单',
minePlaylists: '创建的歌单',
likedPlaylists: '收藏的歌单',
},
toast: {
savedToPlaylist: '已添加到歌单',

View File

@ -49,9 +49,11 @@
@click="updateCurrentTab('playlists')"
>
<span class="text">{{
{ all: '全部歌单', mine: '创建的歌单', liked: '收藏的歌单' }[
playlistFilter
]
{
all: $t('contextMenu.allPlaylists'),
mine: $t('contextMenu.minePlaylists'),
liked: $t('contextMenu.likedPlaylists'),
}[playlistFilter]
}}</span>
<span class="icon" @click.stop="openPlaylistTabMenu"
><svg-icon icon-class="dropdown"
@ -122,10 +124,16 @@
</div>
<ContextMenu ref="playlistTabMenu">
<div class="item" @click="changePlaylistFilter('all')">全部歌单</div>
<div class="item" @click="changePlaylistFilter('all')">{{
$t('contextMenu.allPlaylists')
}}</div>
<hr />
<div class="item" @click="changePlaylistFilter('mine')">创建的歌单</div>
<div class="item" @click="changePlaylistFilter('liked')">收藏的歌单</div>
<div class="item" @click="changePlaylistFilter('mine')">{{
$t('contextMenu.minePlaylists')
}}</div>
<div class="item" @click="changePlaylistFilter('liked')">{{
$t('contextMenu.likedPlaylists')
}}</div>
</ContextMenu>
</div>
</template>

View File

@ -1,7 +1,7 @@
<template>
<div v-show="show" class="search">
<h1>
<span>{{ $t('search.searchFor') }}{{ typeNameTable[type] }}</span> "{{
<span>{{ $t('search.searchFor') }} {{ typeNameTable[type] }}</span> "{{
keywords
}}"
</h1>
@ -42,6 +42,7 @@
<script>
import { getTrackDetail } from '@/api/track';
import { search } from '@/api/others';
import locale from '@/locale';
import { camelCase } from 'change-case';
import NProgress from 'nprogress';
@ -70,11 +71,11 @@ export default {
},
typeNameTable() {
return {
musicVideos: 'MV',
tracks: '歌曲',
albums: '专辑',
artists: '艺人',
playlists: '歌单',
musicVideos: locale.t('search.mv'),
tracks: locale.t('search.song'),
albums: locale.t('search.album'),
artists: locale.t('search.artist'),
playlists: locale.t('search.playlist'),
};
},
},