feat(client): 翻訳をIndexedDBに保存・プッシュ通知を翻訳 (#6396)
* wip * tabun ok * better msg * oops * fix lint * Update gulpfile.ts Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> * Update src/client/scripts/set-i18n-contexts.ts Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> * refactor Co-authored-by: acid-chicken <root@acid-chicken.com> * ✨ * wip * fix lint * たぶんおk * fix flush * Translate Notification * remove console.log * fix * add notifications * remove san * wip * ok * ✌️ * Update src/prelude/array.ts Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> * wip * i18n refactor * Update init.ts * ✌️ Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
This commit is contained in:
@@ -99,8 +99,8 @@ import MkRadio from '../../components/ui/radio.vue';
|
||||
import MkRange from '../../components/ui/range.vue';
|
||||
import XTheme from './theme.vue';
|
||||
import XSidebar from './sidebar.vue';
|
||||
import i18n from '../../i18n';
|
||||
import { langs } from '../../config';
|
||||
import { clientDb, set } from '../../db';
|
||||
|
||||
const sounds = [
|
||||
null,
|
||||
@@ -120,8 +120,6 @@ const sounds = [
|
||||
];
|
||||
|
||||
export default Vue.extend({
|
||||
i18n,
|
||||
|
||||
metaInfo() {
|
||||
return {
|
||||
title: this.$t('settings') as string
|
||||
@@ -228,9 +226,23 @@ export default Vue.extend({
|
||||
|
||||
watch: {
|
||||
lang() {
|
||||
const dialog = this.$root.dialog({
|
||||
type: 'waiting',
|
||||
iconOnly: true
|
||||
});
|
||||
|
||||
localStorage.setItem('lang', this.lang);
|
||||
localStorage.removeItem('locale');
|
||||
location.reload();
|
||||
|
||||
return set('_version_', `changeLang-${(new Date()).toJSON()}`, clientDb.i18n)
|
||||
.then(() => location.reload())
|
||||
.catch(() => {
|
||||
dialog.close();
|
||||
this.$root.dialog({
|
||||
type: 'error',
|
||||
iconOnly: true,
|
||||
autoClose: true
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
fontSize() {
|
||||
|
Reference in New Issue
Block a user