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

master
Changjian Gao 4 years ago committed by GitHub
parent 347bc1665d
commit a00d27d0c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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',

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

@ -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>

@ -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'),
};
},
},

Loading…
Cancel
Save