mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
fix: Add new localizations (#722)
Co-authored-by: bakerbunker <bakerbunker@nwpu.edu.cn>
This commit is contained in:
parent
5869f889f9
commit
347bc1665d
11 changed files with 40 additions and 17 deletions
|
|
@ -18,6 +18,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import locale from '@/locale';
|
||||
import { mapMutations, mapState, mapActions } from 'vuex';
|
||||
import { dailyRecommendTracks } from '@/api/playlist';
|
||||
import { isAccountLoggedIn } from '@/utils/auth';
|
||||
|
|
@ -61,7 +62,7 @@ export default {
|
|||
},
|
||||
playDailyTracks() {
|
||||
if (!isAccountLoggedIn()) {
|
||||
this.showToast('此操作需要登录网易云账号');
|
||||
this.showToast(locale.t('toast.needToLogin'));
|
||||
return;
|
||||
}
|
||||
let trackIDs = this.dailyTracks.map(t => t.id);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
<script>
|
||||
import { mapActions, mapMutations, mapState } from 'vuex';
|
||||
import Modal from '@/components/Modal.vue';
|
||||
import locale from '@/locale';
|
||||
import { addOrRemoveTrackFromPlaylist } from '@/api/playlist';
|
||||
import { disableScrolling, enableScrolling } from '@/utils/ui';
|
||||
|
||||
|
|
@ -84,7 +85,7 @@ export default {
|
|||
}).then(data => {
|
||||
if (data.body.code === 200) {
|
||||
this.show = false;
|
||||
this.showToast('已添加到歌单');
|
||||
this.showToast(locale.t('toast.savedToPlaylist'));
|
||||
} else {
|
||||
this.showToast(data.body.message);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
<script>
|
||||
import Modal from '@/components/Modal.vue';
|
||||
import locale from '@/locale';
|
||||
import { mapMutations, mapState, mapActions } from 'vuex';
|
||||
import { createPlaylist, addOrRemoveTrackFromPlaylist } from '@/api/playlist';
|
||||
import { disableScrolling, enableScrolling } from '@/utils/ui';
|
||||
|
|
@ -86,7 +87,7 @@ export default {
|
|||
tracks: this.modals.newPlaylistModal.afterCreateAddTrackID,
|
||||
}).then(data => {
|
||||
if (data.body.code === 200) {
|
||||
this.showToast('已添加到歌单');
|
||||
this.showToast(locale.t('toast.savedToPlaylist'));
|
||||
} else {
|
||||
this.showToast(data.body.message);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,9 @@
|
|||
@click="removeTrackFromPlaylist"
|
||||
>从歌单中删除</div
|
||||
>
|
||||
<div class="item" @click="addTrackToPlaylist">添加到歌单</div>
|
||||
<div class="item" @click="addTrackToPlaylist">{{
|
||||
$t('contextMenu.addToPlaylist')
|
||||
}}</div>
|
||||
</ContextMenu>
|
||||
<div :style="listStyles">
|
||||
<TrackListItem
|
||||
|
|
@ -54,6 +56,7 @@ import { isAccountLoggedIn } from '@/utils/auth';
|
|||
|
||||
import TrackListItem from '@/components/TrackListItem.vue';
|
||||
import ContextMenu from '@/components/ContextMenu.vue';
|
||||
import locale from '@/locale';
|
||||
|
||||
export default {
|
||||
name: 'TrackList',
|
||||
|
|
@ -183,7 +186,7 @@ export default {
|
|||
},
|
||||
addTrackToPlaylist() {
|
||||
if (!isAccountLoggedIn()) {
|
||||
this.showToast('此操作需要登录网易云账号');
|
||||
this.showToast(locale.t('toast.needToLogin'));
|
||||
return;
|
||||
}
|
||||
this.updateModal({
|
||||
|
|
@ -199,7 +202,7 @@ export default {
|
|||
},
|
||||
removeTrackFromPlaylist() {
|
||||
if (!isAccountLoggedIn()) {
|
||||
this.showToast('此操作需要登录网易云账号');
|
||||
this.showToast(locale.t('toast.needToLogin'));
|
||||
return;
|
||||
}
|
||||
if (confirm(`确定要从歌单删除 ${this.rightClickedTrack.name}?`)) {
|
||||
|
|
@ -210,7 +213,9 @@ export default {
|
|||
tracks: trackID,
|
||||
}).then(data => {
|
||||
this.showToast(
|
||||
data.body.code === 200 ? '已从歌单中删除' : data.body.message
|
||||
data.body.code === 200
|
||||
? locale.t('toast.removedFromPlaylist')
|
||||
: data.body.message
|
||||
);
|
||||
this.$parent.removeTrack(trackID);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue