diff options
| author | tamaina <tamaina@hotmail.co.jp> | 2020-05-23 13:19:31 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-23 13:19:31 +0900 |
| commit | 3963ed8ff7488a0e2f7f3876461f909e6be08e25 (patch) | |
| tree | d019d1d294e8ca757479dc638f977ae10b5f44da /src/misc | |
| parent | fix(i18n): Fix missing translation (diff) | |
| download | misskey-3963ed8ff7488a0e2f7f3876461f909e6be08e25.tar.gz misskey-3963ed8ff7488a0e2f7f3876461f909e6be08e25.tar.bz2 misskey-3963ed8ff7488a0e2f7f3876461f909e6be08e25.zip | |
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
* :v:
* Update src/prelude/array.ts
Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
* wip
* i18n refactor
* Update init.ts
* :v:
Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
Diffstat (limited to 'src/misc')
| -rw-r--r-- | src/misc/get-note-summary.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/misc/get-note-summary.ts b/src/misc/get-note-summary.ts index e3458cb189..c23306ab11 100644 --- a/src/misc/get-note-summary.ts +++ b/src/misc/get-note-summary.ts @@ -2,13 +2,13 @@ * 投稿を表す文字列を取得します。 * @param {*} note (packされた)投稿 */ -const summarize = (note: any): string => { +const summarize = (note: any, locale: any): string => { if (note.deletedAt) { - return '(削除された投稿)'; + return `(${locale['deletedNote']})`; } if (note.isHidden) { - return '(非公開の投稿)'; + return `(${locale['invisibleNote']})`; } let summary = ''; @@ -22,18 +22,18 @@ const summarize = (note: any): string => { // ファイルが添付されているとき if ((note.files || []).length != 0) { - summary += ` (${note.files.length}つのファイル)`; + summary += ` (${locale['withNFiles'].replace('{n}', note.files.length)})`; } // 投票が添付されているとき if (note.poll) { - summary += ' (投票)'; + summary += ` (${locale._cw?.poll || locale['_cw.poll']})`; } // 返信のとき if (note.replyId) { if (note.reply) { - summary += `\n\nRE: ${summarize(note.reply)}`; + summary += `\n\nRE: ${summarize(note.reply, locale)}`; } else { summary += '\n\nRE: ...'; } @@ -42,7 +42,7 @@ const summarize = (note: any): string => { // Renoteのとき if (note.renoteId) { if (note.renote) { - summary += `\n\nRN: ${summarize(note.renote)}`; + summary += `\n\nRN: ${summarize(note.renote, locale)}`; } else { summary += '\n\nRN: ...'; } |