This commit is contained in:
Aya Morisawa
2018-08-02 19:03:31 +09:00
parent 0df093383d
commit 7b33c63f78
34 changed files with 167 additions and 74 deletions

View File

@ -15,22 +15,22 @@ export default function(type, data): Notification {
switch (type) {
case 'drive_file_created':
return {
title: 'ファイルがアップロードされました',
title: '%i18n:common.notification.file-uploaded%',
body: data.name,
icon: data.url
};
case 'unread_messaging_message':
return {
title: `${getUserName(data.user)}さんからメッセージ:`,
title: '%i18n:common.notification.message-from%'.split("{}")[0] + `${getUserName(data.user)}` + '%i18n:common.notification.message-from%'.split("{}")[1] ,
body: data.text, // TODO: getMessagingMessageSummary(data),
icon: data.user.avatarUrl
};
case 'reversi_invited':
return {
title: '対局への招待があります',
body: `${getUserName(data.parent)}さんから`,
title: '%i18n:common.notification.reversi-invited%',
body: '%i18n:common.notification.reversi-invited-by%'.split("{}")[0] + `${getUserName(data.parent)}` + '%i18n:common.notification.reversi-invited-by%'.split("{}")[1],
icon: data.parent.avatarUrl
};
@ -38,21 +38,21 @@ export default function(type, data): Notification {
switch (data.type) {
case 'mention':
return {
title: `${getUserName(data.user)}さんから:`,
title: '%i18n:common.notification.notified-by%'.split("{}")[0] + `${getUserName(data.user)}さんから:` + '%i18n:common.notification.notified-by%'.split("{}")[1],
body: getNoteSummary(data),
icon: data.user.avatarUrl
};
case 'reply':
return {
title: `${getUserName(data.user)}さんから返信:`,
title: '%i18n:common.notification.reply-from%'.split("{}")[0] + `${getUserName(data.user)}` + '%i18n:common.notification.reply-from%'.split("{}")[1],
body: getNoteSummary(data),
icon: data.user.avatarUrl
};
case 'quote':
return {
title: `${getUserName(data.user)}さんが引用:`,
title: '%i18n:common.notification.quoted-by%'.split("{}")[0] + `${getUserName(data.user)}` + '%i18n:common.notification.quoted-by%'.split("{}")[1],
body: getNoteSummary(data),
icon: data.user.avatarUrl
};

View File

@ -1,12 +1,12 @@
export default date => {
if (typeof date == 'string') date = new Date(date);
return (
date.getFullYear() + '' +
(date.getMonth() + 1) + '' +
date.getDate() + '' +
date.getFullYear() + '%i18n:common.date.full-year%' +
(date.getMonth() + 1) + '%i18n:common.date.month%' +
date.getDate() + '%i18n:common.date.day%' +
' ' +
date.getHours() + '' +
date.getMinutes() + '' +
date.getHours() + '%i18n:common.date.hours%' +
date.getMinutes() + '%i18n:common.date.minutes%' +
' ' +
`(${['日', '月', '火', '水', '木', '金', '土'][date.getDay()]})`
);

View File

@ -5,8 +5,8 @@ declare const fuckAdBlock: any;
export default (os) => {
function adBlockDetected() {
os.apis.dialog({
title: '%fa:exclamation-triangle%広告ブロッカーを無効にしてください',
text: '<strong>Misskeyは広告を掲載していません</strong>が、広告をブロックする機能が有効だと一部の機能が利用できなかったり、不具合が発生する場合があります。',
title: '%fa:exclamation-triangle%%i18n:common.adblock.detected%',
text: '%i18n:common.adblock.warning%',
actins: [{
text: 'OK'
}]