diff --git a/src/_locales/cmn-CN.yml b/src/_locales/cmn-CN.yml index 072d84b7..73b0f50e 100644 --- a/src/_locales/cmn-CN.yml +++ b/src/_locales/cmn-CN.yml @@ -3,14 +3,13 @@ common: loading: 加载中... undo: 还原 view: 次 - ago: 前 - year: 年 - month: 个月 - week: 个星期 - day: 天 - hour: 小时 - minute: 分钟 - second: 秒 + year: 年前 + month: 个月前 + week: 个星期前 + day: 天前 + hour: 小时前 + minute: 分钟前 + second: 秒前 settings: title: 设置 select_language: 界面语文 diff --git a/src/_locales/cmn-TW.yml b/src/_locales/cmn-TW.yml index 2f0aceb2..2bd809db 100644 --- a/src/_locales/cmn-TW.yml +++ b/src/_locales/cmn-TW.yml @@ -3,14 +3,13 @@ common: loading: 載入中... undo: 復原 view: 次 - ago: 前 - year: 年 - month: 個月 - week: 個禮拜 - day: 天 - hour: 小時 - minute: 分鐘 - second: 秒 + year: 年前 + month: 個月前 + week: 個禮拜前 + day: 天前 + hour: 小時前 + minute: 分鐘前 + second: 秒前 settings: title: 設定 select_language: 介面語文 diff --git a/src/_locales/en.yml b/src/_locales/en.yml index affb0974..85845d9f 100644 --- a/src/_locales/en.yml +++ b/src/_locales/en.yml @@ -3,14 +3,13 @@ common: loading: Loading... undo: UNDO view: no view | view | views - ago: ago - year: year | years - month: month | momths - week: week | weeks - day: day | days - hour: hour | hours - minute: minute | minutes - second: second | seconds + year: year ago | years ago + month: month ago | months ago + week: week ago | weeks ago + day: day ago | days ago + hour: hour ago | hours ago + minute: minute ago | minutes ago + second: second ago | seconds ago settings: title: Settings select_language: Language diff --git a/src/_locales/jyut.yml b/src/_locales/jyut.yml index 4f480fd8..bba2e195 100644 --- a/src/_locales/jyut.yml +++ b/src/_locales/jyut.yml @@ -3,14 +3,13 @@ common: loading: 撈緊... undo: 整返 view: 次 - ago: 前 - year: 年 - month: 個月 - week: 個禮拜 - day: 日 - hour: 個鐘頭 - minute: 分鐘 - second: 秒 + year: 年前 + month: 個月前 + week: 個禮拜前 + day: 日前 + hour: 個鐘頭前 + minute: 分鐘前 + second: 秒前 settings: title: 校做 select_language: 介面語文 diff --git a/src/components/Topbar/TopbarMomentsPop.vue b/src/components/Topbar/TopbarMomentsPop.vue index 364ba84b..66570d4f 100644 --- a/src/components/Topbar/TopbarMomentsPop.vue +++ b/src/components/Topbar/TopbarMomentsPop.vue @@ -394,10 +394,6 @@ function scrollToTop(element: HTMLElement, duration: number) { moment.ctime ? calcTimeSince(new Date(moment.ctime * 1000)) : moment.ctime - }}{{ - language === LanguageType.English - ? ` ${$t('common.ago')}` - : $t('common.ago') }} diff --git a/src/components/VideoCard/VideoCard.vue b/src/components/VideoCard/VideoCard.vue index 9bfbd262..a0c1443e 100644 --- a/src/components/VideoCard/VideoCard.vue +++ b/src/components/VideoCard/VideoCard.vue @@ -309,12 +309,7 @@ function gotoChannel(mid: number) { : $t('common.view', videoData.stat.view) }} - {{ calcTimeSince(videoData.pubdate * 1000) - }}{{ - language === LanguageType.English - ? ` ${$t('common.ago')}` - : $t('common.ago') - }} + {{ calcTimeSince(videoData.pubdate * 1000) }} diff --git a/src/contentScripts/views/Video/Video.vue b/src/contentScripts/views/Video/Video.vue index 60116640..8015bbfa 100644 --- a/src/contentScripts/views/Video/Video.vue +++ b/src/contentScripts/views/Video/Video.vue @@ -2,7 +2,7 @@ import type { Ref, UnwrapNestedRefs } from 'vue' import { useDateFormat } from '@vueuse/core' import type { Comment, VideoInfo } from './types' -import { getCSRF, removeHttpFromUrl } from '~/utils' +import { calcTimeSince, getCSRF, removeHttpFromUrl } from '~/utils' const videoContent = ref() as Ref // const commentContent = ref() as Ref @@ -124,6 +124,7 @@ function getVideoComments() { csrf: getCSRF(), oid: videoInfo.aid, pn: 1, + sort: 1, }).then((res) => { if (res.code === 0) { Object.assign(commentList, res.data.replies) @@ -131,6 +132,31 @@ function getVideoComments() { } }) } + +function setupCommentEmote(content: string, emote: any) { + let result = `${content}` + + if (!emote || Object.keys(emote).length === 0) + return content + + Object.keys(emote).forEach((key) => { + if (emote[key].meta.size === 1) { + result = result.replaceAll(key, ` + `) + } + else { + result = result.replaceAll(key, ` + `) + } + }) + return result +}