diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml
index 572c8ccdfe..66a9a83353 100644
--- a/locales/ja-JP.yml
+++ b/locales/ja-JP.yml
@@ -810,6 +810,10 @@ desktop/views/components/renote-form.vue:
desktop/views/components/renote-form-window.vue:
title: "この投稿をRenoteしますか?"
+desktop/views/pages/user-following-or-followers.vue:
+ following: "{user}のフォロー"
+ followers: "{user}のフォロワー"
+
desktop/views/components/settings-window.vue:
settings: "設定"
diff --git a/package.json b/package.json
index ea00e41178..0ff686c2fb 100644
--- a/package.json
+++ b/package.json
@@ -215,6 +215,7 @@
"vue-color": "2.7.0",
"vue-content-loading": "1.5.3",
"vue-cropperjs": "2.2.2",
+ "vue-i18n": "8.3.0",
"vue-js-modal": "1.3.26",
"vue-loader": "15.4.2",
"vue-router": "3.0.1",
diff --git a/src/client/app/common/views/components/ui/button.vue b/src/client/app/common/views/components/ui/button.vue
index 71496da5cd..132518da92 100644
--- a/src/client/app/common/views/components/ui/button.vue
+++ b/src/client/app/common/views/components/ui/button.vue
@@ -53,7 +53,7 @@ export default Vue.extend({
display block
width 100%
margin 0
- padding 8px
+ padding 8px 10px
text-align center
font-weight normal
font-size 16px
diff --git a/src/client/app/config.ts b/src/client/app/config.ts
index 2abc3f7226..637d643d8d 100644
--- a/src/client/app/config.ts
+++ b/src/client/app/config.ts
@@ -1,5 +1,6 @@
declare const _LANG_: string;
declare const _LANGS_: string;
+declare const _LOCALE_: { [key: string]: any };
declare const _THEME_COLOR_: string;
declare const _COPYRIGHT_: string;
declare const _VERSION_: string;
@@ -16,6 +17,7 @@ export const apiUrl = url + '/api';
export const wsUrl = url.replace('http://', 'ws://').replace('https://', 'wss://') + '/streaming';
export const lang = _LANG_;
export const langs = _LANGS_;
+export const locale = _LOCALE_;
export const themeColor = _THEME_COLOR_;
export const copyright = _COPYRIGHT_;
export const version = _VERSION_;
diff --git a/src/client/app/desktop/script.ts b/src/client/app/desktop/script.ts
index eabb1fe163..ca9771e2fe 100644
--- a/src/client/app/desktop/script.ts
+++ b/src/client/app/desktop/script.ts
@@ -24,6 +24,7 @@ import MkIndex from './views/pages/index.vue';
import MkHome from './views/pages/home.vue';
import MkDeck from './views/pages/deck/deck.vue';
import MkUser from './views/pages/user/user.vue';
+import MkUserFollowingOrFollowers from './views/pages/user-following-or-followers.vue';
import MkFavorites from './views/pages/favorites.vue';
import MkSelectDrive from './views/pages/selectdrive.vue';
import MkDrive from './views/pages/drive.vue';
@@ -66,6 +67,8 @@ init(async (launch) => {
{ path: '/share', component: MkShare },
{ path: '/reversi/:game?', component: MkReversi },
{ path: '/@:user', name: 'user', component: MkUser },
+ { path: '/@:user/following', name: 'userFollowing', component: MkUserFollowingOrFollowers },
+ { path: '/@:user/followers', name: 'userFollowers', component: MkUserFollowingOrFollowers },
{ path: '/notes/:note', name: 'note', component: MkNote },
{ path: '/authorize-follow', component: MkFollow }
]
diff --git a/src/client/app/desktop/views/components/followers-window.vue b/src/client/app/desktop/views/components/followers-window.vue
deleted file mode 100644
index d5214adb2f..0000000000
--- a/src/client/app/desktop/views/components/followers-window.vue
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
- {{ '%i18n:@followers%'.replace('{}', name) }}
-
-
-
-
-
-
-
-
diff --git a/src/client/app/desktop/views/components/followers.vue b/src/client/app/desktop/views/components/followers.vue
deleted file mode 100644
index 1ef9f69771..0000000000
--- a/src/client/app/desktop/views/components/followers.vue
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
- %i18n:@empty%
-
-
-
-
diff --git a/src/client/app/desktop/views/components/following-window.vue b/src/client/app/desktop/views/components/following-window.vue
deleted file mode 100644
index aa9f2bde7b..0000000000
--- a/src/client/app/desktop/views/components/following-window.vue
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
- {{ '%i18n:@following%'.replace('{}', name) }}
-
-
-
-
-
-
-
-
diff --git a/src/client/app/desktop/views/components/following.vue b/src/client/app/desktop/views/components/following.vue
deleted file mode 100644
index d55ce1c0d4..0000000000
--- a/src/client/app/desktop/views/components/following.vue
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
- %i18n:@empty%
-
-
-
-
diff --git a/src/client/app/desktop/views/components/index.ts b/src/client/app/desktop/views/components/index.ts
index ff4e845f62..2478f75ac4 100644
--- a/src/client/app/desktop/views/components/index.ts
+++ b/src/client/app/desktop/views/components/index.ts
@@ -22,9 +22,7 @@ import settings from './settings.vue';
import calendar from './calendar.vue';
import activity from './activity.vue';
import friendsMaker from './friends-maker.vue';
-import followers from './followers.vue';
-import following from './following.vue';
-import usersList from './users-list.vue';
+import userCard from './user-card.vue';
import userListTimeline from './user-list-timeline.vue';
import widgetContainer from './widget-container.vue';
@@ -50,8 +48,6 @@ Vue.component('mk-settings', settings);
Vue.component('mk-calendar', calendar);
Vue.component('mk-activity', activity);
Vue.component('mk-friends-maker', friendsMaker);
-Vue.component('mk-followers', followers);
-Vue.component('mk-following', following);
-Vue.component('mk-users-list', usersList);
+Vue.component('mk-user-card', userCard);
Vue.component('mk-user-list-timeline', userListTimeline);
Vue.component('mk-widget-container', widgetContainer);
diff --git a/src/client/app/desktop/views/components/users-list.item.vue b/src/client/app/desktop/views/components/user-card.vue
similarity index 77%
rename from src/client/app/desktop/views/components/users-list.item.vue
rename to src/client/app/desktop/views/components/user-card.vue
index 66a002c708..ccc0a49dc0 100644
--- a/src/client/app/desktop/views/components/users-list.item.vue
+++ b/src/client/app/desktop/views/components/user-card.vue
@@ -9,7 +9,6 @@
- %i18n:@followed%
@@ -34,17 +33,18 @@ export default Vue.extend({
diff --git a/src/client/app/desktop/views/components/users-list.vue b/src/client/app/desktop/views/components/users-list.vue
deleted file mode 100644
index 05fe6c292e..0000000000
--- a/src/client/app/desktop/views/components/users-list.vue
+++ /dev/null
@@ -1,145 +0,0 @@
-
-
-
-
-
-
-
-
-
%i18n:@fetching%
-
-
-
-
-
-
diff --git a/src/client/app/desktop/views/pages/user-following-or-followers.vue b/src/client/app/desktop/views/pages/user-following-or-followers.vue
new file mode 100644
index 0000000000..db0de20b64
--- /dev/null
+++ b/src/client/app/desktop/views/pages/user-following-or-followers.vue
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+ {{ user | userName }}
+
+
+
+
+
+
+ %i18n:@load-more%
+
+
+
+
+
+
+
+
diff --git a/src/client/app/desktop/views/pages/user/user.header.vue b/src/client/app/desktop/views/pages/user/user.header.vue
index 4c30942828..6d7827d1ae 100644
--- a/src/client/app/desktop/views/pages/user/user.header.vue
+++ b/src/client/app/desktop/views/pages/user/user.header.vue
@@ -22,8 +22,8 @@
{{ user.notesCount | number }}%i18n:@posts%
- {{ user.followingCount | number }}%i18n:@following%
- {{ user.followersCount | number }}%i18n:@followers%
+ {{ user.followingCount | number }}%i18n:@following%
+ {{ user.followersCount | number }}%i18n:@followers%
@@ -31,8 +31,6 @@
diff --git a/src/client/app/init.ts b/src/client/app/init.ts
index bc5a349987..3d1560633a 100644
--- a/src/client/app/init.ts
+++ b/src/client/app/init.ts
@@ -8,6 +8,7 @@ import VueRouter from 'vue-router';
import VAnimateCss from 'v-animate-css';
import VModal from 'vue-js-modal';
import VueSweetalert2 from 'vue-sweetalert2';
+import VueI18n from 'vue-i18n';
import VueHotkey from './common/hotkey';
import App from './app.vue';
@@ -121,6 +122,7 @@ Vue.use(VAnimateCss);
Vue.use(VModal);
Vue.use(VueHotkey);
Vue.use(VueSweetalert2);
+Vue.use(VueI18n);
Vue.component('fa', FontAwesomeIcon);
diff --git a/webpack.config.ts b/webpack.config.ts
index 03ceeaa51c..37faec0069 100644
--- a/webpack.config.ts
+++ b/webpack.config.ts
@@ -66,6 +66,7 @@ const consts = {
_CODENAME_: codename,
_LANG_: '%lang%',
_LANGS_: Object.keys(locales).map(l => [l, locales[l].meta.lang]),
+ _LOCALE_: '%locale%',
_ENV_: process.env.NODE_ENV
};
@@ -100,6 +101,7 @@ const plugins = [
src = src.replace(i18nReplacer.pattern, i18nReplacer.replacement);
src = src.replace('%lang%', lang);
+ src = src.replace('"%locale%"', JSON.stringify(locales[lang]));
fs.writeFileSync(`${__dirname}/built/client/assets/${file}.${version}.${lang}.js`, src, 'utf-8');
});