diff --git a/app/views/articles/_comments_actions.html.erb b/app/views/articles/_comments_actions.html.erb index 8b6cfb13b..5e8232494 100644 --- a/app/views/articles/_comments_actions.html.erb +++ b/app/views/articles/_comments_actions.html.erb @@ -2,14 +2,14 @@ <% if @comments_to_show_count && @article.comments_count > @comments_to_show_count %>
<% end %> <% if @article.any_comments_hidden %>- Some comments have been hidden by the post's author - find out more + <%= t("views.comments.hidden.text_html", info: link_to(t("views.comments.hidden.info"), "/faq")) %>
<% end %> diff --git a/app/views/articles/_single_story.html.erb b/app/views/articles/_single_story.html.erb index 617d5eb5b..48ff2b507 100644 --- a/app/views/articles/_single_story.html.erb +++ b/app/views/articles/_single_story.html.erb @@ -127,14 +127,16 @@ <% end %> <% if story.comments_count > 0 %> - <%= inline_svg_tag("small-comment.svg", aria: true, width: 24, height: 24, class: "crayons-icon", title: "Comments") %> - <%= story.comments_count %> - <%= story.comments_count == 1 ? t("core.comment").downcase : t("core.comment").downcase.pluralize %> + <%= inline_svg_tag("small-comment.svg", aria: true, width: 24, height: 24, class: "crayons-icon", title: t("views.comments.summary.title")) %> + <%= t("views.comments.summary.count_html", + count: story.comments_count, + start: tag("span", { class: %w[hidden s:inline] }, true), + end: "".html_safe) %> <% else %> - <%= inline_svg_tag("small-comment.svg", aria: true, width: 24, height: 24, class: "crayons-icon", title: "Comments") %> - Add <%= t("core.comment") %> + <%= inline_svg_tag("small-comment.svg", aria: true, width: 24, height: 24, class: "crayons-icon", title: t("views.comments.summary.title")) %> + <%= t("views.comments.add") %> <% end %> diff --git a/app/views/articles/_widget_list_item.html.erb b/app/views/articles/_widget_list_item.html.erb index 6d75a514b..a040b007f 100644 --- a/app/views/articles/_widget_list_item.html.erb +++ b/app/views/articles/_widget_list_item.html.erb @@ -3,9 +3,9 @@ <% if show_comment_count %>
- <%= inline_svg_tag("collapse.svg", aria: true, class: "crayons-icon expanded", title: "Collapse") %> - <%= inline_svg_tag("expand.svg", aria: true, class: "crayons-icon collapsed", title: "Expand") %> + <%= inline_svg_tag("collapse.svg", aria: true, class: "crayons-icon expanded", title: t("views.comments.collapse")) %> + <%= inline_svg_tag("expand.svg", aria: true, class: "crayons-icon collapsed", title: t("views.comments.expand")) %>
diff --git a/app/views/comments/_comment_date.erb b/app/views/comments/_comment_date.erb index 7c991b794..a16ce71dc 100644 --- a/app/views/comments/_comment_date.erb +++ b/app/views/comments/_comment_date.erb @@ -6,10 +6,8 @@ <% if decorated_comment.edited_at.present? %> - • Edited - - on - + <%= t("views.comments.edited.text_html", + on: tag.span(t("views.comments.edited.on_html", date: tag.time(decorated_comment.edited_at.strftime(t("time.formats.short")), datetime: decorated_comment.edited_timestamp), class: %w[hidden m:inline-block])) + ) %> <% end %> diff --git a/app/views/comments/_comment_footer.html.erb b/app/views/comments/_comment_footer.html.erb index 5879cf6b1..82dd52bd9 100644 --- a/app/views/comments/_comment_footer.html.erb +++ b/app/views/comments/_comment_footer.html.erb @@ -7,14 +7,9 @@ <%= inline_svg_tag("small-heart.svg", aria: true, class: "crayons-icon reaction-icon not-reacted", - title: "Like comment:") %> - <%= inline_svg_tag("small-heart-filled.svg", aria: true, class: "crayons-icon reaction-icon--like reaction-icon reacted", title: "Like comment: ") %> - - <%= comment.public_reactions_count if comment.public_reactions_count.positive? %> - - - <%= like_button_text(comment).html_safe %> - + title: t("views.comments.footer.heart.icon")) %> + <%= inline_svg_tag("small-heart-filled.svg", aria: true, class: "crayons-icon reaction-icon--like reaction-icon reacted", title: t("views.comments.footer.heart.icon")) %> + <%= t("views.comments.footer.heart.count_html", num: tag.span((comment.public_reactions_count if comment.public_reactions_count.positive?), class: "reactions-count"), likes: tag.span(like_button_text(comment).html_safe, class: "reactions-label hidden m:inline-block")) %> <% unless @discussion_lock %> @@ -25,13 +20,13 @@ data-comment-id="<%= comment.id %>" data-path="<%= commentable.path %>/comments/<%= comment.id_code_generated %>" rel="nofollow"> - <%= inline_svg_tag("small-comment.svg", aria: true, class: "crayons-icon reaction-icon not-reacted", title: "Comment button") %> - <%= t("core.reply") %> + <%= inline_svg_tag("small-comment.svg", aria: true, class: "crayons-icon reaction-icon not-reacted", title: t("views.comments.footer.reply.icon")) %> + <%= t("views.comments.footer.reply.text") %> <% else %> - <%= inline_svg_tag("small-thread.svg", aria: true, class: "crayons-icon", title: "Thread") %> - Thread + <%= inline_svg_tag("small-thread.svg", aria: true, class: "crayons-icon", title: t("views.comments.footer.thread.icon")) %> + <%= t("views.comments.footer.thread.text") %> <% end %> <% end %> diff --git a/app/views/comments/_comment_header.html.erb b/app/views/comments/_comment_header.html.erb index 77cadc416..3a45142cd 100644 --- a/app/views/comments/_comment_header.html.erb +++ b/app/views/comments/_comment_header.html.erb @@ -22,21 +22,22 @@ <%= render "comments/comment_date", decorated_comment: decorated_comment %>- Discussion on: - <%= @commentable.title %> -
-+ <%= t("views.comments.parent.subtitle_html", + start: tag("span", { class: %w[fw-normal color-base-60] }, true), + end: "".html_safe, + title: tag.span(@commentable.title)) %> +
+- Replies for: <%= parent.title(150) %> + <%= t("views.comments.parent.reply_html", + start: tag("span", { class: %w[fw-normal opacity-75] }, true), + end: "".html_safe, + title: tag.span(parent.title(150))) %>
- Some comments have been hidden by the post's author - find out more + <%= t("views.comments.hidden.text_html", info: link_to(t("views.comments.hidden.info"), "/faq#what-does-comment-hidden-by-post-author-mean")) %>
<% end %> diff --git a/app/views/comments/settings.html.erb b/app/views/comments/settings.html.erb index d9641a10a..70c85124d 100644 --- a/app/views/comments/settings.html.erb +++ b/app/views/comments/settings.html.erb @@ -1,30 +1,30 @@ -<% title "Comment Settings" %> +<% title t("views.comments.settings.meta.title") %>Comment Settings
+<%= t("views.comments.settings.heading") %>
Showing thread notifications
-You will receive all notifications for this comment and any of your comments in this chain.
+<%= t("views.comments.settings.state.show.subtitle") %>
+<%= t("views.comments.settings.state.show.desc") %>
<% else %> -Muting thread notifications
-All notifications for this comment and any of your comments in the thread are currently muted.
+<%= t("views.comments.settings.state.mute.subtitle") %>
+<%= t("views.comments.settings.state.mute.desc") %>
<% end %>Subscription
-You are still subscribed to all comments in the broader thread, which will mean you will still receive notifications for replies to this comment.
+<%= t("views.comments.settings.subscribe.subtitle") %>
+<%= t("views.comments.settings.subscribe.desc") %>
" class="crayons-link notification__reply-title"> - Re: <%= json_data["comment"]["ancestors"].last["title"] %> + <%= t("views.comments.re.text_html", re: tag.span(t("views.comments.re.re"), class: "fw-normal opacity-50"), title: json_data["comment"]["ancestors"].last["title"]) %>
<% end %> @@ -41,28 +41,28 @@ data-category="like" data-reactable-type="Comment" title="heart"> - <%= inline_svg_tag("small-heart.svg", aria: true, class: "crayons-icon reaction-icon not-reacted", title: "Favorite heart outline button") %> - <%= inline_svg_tag("small-heart-filled.svg", aria: true, class: "crayons-icon reaction-icon--like reaction-icon reacted", title: "Favorite heart outline button") %> - Like + <%= inline_svg_tag("small-heart.svg", aria: true, class: "crayons-icon reaction-icon not-reacted", title: t("views.comments.footer.heart.icon")) %> + <%= inline_svg_tag("small-heart-filled.svg", aria: true, class: "crayons-icon reaction-icon--like reaction-icon reacted", title: t("views.comments.footer.heart.icon")) %> + <%= t("views.comments.footer.heart.text") %> <% cache "comment-box-comment-reply-#{@last_user_comment}-#{json_data['comment']['updated_at']}-#{json_data['comment']['id']}" do %> <% reply = Comment.select(:id, :user_id, :ancestry).find_by(id: json_data["comment"]["id"])&.children&.find_by(user_id: current_user.id) %> <% if reply %> - <%= inline_svg_tag("small-comment-filled.svg", aria: true, class: "crayons-icon reaction-icon--comment reaction-icon reacted", title: "Comment button") %> - Replied + <%= inline_svg_tag("small-comment-filled.svg", aria: true, class: "crayons-icon reaction-icon--comment reaction-icon reacted", title: t("views.comments.footer.reply.icon")) %> + <%= t("views.comments.footer.reply.done") %> <% else %> <% end %> <% end %> " class="crayons-btn crayons-btn--ghost crayons-btn--icon-left crayons-btn--s inline-flex"> - <%= inline_svg_tag("small-link.svg", aria: true, class: "crayons-icon", title: "View button") %>View + <%= inline_svg_tag("small-link.svg", aria: true, class: "crayons-icon", title: t("views.comments.footer.view.icon")) %><%= t("views.comments.footer.view.text") %>😔 There was an error in your markdown
%{error}
" + parent: + subtitle_html: "%{start}Discussion on: %{end}%{title}" + metadata_html: "%{name}%{on}" + date: " on %{date}" + full: Full discussion + read: Read full post + view: View post + view_full: + one: View full discussion (%{count} comment) + other: View full discussion (%{count} comments) + reply_html: "%{start}Replies for:%{end} %{title}" + delete: + heading: Are you sure you want to delete this comment? + desc_html: You cannot undo this action, perhaps you just want to %{action} instead? + action: Edit + error: Something went wrong; Comment NOT deleted. + notice: Comment was successfully deleted. + submit: Delete + edit: Edit + cancel: Dismiss + collapse: Collapse + edit: Editing comment + edited: + text_html: "• Edited %{on}" + on_html: on %{date} + expand: Expand + hidden: + text_html: Some comments have been hidden by the post's author - %{info} + info: find out more + locked: The discussion has been locked. New comments can't be added. + orphan: + deleted: "[Comment from a deleted post]" + re: + text_html: "%{re}%{title}" + re: 'Re: ' + settings: + meta: + title: Comment Settings + heading: Comment Settings + state: + show: + subtitle: Showing thread notifications + desc: You will receive all notifications for this comment and any of your comments in this chain. + mute: + subtitle: Muting thread notifications + desc: All notifications for this comment and any of your comments in the thread are currently muted. + subscribe: + subtitle: Subscription + desc: You are still subscribed to all comments in the broader thread, which will mean you will still receive notifications for replies to this comment. + mute: Mute notifications + unmute: Unmute notifications + quality: + low: Comment marked as low quality/non-constructive by the community. + conduct: View Code of Conduct + hidden: + icon: Info + text: Comment hidden by post author - thread only visible in this permalink + write: + errors: + one: '1 error prohibited this comment from being saved:' + other: "%{count} errors prohibited this comment from being saved:" + field: + aria_label: Add a comment to the discussion + placeholder: Add to the discussion + submit: Upload + templates: Templates + upload: Upload image + use: Use a response template + guide: + title: Markdown Guide + icon: Editor guide + template: + article: This post comes with a comment template + create: + subtitle: Create template + desc: Templates let you quickly answer FAQs or store snippets for re-use. + moderator: Moderator + personal: Personal + submit: Submit + preview: Preview + cancel: Dismiss + menu: + aria_label: Toggle dropdown menu + icon: Dropdown menu + copy: + aria_label: Copy link to %{user}'s comment + text: Copy link + settings: + aria_label: Go to %{user}'s comment settings + action: + aria_label: "%{action} %{user}'s comment" + hide: Hide + unhide: Unhide + hide_text: Hide + unhide_text: Unhide + moderate: + aria_label: Moderate %{user}'s comment + report: + aria_label: Report %{user}'s comment as abusive or violating our code of conduct and/or terms and conditions + footer: + heart: + title: heart + icon: 'Like comment: ' + count_html: "%{num}%{likes}" + text: Like + reply: + aria_label: Reply to a comment... + icon: Comment button + done: Replied + text: Reply + placeholder: Reply... + thread: + icon: Thread + text: Thread + view: + icon: View button + text: View + count: + one: "%{count} comment" + other: "%{count} comments" + empty: New + add: "Add\_Comment" + summary: + count_html: + one: "%{count}%{start}\_comment%{end}" + other: "%{count}%{start}\_comments%{end}" + title: Comments + diff --git a/config/locales/views/comments/fr.yml b/config/locales/views/comments/fr.yml new file mode 100644 index 000000000..57cfbdfe4 --- /dev/null +++ b/config/locales/views/comments/fr.yml @@ -0,0 +1,145 @@ +--- +fr: + views: + comments: + meta: + title_root: Discussion of %{title} + description: An article from the community + og: + title: Discussion of %{title} + title_rel: "%{root} — %{site}" + title_root: "[Discussion] %{title} — %{site}" + description: "%{site} Comment" + messages: + create: + success: created + failure: comment already exists + markdown: 'There was an error in your markdown: %{error}' + markdown_html: "😔 There was an error in your markdown
%{error}
" + parent: + subtitle_html: "%{start}Discussion on: %{end}%{title}" + metadata_html: "%{name}%{on}" + date: " on %{date}" + full: Full discussion + read: Read full post + view: Voir la publication + view_full: + one: Voir la discussion complète (%{count} commentaires) + other: Voir la discussion complète (%{count} commentaires) + reply_html: "%{start}Replies for:%{end} %{title}" + delete: + heading: Are you sure you want to delete this comment? + desc_html: You cannot undo this action, perhaps you just want to %{action} instead? + action: Edit + error: Something went wrong; Comment NOT deleted. + notice: Comment was successfully deleted. + submit: Delete + edit: Edit + cancel: Dismiss + collapse: Collapse + edit: Editing comment + edited: + text_html: "• Edited %{on}" + on_html: on %{date} + expand: Expand + hidden: + text_html: Some comments have been hidden by the post's author - %{info} + info: find out more + locked: The discussion has been locked. New comments can't be added. + orphan: + deleted: "[Comment from a deleted post]" + re: + text_html: "%{re}%{title}" + re: 'Re: ' + settings: + meta: + title: Comment Settings + heading: Comment Settings + state: + show: + subtitle: Showing thread notifications + desc: You will receive all notifications for this comment and any of your comments in this chain. + mute: + subtitle: Muting thread notifications + desc: All notifications for this comment and any of your comments in the thread are currently muted. + subscribe: + subtitle: Subscription + desc: You are still subscribed to all comments in the broader thread, which will mean you will still receive notifications for replies to this comment. + mute: Mute notifications + unmute: Unmute notifications + quality: + low: Comment marked as low quality/non-constructive by the community. + conduct: View Code of Conduct + hidden: + icon: Info + text: Comment hidden by post author - thread only visible in this permalink + write: + errors: + one: '1 error prohibited this comment from being saved:' + other: "%{count} errors prohibited this comment from being saved:" + field: + aria_label: Add a comment to the discussion + placeholder: Add to the discussion + submit: Upload + templates: Templates + upload: Upload image + use: Use a response template + guide: + title: Markdown Guide + icon: Editor guide + template: + article: This post comes with a comment template + create: + subtitle: Create template + desc: Templates let you quickly answer FAQs or store snippets for re-use. + moderator: Moderator + personal: Personal + submit: Submit + preview: Preview + cancel: Dismiss + menu: + aria_label: Toggle dropdown menu + icon: Dropdown menu + copy: + aria_label: Copy link to %{user}'s comment + text: Copier le lien + settings: + aria_label: Go to %{user}'s comment settings + action: + aria_label: "%{action} %{user}'s comment" + hide: Hide + unhide: Unhide + hide_text: Hide + unhide_text: Unhide + moderate: + aria_label: Moderate %{user}'s comment + report: + aria_label: Report %{user}'s comment as abusive or violating our code of conduct and/or terms and conditions + footer: + heart: + title: heart + icon: 'Like comment: ' + count_html: "%{num}%{likes}" + text: Like + reply: + aria_label: Reply to a comment... + icon: Comment button + done: Replied + text: Répondre + placeholder: Reply... + thread: + icon: Thread + text: Thread + view: + icon: View button + text: View + count: + one: "%{count} comment" + other: "%{count} comments" + empty: New + add: "Ajouter un commentaire" + summary: + count_html: + one: "%{count}%{start}\_commentaire%{end}" + other: "%{count}%{start}\_commentaires%{end}" + title: Comments