wip
This commit is contained in:
parent
d7b77ee022
commit
ce708b03aa
7 changed files with 24 additions and 38 deletions
|
@ -1,11 +0,0 @@
|
||||||
/**
|
|
||||||
* デフォルトの投稿用テンプレート
|
|
||||||
*/
|
|
||||||
export const defaultTemplate = `昨日のMisskeyの活動は
|
|
||||||
|
|
||||||
ノート: {notesCount}({notesDelta})
|
|
||||||
フォロー : {followingCount}({followingDelta})
|
|
||||||
フォロワー :{followersCount}({followersDelta})
|
|
||||||
|
|
||||||
でした。
|
|
||||||
{url}`;
|
|
|
@ -2,6 +2,8 @@ import React, { useState, useEffect, useCallback } from 'react';
|
||||||
import { BrowserRouter, Link, Route, Switch, useLocation } from 'react-router-dom';
|
import { BrowserRouter, Link, Route, Switch, useLocation } from 'react-router-dom';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import i18n from 'i18next';
|
||||||
|
import { initReactI18next } from 'react-i18next';
|
||||||
|
|
||||||
import { IndexPage } from './pages';
|
import { IndexPage } from './pages';
|
||||||
import { RankingPage } from './pages/ranking';
|
import { RankingPage } from './pages/ranking';
|
||||||
|
@ -10,11 +12,28 @@ import { TermPage } from './pages/term';
|
||||||
import { store, useSelector } from './store';
|
import { store, useSelector } from './store';
|
||||||
import { ModalComponent } from './Modal';
|
import { ModalComponent } from './Modal';
|
||||||
import { ActualTheme } from './misc/theme';
|
import { ActualTheme } from './misc/theme';
|
||||||
import { ErrorCode } from '../common/types/error-code';
|
import { getBrowserLanguage, resources } from './langs';
|
||||||
|
import { LOCALSTORAGE_KEY_LANG } from './const';
|
||||||
|
|
||||||
import 'xeltica-ui/dist/css/xeltica-ui.min.css';
|
import 'xeltica-ui/dist/css/xeltica-ui.min.css';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
|
||||||
|
document.body.classList.add('dark');
|
||||||
|
|
||||||
|
if (!localStorage[LOCALSTORAGE_KEY_LANG]) {
|
||||||
|
localStorage[LOCALSTORAGE_KEY_LANG] = getBrowserLanguage();
|
||||||
|
}
|
||||||
|
|
||||||
|
i18n
|
||||||
|
.use(initReactI18next)
|
||||||
|
.init({
|
||||||
|
resources,
|
||||||
|
lng: localStorage[LOCALSTORAGE_KEY_LANG],
|
||||||
|
interpolation: {
|
||||||
|
escapeValue: false // react already safes from xss
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const AppInner : React.VFC = () => {
|
const AppInner : React.VFC = () => {
|
||||||
const $location = useLocation();
|
const $location = useLocation();
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { alertModes } from '../../common/types/alert-mode';
|
||||||
import { IUser } from '../../common/types/user';
|
import { IUser } from '../../common/types/user';
|
||||||
import { Visibility } from '../../common/types/visibility';
|
import { Visibility } from '../../common/types/visibility';
|
||||||
import { useGetSessionQuery } from '../services/session';
|
import { useGetSessionQuery } from '../services/session';
|
||||||
import { defaultTemplate } from '../../common/default-template';
|
|
||||||
import { Card } from './Card';
|
import { Card } from './Card';
|
||||||
import { Theme, themes } from '../misc/theme';
|
import { Theme, themes } from '../misc/theme';
|
||||||
import { API_ENDPOINT, LOCALSTORAGE_KEY_TOKEN } from '../const';
|
import { API_ENDPOINT, LOCALSTORAGE_KEY_TOKEN } from '../const';
|
||||||
|
@ -141,6 +140,8 @@ export const SettingPage: React.VFC = () => {
|
||||||
}));
|
}));
|
||||||
}, [dispatch]);
|
}, [dispatch]);
|
||||||
|
|
||||||
|
const defaultTemplate = t('_template.default');
|
||||||
|
|
||||||
return session.isLoading || !data ? (
|
return session.isLoading || !data ? (
|
||||||
<div className="skeleton" style={{width: '100%', height: '128px'}}></div>
|
<div className="skeleton" style={{width: '100%', height: '128px'}}></div>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
@ -1,23 +1,6 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import * as ReactDOM from 'react-dom';
|
import * as ReactDOM from 'react-dom';
|
||||||
import i18n from 'i18next';
|
|
||||||
import { initReactI18next } from 'react-i18next';
|
|
||||||
|
|
||||||
import { App } from './App';
|
import { App } from './App';
|
||||||
import { getBrowserLanguage, resources } from './langs';
|
|
||||||
|
|
||||||
document.body.classList.add('dark');
|
|
||||||
|
|
||||||
|
|
||||||
i18n
|
|
||||||
.use(initReactI18next)
|
|
||||||
.init({
|
|
||||||
resources,
|
|
||||||
lng: localStorage['lang'] ?? getBrowserLanguage(),
|
|
||||||
interpolation: {
|
|
||||||
escapeValue: false // react already safes from xss
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
ReactDOM.render(<App/>, document.getElementById('app'));
|
ReactDOM.render(<App/>, document.getElementById('app'));
|
||||||
|
|
|
@ -97,6 +97,7 @@
|
||||||
_template: {
|
_template: {
|
||||||
description: "Customize template of your alert.",
|
description: "Customize template of your alert.",
|
||||||
description2: "Hashtag '#misshaialert' will be appended regardless of the template.",
|
description2: "Hashtag '#misshaialert' will be appended regardless of the template.",
|
||||||
|
default: "My Misskey activity yesterday was:\n\nNotes: {notesCount}({notesDelta})\nFollowing: {followingCount}({followingDelta})\nFollowers: {followersCount}({followersDelta})\n\n{url}",
|
||||||
},
|
},
|
||||||
_error: {
|
_error: {
|
||||||
sorry: "Something went wrong. Please retry again.",
|
sorry: "Something went wrong. Please retry again.",
|
||||||
|
|
|
@ -97,6 +97,7 @@
|
||||||
_template: {
|
_template: {
|
||||||
description: "アラートの自動投稿をカスタマイズできます。",
|
description: "アラートの自動投稿をカスタマイズできます。",
|
||||||
description2: "ハッシュタグ #misshaialert は、テンプレートに関わらず自動付与されます。",
|
description2: "ハッシュタグ #misshaialert は、テンプレートに関わらず自動付与されます。",
|
||||||
|
default: "昨日のMisskeyの活動は\n\nノート: {notesCount}({notesDelta})\nフォロー : {followingCount}({followingDelta})\nフォロワー :{followersCount}({followersDelta})\n\nでした。\n{url}",
|
||||||
},
|
},
|
||||||
_error: {
|
_error: {
|
||||||
sorry: "問題が発生しました。お手数ですが、やり直してください。",
|
sorry: "問題が発生しました。お手数ですが、やり直してください。",
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
export const welcomeMessage = [
|
|
||||||
'ついついノートしすぎていませんか?',
|
|
||||||
'Misskey, しすぎていませんか?',
|
|
||||||
'今日、何ノート書いた?',
|
|
||||||
'10000 ノートは初心者、そう思っていませんか?',
|
|
||||||
'息するように Misskey、そんなあなたへ。',
|
|
||||||
'あなたは真の Misskey 廃人ですか?',
|
|
||||||
];
|
|
Loading…
Add table
Add a link
Reference in a new issue