fix: Add new localizations (#722)

Co-authored-by: bakerbunker <bakerbunker@nwpu.edu.cn>
This commit is contained in:
BakerBunker 2021-05-30 18:25:35 +08:00 committed by GitHub
parent 5869f889f9
commit 347bc1665d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 40 additions and 17 deletions

View file

@ -217,7 +217,7 @@ export default {
},
likeAlbum(toast = false) {
if (!isAccountLoggedIn()) {
this.showToast('此操作需要登录网易云账号');
this.showToast(locale.t('toast.needToLogin'));
return;
}
likeAAlbum({

View file

@ -312,7 +312,7 @@ export default {
},
followArtist() {
if (!isAccountLoggedIn()) {
this.showToast('此操作需要登录网易云账号');
this.showToast(locale.t('toast.needToLogin'));
return;
}
followAArtist({

View file

@ -136,6 +136,7 @@ import { getLyric } from '@/api/track';
import { randomNum, dailyTask } from '@/utils/common';
import { isAccountLoggedIn } from '@/utils/auth';
import NProgress from 'nprogress';
import locale from '@/locale';
import ContextMenu from '@/components/ContextMenu.vue';
import TrackList from '@/components/TrackList.vue';
@ -228,7 +229,7 @@ export default {
},
updateCurrentTab(tab) {
if (!isAccountLoggedIn() && tab !== 'playlists') {
this.showToast('此操作需要登录网易云账号');
this.showToast(locale.t('toast.needToLogin'));
return;
}
this.currentTab = tab;
@ -247,7 +248,7 @@ export default {
},
openAddPlaylistModal() {
if (!isAccountLoggedIn()) {
this.showToast('此操作需要登录网易云账号');
this.showToast(locale.t('toast.needToLogin'));
return;
}
this.updateModal({

View file

@ -35,6 +35,7 @@
import { mvDetail, mvUrl, simiMv, likeAMV } from '@/api/mv';
import { isAccountLoggedIn } from '@/utils/auth';
import NProgress from 'nprogress';
import locale from '@/locale';
import '@/assets/css/plyr.css';
import Plyr from 'plyr';
@ -116,7 +117,7 @@ export default {
},
likeMV() {
if (!isAccountLoggedIn()) {
this.showToast('此操作需要登录网易云账号');
this.showToast(locale.t('toast.needToLogin'));
return;
}
likeAMV({

View file

@ -186,9 +186,13 @@
<ContextMenu ref="playlistMenu">
<!-- <div class="item">{{ $t('contextMenu.addToQueue') }}</div> -->
<div class="item" @click="likePlaylist(true)">{{
playlist.subscribed ? '从音乐库删除' : '保存到音乐库'
playlist.subscribed
? $t('contextMenu.removeFromLibrary')
: $t('contextMenu.saveToLibrary')
}}</div>
<div class="item" @click="searchInPlaylist()">{{
$t('contextMenu.searchInPlaylist')
}}</div>
<div class="item" @click="searchInPlaylist()">歌单内搜索</div>
<div
v-if="playlist.creator.userId === data.user.userId"
class="item"
@ -216,6 +220,7 @@ import {
import { getTrackDetail } from '@/api/track';
import { isAccountLoggedIn } from '@/utils/auth';
import nativeAlert from '@/utils/nativeAlert';
import locale from '@/locale';
import { disableScrolling, enableScrolling } from '@/utils/ui';
import ButtonTwoTone from '@/components/ButtonTwoTone.vue';
@ -409,7 +414,7 @@ export default {
},
likePlaylist(toast = false) {
if (!isAccountLoggedIn()) {
this.showToast('此操作需要登录网易云账号');
this.showToast(locale.t('toast.needToLogin'));
return;
}
subscribePlaylist({
@ -486,7 +491,7 @@ export default {
},
deletePlaylist() {
if (!isAccountLoggedIn()) {
this.showToast('此操作需要登录网易云账号');
this.showToast(locale.t('toast.needToLogin'));
return;
}
let confirmation = confirm(`确定要删除歌单 ${this.playlist.name}`);
@ -517,7 +522,7 @@ export default {
},
removeTrack(trackID) {
if (!isAccountLoggedIn()) {
this.showToast('此操作需要登录网易云账号');
this.showToast(locale.t('toast.needToLogin'));
return;
}
this.tracks = this.tracks.filter(t => t.id !== trackID);