decidim-comments 0.22.0 → 0.23.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/decidim/comments/bundle.js +53 -53
- data/app/assets/javascripts/decidim/comments/bundle.js.map +1 -1
- data/app/cells/decidim/comments/comment_activity_cell.rb +2 -22
- data/app/cells/decidim/comments/comment_cell.rb +22 -0
- data/app/cells/decidim/comments/comment_m/footer.erb +5 -0
- data/app/cells/decidim/comments/comment_m/top.erb +7 -0
- data/app/cells/decidim/comments/comment_m_cell.rb +29 -0
- data/app/commands/decidim/comments/create_comment.rb +1 -1
- data/app/forms/decidim/comments/comment_form.rb +8 -1
- data/app/frontend/comments/add_comment_form.component.test.tsx +30 -28
- data/app/frontend/comments/add_comment_form.component.tsx +32 -16
- data/app/frontend/comments/comment.component.test.tsx +35 -4
- data/app/frontend/comments/comment.component.tsx +24 -15
- data/app/frontend/comments/comment_thread.component.test.tsx +9 -8
- data/app/frontend/comments/comment_thread.component.tsx +3 -1
- data/app/frontend/comments/comments.component.test.tsx +17 -14
- data/app/frontend/comments/comments.component.tsx +28 -4
- data/app/frontend/comments/down_vote_button.component.tsx +24 -9
- data/app/frontend/comments/up_vote_button.component.tsx +24 -9
- data/app/frontend/mutations/add_comment.mutation.graphql +2 -2
- data/app/frontend/mutations/down_vote.mutation.graphql +2 -2
- data/app/frontend/mutations/up_vote.mutation.graphql +2 -2
- data/app/frontend/queries/comments.query.graphql +2 -2
- data/app/frontend/support/schema.ts +1060 -735
- data/app/helpers/decidim/comments/comment_cells_helper.rb +33 -0
- data/app/models/decidim/comments/comment.rb +73 -20
- data/app/models/decidim/comments/seed.rb +1 -1
- data/app/types/decidim/comments/commentable_interface.rb +1 -1
- data/app/types/decidim/comments/commentable_mutation_type.rb +4 -1
- data/config/locales/am-ET.yml +1 -0
- data/config/locales/bg.yml +6 -0
- data/config/locales/ca.yml +1 -0
- data/config/locales/cs.yml +1 -0
- data/config/locales/da.yml +1 -0
- data/config/locales/en.yml +1 -0
- data/config/locales/eo.yml +1 -0
- data/config/locales/es-MX.yml +1 -0
- data/config/locales/es-PY.yml +1 -0
- data/config/locales/es.yml +3 -2
- data/config/locales/et.yml +1 -0
- data/config/locales/fi-plain.yml +1 -0
- data/config/locales/fi.yml +2 -1
- data/config/locales/fr-CA.yml +2 -1
- data/config/locales/fr.yml +2 -1
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +1 -1
- data/config/locales/is-IS.yml +0 -2
- data/config/locales/is.yml +76 -0
- data/config/locales/ja-JP.yml +2 -2
- data/config/locales/ja.yml +121 -0
- data/config/locales/ko-KR.yml +1 -0
- data/config/locales/ko.yml +1 -0
- data/config/locales/lt.yml +1 -0
- data/config/locales/{lv-LV.yml → lv.yml} +0 -0
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +3 -2
- data/config/locales/om-ET.yml +1 -0
- data/config/locales/pl.yml +5 -5
- data/config/locales/so-SO.yml +1 -0
- data/config/locales/sv.yml +1 -0
- data/config/locales/ti-ER.yml +1 -0
- data/config/locales/uk.yml +0 -1
- data/config/locales/vi-VN.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-CN.yml +121 -0
- data/config/locales/zh-TW.yml +1 -0
- data/db/migrate/20200706123136_make_comments_handle_i18n.rb +41 -0
- data/db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb +9 -0
- data/lib/decidim/comments/api/comment_type.rb +5 -1
- data/lib/decidim/comments/comment_serializer.rb +7 -2
- data/lib/decidim/comments/comment_vote_serializer.rb +5 -1
- data/lib/decidim/comments/commentable.rb +11 -0
- data/lib/decidim/comments/comments_helper.rb +28 -4
- data/lib/decidim/comments/engine.rb +13 -0
- data/lib/decidim/comments/mutation_extensions.rb +8 -0
- data/lib/decidim/comments/query_extensions.rb +4 -0
- data/lib/decidim/comments/test/factories.rb +10 -1
- data/lib/decidim/comments/test/shared_examples/comment_event.rb +1 -1
- data/lib/decidim/comments/version.rb +1 -1
- metadata +37 -11
data/config/locales/ja-JP.yml
CHANGED
@@ -0,0 +1,121 @@
|
|
1
|
+
ja:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/comments/comment_by_followed_user_event: コメント
|
5
|
+
decidim/comments/comment_created_event: コメント
|
6
|
+
decidim/comments/reply_created_event: コメント返信
|
7
|
+
decidim/comments/user_group_mentioned_event: メンション
|
8
|
+
decidim/comments/user_mentioned_event: メンション
|
9
|
+
activerecord:
|
10
|
+
models:
|
11
|
+
decidim/comments/comment:
|
12
|
+
other: コメント
|
13
|
+
decidim/comments/comment_vote:
|
14
|
+
other: 投票
|
15
|
+
decidim:
|
16
|
+
comments:
|
17
|
+
comments: コメント
|
18
|
+
comments_count: コメント数
|
19
|
+
last_activity:
|
20
|
+
new_comment_at_html: "<span> %{link}に新しいコメント</span>"
|
21
|
+
view: 表示
|
22
|
+
votes:
|
23
|
+
create:
|
24
|
+
error: コメントに投票中に問題がありました。
|
25
|
+
components:
|
26
|
+
add_comment_form:
|
27
|
+
account_message: <a href="%{sign_in_url}">アカウント</a> または <a href="%{sign_up_url}">ログイン</a> でコメントを追加します。
|
28
|
+
form:
|
29
|
+
body:
|
30
|
+
label: コメント
|
31
|
+
placeholder: これについてどう思いますか?
|
32
|
+
form_error: テキストは必須で、 %{length} 文字を超えることはできません。
|
33
|
+
submit: 送信
|
34
|
+
user_group_id:
|
35
|
+
label: 'コメント:'
|
36
|
+
opinion:
|
37
|
+
neutral: 中立
|
38
|
+
remaining_characters: "残り %{count} 文字"
|
39
|
+
remaining_characters_1: "残り%{count} 文字"
|
40
|
+
title: コメントを追加
|
41
|
+
comment:
|
42
|
+
alignment:
|
43
|
+
against: 反対
|
44
|
+
in_favor: 賛成
|
45
|
+
deleted_user: 退会者
|
46
|
+
hide_replies: 返信を非表示
|
47
|
+
reply: 返信
|
48
|
+
report:
|
49
|
+
action: レポート
|
50
|
+
already_reported: このコンテンツはすでに報告されており、管理者が確認します。
|
51
|
+
close: 閉じる
|
52
|
+
description: このコンテンツは不適切ですか?
|
53
|
+
details: 追加コメント
|
54
|
+
reasons:
|
55
|
+
does_not_belong: 違法行為、個人情報、または %{organization_name} に属していないと思われる内容が含まれています。
|
56
|
+
offensive: 差別的な内容、誹謗中傷などの不適切な内容が含まれています。
|
57
|
+
spam: 本来の内容に関係が無い広告、詐欺や悪意のある処理などが含まれています。
|
58
|
+
title: 不適切なコンテンツを報告する
|
59
|
+
show_replies: '%{replies_count} 件の返信を表示'
|
60
|
+
single_comment_link_title: シングルコメントへのリンクを取得
|
61
|
+
comment_order_selector:
|
62
|
+
order:
|
63
|
+
best_rated: 最高評価
|
64
|
+
most_discussed: 最も議論されたもの
|
65
|
+
older: 古い順
|
66
|
+
recent: 最近のもの
|
67
|
+
title: '並び順:'
|
68
|
+
comment_thread:
|
69
|
+
title: '%{authorName} との会話'
|
70
|
+
comments:
|
71
|
+
blocked_comments_for_user_warning: 現時点ではコメントできませんが、以前のコメントを読むことができます。
|
72
|
+
blocked_comments_warning: コメントは現時点で無効になっていますが、以前のコメントを読むことができます。
|
73
|
+
comment_details_title: コメントの詳細
|
74
|
+
loading: コメントを読み込んでいます...
|
75
|
+
single_comment_warning: コメントの残りはこちら <a href="%{url}"></a>で確認できます。
|
76
|
+
single_comment_warning_title: 単一のコメントが表示されています
|
77
|
+
title: "%{count} 件のコメント"
|
78
|
+
down_vote_button:
|
79
|
+
text: このコメントに同意しません
|
80
|
+
up_vote_button:
|
81
|
+
text: このコメントに同意します
|
82
|
+
events:
|
83
|
+
comments:
|
84
|
+
comment_by_followed_user:
|
85
|
+
email_intro: "%{author_name} は %{resource_title}にコメントを残しました。このページで読むことができます:"
|
86
|
+
email_outro: '%{author_name}をフォローしているため、この通知を受け取りました。プロフィールページからこのユーザーのフォローを解除することができます。'
|
87
|
+
email_subject: '%{author_name} に %{resource_title} による新しいコメントがあります'
|
88
|
+
notification_title: There is a new comment by <a href="%{author_path}">%{author_name} %{author_nickname}</a> in <a href="%{resource_path}">%{resource_title}</a>.
|
89
|
+
comment_by_followed_user_group:
|
90
|
+
email_intro: 'グループ %{author_name} は %{resource_title}にコメントを残しました。このページで読むことができます:'
|
91
|
+
email_outro: '%{author_name}をフォローしているため、この通知を受け取りました。プロフィールページからこのグループのフォローを解除できます。'
|
92
|
+
email_subject: '%{author_name} に %{resource_title} による新しいコメントがあります'
|
93
|
+
notification_title: There is a new comment by <a href="%{author_path}">%{author_name} %{author_nickname}</a> in <a href="%{resource_path}">%{resource_title}</a>.
|
94
|
+
comment_created:
|
95
|
+
email_intro: "%{resource_title} はコメントされました。このページでコメントを読むことができます:"
|
96
|
+
email_outro: '"%{resource_title}" またはその著者をフォローしているため、この通知を受け取りました。前のリンクからフォローを解除することができます。'
|
97
|
+
email_subject: '%{author_name} に %{resource_title} から新しいコメントがあります'
|
98
|
+
notification_title: <a href="%{author_path}">%{author_name} %{author_nickname}</a> から <a href="%{resource_path}">%{resource_title}に新しいコメントがあります</a>
|
99
|
+
reply_created:
|
100
|
+
email_intro: "%{author_name} は %{resource_title}であなたのコメントを返信しました。このページで読むことができます:"
|
101
|
+
email_outro: コメントが返信されたため、この通知を受信しました。
|
102
|
+
email_subject: "%{author_name} が %{resource_title} であなたのコメントに返信しました"
|
103
|
+
notification_title: <a href="%{author_path}">%{author_name} %{author_nickname}</a> が <a href="%{resource_path}">%{resource_title}</a> であなたのコメントに返信しました
|
104
|
+
user_group_mentioned:
|
105
|
+
email_intro: あなたが所属しているグループがメンションされました
|
106
|
+
email_outro: あなたは %{group_name} でメンションされたグループ %{resource_title} のメンバーであるため、この通知を受け取りました。
|
107
|
+
email_subject: あなたは %{resource_title} で %{group_name} のメンバーとしてメンションされました
|
108
|
+
notification_title: あなたは <a href="%{resource_path}">%{resource_title}</a> に <a href="%{author_path}">%{author_name} %{author_nickname}</a> のメンバとして <a href="%{group_path}">%{group_name} %{group_nickname}</a>
|
109
|
+
user_mentioned:
|
110
|
+
email_intro: あなたはメンションされています
|
111
|
+
email_outro: あなたが %{resource_title}でメンションされたため、この通知を受け取りました。
|
112
|
+
email_subject: あなたは %{resource_title} でメンションされました
|
113
|
+
notification_title: あなたは <a href="%{resource_path}">%{resource_title}</a> で <a href="%{author_path}">%{author_name} %{author_nickname}によってメンションされました</a>
|
114
|
+
metrics:
|
115
|
+
comments:
|
116
|
+
description: 出席者によって生成されたコメント数
|
117
|
+
object: コメント
|
118
|
+
title: コメント
|
119
|
+
errors:
|
120
|
+
messages:
|
121
|
+
cannot_have_comments: コメントを持つことはできません
|
@@ -0,0 +1 @@
|
|
1
|
+
ko:
|
@@ -0,0 +1 @@
|
|
1
|
+
ko:
|
@@ -0,0 +1 @@
|
|
1
|
+
lt:
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
mt:
|
data/config/locales/nl.yml
CHANGED
@@ -20,6 +20,7 @@ nl:
|
|
20
20
|
comments_count: Aantal reacties
|
21
21
|
last_activity:
|
22
22
|
new_comment_at_html: "<span>Nieuwe opmerking op %{link}</span>"
|
23
|
+
view: Bekijk
|
23
24
|
votes:
|
24
25
|
create:
|
25
26
|
error: Er is een probleem opgetreden bij het stemmen op de opmerking.
|
@@ -29,7 +30,7 @@ nl:
|
|
29
30
|
form:
|
30
31
|
body:
|
31
32
|
label: Reactie
|
32
|
-
placeholder: Wat
|
33
|
+
placeholder: Wat wil je hierover zeggen?
|
33
34
|
form_error: De tekst is verplicht en het kan niet langer zijn dan %{length} tekens.
|
34
35
|
submit: Verzenden
|
35
36
|
user_group_id:
|
@@ -38,7 +39,7 @@ nl:
|
|
38
39
|
neutral: Neutraal
|
39
40
|
remaining_characters: "%{count} tekens over"
|
40
41
|
remaining_characters_1: "%{count} teken over"
|
41
|
-
title: Voeg
|
42
|
+
title: Voeg je reactie toe
|
42
43
|
comment:
|
43
44
|
alignment:
|
44
45
|
against: Tegen
|
@@ -0,0 +1 @@
|
|
1
|
+
om:
|
data/config/locales/pl.yml
CHANGED
@@ -26,7 +26,7 @@ pl:
|
|
26
26
|
new_comment_at_html: "<span>Nowy komentarz do %{link}</span>"
|
27
27
|
votes:
|
28
28
|
create:
|
29
|
-
error: Podczas
|
29
|
+
error: Podczas dodawania komentarza wystąpił błąd.
|
30
30
|
components:
|
31
31
|
add_comment_form:
|
32
32
|
account_message: <a href="%{sign_in_url}">Zaloguj się na swoje konto</a> lub <a href="%{sign_up_url}">zarejestruj się</a>, aby dodać komentarz.
|
@@ -35,7 +35,7 @@ pl:
|
|
35
35
|
label: Komentarz
|
36
36
|
placeholder: Co o tym myślisz?
|
37
37
|
form_error: 'Tekst jest wymagany. Maksymalna liczba znaków to: %{length}.'
|
38
|
-
submit:
|
38
|
+
submit: Wyślij
|
39
39
|
user_group_id:
|
40
40
|
label: Komentuj jako
|
41
41
|
opinion:
|
@@ -45,8 +45,8 @@ pl:
|
|
45
45
|
title: Dodaj swój komentarz
|
46
46
|
comment:
|
47
47
|
alignment:
|
48
|
-
against:
|
49
|
-
in_favor:
|
48
|
+
against: Negatywny
|
49
|
+
in_favor: Pozytywny
|
50
50
|
deleted_user: Usunięty użytkownik
|
51
51
|
hide_replies: Ukryj odpowiedzi
|
52
52
|
reply: Odpowiedz
|
@@ -97,7 +97,7 @@ pl:
|
|
97
97
|
email_subject: Jest nowy komentarz dodany przez %{author_name} do %{resource_title}
|
98
98
|
notification_title: Pojawił się nowy komentarz <a href="%{author_path}">%{author_name} %{author_nickname}</a> do <a href="%{resource_path}">%{resource_title}</a>.
|
99
99
|
comment_created:
|
100
|
-
email_intro: "%{resource_title}
|
100
|
+
email_intro: "Nowy komentarz: %{resource_title}. Możesz go przeczytać na tej stronie:"
|
101
101
|
email_outro: Otrzymujesz to powiadomienie, ponieważ obserwujesz "%{resource_title}" lub jego autora. Możesz przestać go obserwować po kliknięciu w poprzedni link.
|
102
102
|
email_subject: Jest nowy komentarz od %{author_name} do %{resource_title}
|
103
103
|
notification_title: Pojawił się nowy komentarz <a href="%{author_path}">%{author_name} %{author_nickname}</a> do <a href="%{resource_path}">%{resource_title}</a>
|
@@ -0,0 +1 @@
|
|
1
|
+
so:
|
data/config/locales/sv.yml
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
ti:
|
data/config/locales/uk.yml
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
vi:
|
@@ -0,0 +1 @@
|
|
1
|
+
vi:
|
@@ -0,0 +1,121 @@
|
|
1
|
+
zh-CN:
|
2
|
+
activemodel:
|
3
|
+
models:
|
4
|
+
decidim/comments/comment_by_followed_user_event: 评论
|
5
|
+
decidim/comments/comment_created_event: 评论
|
6
|
+
decidim/comments/reply_created_event: 评论回复
|
7
|
+
decidim/comments/user_group_mentioned_event: 提到了
|
8
|
+
decidim/comments/user_mentioned_event: 提到了
|
9
|
+
activerecord:
|
10
|
+
models:
|
11
|
+
decidim/comments/comment:
|
12
|
+
other: 评论
|
13
|
+
decidim/comments/comment_vote:
|
14
|
+
other: 所得票数
|
15
|
+
decidim:
|
16
|
+
comments:
|
17
|
+
comments: 评论
|
18
|
+
comments_count: 评论计数
|
19
|
+
last_activity:
|
20
|
+
new_comment_at_html: "<span>在 %{link}的新评论</span>"
|
21
|
+
view: 查看
|
22
|
+
votes:
|
23
|
+
create:
|
24
|
+
error: 在表决该评论时出现问题。
|
25
|
+
components:
|
26
|
+
add_comment_form:
|
27
|
+
account_message: <a href="%{sign_in_url}">使用您的帐户</a> 或 <a href="%{sign_up_url}">注册</a> 来添加您的评论。
|
28
|
+
form:
|
29
|
+
body:
|
30
|
+
label: 评论
|
31
|
+
placeholder: 你对此有什么看法?
|
32
|
+
form_error: 文本是必需的,不能超过 %{length} 个字符。
|
33
|
+
submit: 发送
|
34
|
+
user_group_id:
|
35
|
+
label: 评论为
|
36
|
+
opinion:
|
37
|
+
neutral: 中性的
|
38
|
+
remaining_characters: "剩余 %{count} 个字符"
|
39
|
+
remaining_characters_1: "剩余 %{count} 个字符"
|
40
|
+
title: 添加您的评论
|
41
|
+
comment:
|
42
|
+
alignment:
|
43
|
+
against: 反对的
|
44
|
+
in_favor: 优惠的
|
45
|
+
deleted_user: 删除参与者
|
46
|
+
hide_replies: 隐藏回复
|
47
|
+
reply: 答复
|
48
|
+
report:
|
49
|
+
action: 报告
|
50
|
+
already_reported: 此内容已经被报告,将由管理员审核。
|
51
|
+
close: 关闭
|
52
|
+
description: 这个内容是否不适当?
|
53
|
+
details: 其他评论
|
54
|
+
reasons:
|
55
|
+
does_not_belong: 包含非法活动、自杀威胁、个人信息或你认为不属于 %{organization_name} 的其他东西。
|
56
|
+
offensive: 包括种族主义、性别主义、污泥、个人攻击、死亡威胁、自杀请求或任何形式的仇恨言论。
|
57
|
+
spam: 包含点击、广告、骗子或脚本机器人。
|
58
|
+
title: 报告不恰当的内容
|
59
|
+
show_replies: 显示 %{replies_count} 个回复
|
60
|
+
single_comment_link_title: 获取单个评论的链接
|
61
|
+
comment_order_selector:
|
62
|
+
order:
|
63
|
+
best_rated: 最佳评分
|
64
|
+
most_discussed: 最多讨论
|
65
|
+
older: 更旧的
|
66
|
+
recent: 最近的
|
67
|
+
title: '排序方式:'
|
68
|
+
comment_thread:
|
69
|
+
title: 与 %{authorName} 的对话
|
70
|
+
comments:
|
71
|
+
blocked_comments_for_user_warning: 您此时无法评论,但您可以阅读前面的评论。
|
72
|
+
blocked_comments_warning: 评论此时被禁用,但您可以阅读前面的评论。
|
73
|
+
comment_details_title: 评论详情
|
74
|
+
loading: 正在加载评论...
|
75
|
+
single_comment_warning: 您可以在这里查看 <a href="%{url}">的其余评论</a>。
|
76
|
+
single_comment_warning_title: 您正在看到一个评论
|
77
|
+
title: "%{count} 条评论"
|
78
|
+
down_vote_button:
|
79
|
+
text: 我不同意这个评论
|
80
|
+
up_vote_button:
|
81
|
+
text: 我同意这个评论
|
82
|
+
events:
|
83
|
+
comments:
|
84
|
+
comment_by_followed_user:
|
85
|
+
email_intro: "%{author_name} 在 %{resource_title}留下了一条评论。您可以在这个页面阅读:"
|
86
|
+
email_outro: 您收到此通知是因为您正在关注 %{author_name}。您可以从其个人资料页面取消关注此用户。
|
87
|
+
email_subject: '%{author_name} 在 %{resource_title} 有一个新评论'
|
88
|
+
notification_title: <a href="%{author_path}">%{author_name} %{author_nickname}</a> 在 <a href="%{resource_path}">%{resource_title}</a> 有新的评论。
|
89
|
+
comment_by_followed_user_group:
|
90
|
+
email_intro: '组 %{author_name} 在 %{resource_title}留下了一个评论。您可以在这个页面阅读它:'
|
91
|
+
email_outro: 您收到此通知是因为您正在关注 %{author_name}。您可以从其个人资料页面取消关注此组。
|
92
|
+
email_subject: '%{author_name} 在 %{resource_title} 有一个新评论'
|
93
|
+
notification_title: <a href="%{author_path}">%{author_name} %{author_nickname}</a> 在 <a href="%{resource_path}">%{resource_title}</a> 有新的评论。
|
94
|
+
comment_created:
|
95
|
+
email_intro: "%{resource_title} 已被评论。您可以阅读此页面中的评论:"
|
96
|
+
email_outro: 您收到此通知是因为您正在关注"%{resource_title}"或其作者。您可以从上一个链接取消关注它。
|
97
|
+
email_subject: '%{author_name} 在 %{resource_title} 有一个新评论'
|
98
|
+
notification_title: 来自 <a href="%{author_path}">%{author_name} %{author_nickname}</a> 的新评论 <a href="%{resource_path}">%{resource_title}</a>
|
99
|
+
reply_created:
|
100
|
+
email_intro: "%{author_name} 在 %{resource_title}回复了您的评论。您可以在这个页面阅读:"
|
101
|
+
email_outro: 您收到此通知是因为您的评论已被回复。
|
102
|
+
email_subject: "%{author_name} 在 %{resource_title} 回复了您的评论"
|
103
|
+
notification_title: <a href="%{author_path}">%{author_name} %{author_nickname}</a> 回复了您在 <a href="%{resource_path}">%{resource_title}</a>
|
104
|
+
user_group_mentioned:
|
105
|
+
email_intro: 已经提到您所属的组
|
106
|
+
email_outro: 您收到此通知是因为您是在 %{group_name} 中提及的组 %{resource_title} 的成员。
|
107
|
+
email_subject: 您已在 %{resource_title} 中被提及为 %{group_name} 的成员
|
108
|
+
notification_title: 您在 <a href="%{resource_path}">%{resource_title}中提到</a> <a href="%{author_path}">%{author_name} %{author_nickname}</a> 作为 <a href="%{group_path}">%{group_name} %{group_nickname}</a>
|
109
|
+
user_mentioned:
|
110
|
+
email_intro: 您已被提到。
|
111
|
+
email_outro: 您收到此通知是因为您已在 %{resource_title} 中被提及。
|
112
|
+
email_subject: 您已在 %{resource_title} 中被提及了
|
113
|
+
notification_title: 您在 <a href="%{resource_path}">%{resource_title}中提到</a> <a href="%{author_path}">%{author_name} %{author_nickname}</a>
|
114
|
+
metrics:
|
115
|
+
comments:
|
116
|
+
description: 与会者生成的评论数
|
117
|
+
object: 评论
|
118
|
+
title: 评论
|
119
|
+
errors:
|
120
|
+
messages:
|
121
|
+
cannot_have_comments: 不能有评论
|
@@ -0,0 +1 @@
|
|
1
|
+
zh-TW:
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class MakeCommentsHandleI18n < ActiveRecord::Migration[5.2]
|
4
|
+
class User < ApplicationRecord
|
5
|
+
self.table_name = :decidim_users
|
6
|
+
end
|
7
|
+
|
8
|
+
class Comment < ApplicationRecord
|
9
|
+
self.table_name = :decidim_comments_comments
|
10
|
+
end
|
11
|
+
|
12
|
+
class Organization < ApplicationRecord
|
13
|
+
self.table_name = :decidim_organizations
|
14
|
+
end
|
15
|
+
|
16
|
+
def change
|
17
|
+
add_column :decidim_comments_comments, :new_body, :jsonb
|
18
|
+
|
19
|
+
User.reset_column_information
|
20
|
+
Comment.reset_column_information
|
21
|
+
Organization.reset_column_information
|
22
|
+
|
23
|
+
Comment.find_each do |comment|
|
24
|
+
locale, org_id = User.where(id: comment.decidim_author_id).pluck(:locale, :decidim_organization_id).first
|
25
|
+
locale = locale.presence || Organization.find(org_id).default_locale
|
26
|
+
|
27
|
+
comment.new_body = {
|
28
|
+
locale => comment.body
|
29
|
+
}
|
30
|
+
|
31
|
+
comment.save!
|
32
|
+
end
|
33
|
+
|
34
|
+
remove_column :decidim_comments_comments, :body
|
35
|
+
rename_column :decidim_comments_comments, :new_body, :body
|
36
|
+
|
37
|
+
User.reset_column_information
|
38
|
+
Comment.reset_column_information
|
39
|
+
Organization.reset_column_information
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class AddCommentableCounterCacheToComments < ActiveRecord::Migration[5.2]
|
4
|
+
def change
|
5
|
+
add_column :decidim_comments_comments, :comments_count, :integer, null: false, default: 0, index: true
|
6
|
+
Decidim::Comments::Comment.reset_column_information
|
7
|
+
Decidim::Comments::Comment.find_each(&:update_comments_count)
|
8
|
+
end
|
9
|
+
end
|
@@ -25,7 +25,11 @@ module Decidim
|
|
25
25
|
}
|
26
26
|
end
|
27
27
|
|
28
|
-
field :body, !types.String, "The comment message"
|
28
|
+
field :body, !types.String, "The comment message" do
|
29
|
+
resolve lambda { |obj, _args, _ctx|
|
30
|
+
obj.translated_body
|
31
|
+
}
|
32
|
+
end
|
29
33
|
|
30
34
|
field :formattedBody, !types.String, "The comment message ready to display (it is expected to include HTML)", property: :formatted_body
|
31
35
|
|
@@ -11,7 +11,8 @@ module Decidim
|
|
11
11
|
{
|
12
12
|
id: resource.id,
|
13
13
|
created_at: resource.created_at,
|
14
|
-
body: resource.body,
|
14
|
+
body: resource.body.values.first,
|
15
|
+
locale: resource.body.keys.first,
|
15
16
|
author: {
|
16
17
|
id: resource.author.id,
|
17
18
|
name: resource.author.name
|
@@ -31,7 +32,11 @@ module Decidim
|
|
31
32
|
private
|
32
33
|
|
33
34
|
def root_commentable_url
|
34
|
-
@root_commentable_url ||=
|
35
|
+
@root_commentable_url ||= if resource.root_commentable&.respond_to?(:polymorphic_resource_url)
|
36
|
+
resource.root_commentable.polymorphic_resource_url
|
37
|
+
else
|
38
|
+
ResourceLocatorPresenter.new(resource.root_commentable).url
|
39
|
+
end
|
35
40
|
end
|
36
41
|
end
|
37
42
|
end
|