From 318ad270ebf00b292485e06e389c34043c46ffb3 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 31 Jul 2022 16:01:28 +0200 Subject: [PATCH 01/18] Add new translation for noscript message --- app/views/layouts/_messages.haml | 2 +- config/locales/views.en.yml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/_messages.haml b/app/views/layouts/_messages.haml index 9cb2beac..413d2925 100644 --- a/app/views/layouts/_messages.haml +++ b/app/views/layouts/_messages.haml @@ -1,6 +1,6 @@ %noscript .alert.alert-danger - = t 'messages.noscript' + = t(".noscript") - flash.each do |key, value| .alert.alert-dismissible{ class: "alert-#{bootstrap_color key}", role: :alert } diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index e0dfc0a9..878d47af 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -197,6 +197,9 @@ en: share: heading: "Share" button: "Share on %{service}" + layouts: + messages: + noscript: "Please activate JavaScript." link_filter: index: heading: "You're leaving %{app_name}" From 77abb202d780097876a268a519c9df38cbcd4f7a Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 31 Jul 2022 16:02:06 +0200 Subject: [PATCH 02/18] Add new translation for questionbox title --- app/views/question/show.haml | 2 +- config/locales/views.en.yml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/question/show.haml b/app/views/question/show.haml index f128aed8..3107b7e0 100644 --- a/app/views/question/show.haml +++ b/app/views/question/show.haml @@ -15,7 +15,7 @@ - if user_signed_in? && !current_user.answered?(@question) && current_user != @question.user && @question.user&.privacy_allow_stranger_answers .card#q-answer-box - .card-header= t('views.question.title') + .card-header= t('.questionbox.title') .card-body %textarea.form-control#q-answer-text{ placeholder: t("inbox.entry.placeholder"), data: { id: @question.id } } %br/ diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index 878d47af..00a4fa05 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -514,3 +514,7 @@ en: ban: "Ban Control" title: "Actions" list: "Manage list memberships" + question: + show: + questionbox: + title: "This question was not in your inbox? Answer it here!" \ No newline at end of file From f22c69cfe8b03362e1ec2925c99a01a04307740c Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 31 Jul 2022 16:02:33 +0200 Subject: [PATCH 03/18] Add new translations for profile badges --- app/views/user/_profile.haml | 8 ++++---- config/locales/views.en.yml | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/views/user/_profile.haml b/app/views/user/_profile.haml index 44fb7931..ff31cde4 100644 --- a/app/views/user/_profile.haml +++ b/app/views/user/_profile.haml @@ -13,19 +13,19 @@ - if user.banned? %span.badge.badge-dark %i.fa.fa-fw.fa-ban - = t 'views.user.title.banned' + = t('.badge.banned') - if user.following? current_user .badge.badge-light - = t 'views.user.follows_you' + = t('.badge.follows_you') - if user_signed_in? && current_user.has_role?(:administrator) - if user.has_role?(:administrator) %span.badge.badge-danger %i.fa.fa-fw.fa-flask - = t 'views.user.title.admin' + = t('.badge.admin') - if user.has_role?(:moderator) %span.badge.badge-success %i.fa.fa-fw.fa-users - = t 'views.user.title.moderator' + = t('.badge.moderator') - unless user.profile.description.blank? .profile__biography = markdown user.profile.description diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index 00a4fa05..dc067928 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -514,6 +514,11 @@ en: ban: "Ban Control" title: "Actions" list: "Manage list memberships" + profile: + admin: "Admin" + banned: "Banned" + follows_you: "Follows you" + moderator: "Moderator" question: show: questionbox: From 0575bb8ee3e7a28d187df314784f328b362a8dd0 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 31 Jul 2022 16:02:59 +0200 Subject: [PATCH 04/18] Add new translations for profile tabs --- app/views/tabs/_profile.haml | 8 ++++---- config/locales/views.en.yml | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/views/tabs/_profile.haml b/app/views/tabs/_profile.haml index d8d758a3..ee490edd 100644 --- a/app/views/tabs/_profile.haml +++ b/app/views/tabs/_profile.haml @@ -1,6 +1,6 @@ .card .list-group.list-group-horizontal-sm.text-center - = list_group_item 'Answers', user_path(user), badge: user.answered_count - = list_group_item 'Questions', show_user_questions_path(user.screen_name), badge: user.asked_count - = list_group_item 'Followers', show_user_followers_path(user.screen_name), badge: user.followers.count - = list_group_item 'Following', show_user_followings_path(user.screen_name), badge: user.followings.count + = list_group_item t(".answers"), user_path(user), badge: user.answered_count + = list_group_item t(".questions"), show_user_questions_path(user.screen_name), badge: user.asked_count + = list_group_item t(".followers"), show_user_followers_path(user.screen_name), badge: user.followers.count + = list_group_item t(".following"), show_user_followings_path(user.screen_name), badge: user.followings.count diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index dc067928..a8d02e97 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -485,6 +485,11 @@ en: comment: "Comments" commentsmile: "Comment Smiles" relationship: "Followers" + profile: + answers: :activerecord.models.answer.other + questions: :activerecord.models.question.other + followers: "Followers" + following: "Following" settings: account: "Account" profile: "Profile" From 196433052b981d59530bd14fe08fa626f9031a80 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 31 Jul 2022 16:03:25 +0200 Subject: [PATCH 05/18] Add new translations for feed tabs --- app/views/tabs/_feed.haml | 16 ++++------------ config/locales/views.en.yml | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/app/views/tabs/_feed.haml b/app/views/tabs/_feed.haml index ace55ec7..9bd586ea 100644 --- a/app/views/tabs/_feed.haml +++ b/app/views/tabs/_feed.haml @@ -1,24 +1,16 @@ .card .list-group.list-group-horizontal-sm.text-center - = list_group_item t('views.general.timeline'), timeline_path + = list_group_item t('.timeline'), timeline_path - if APP_CONFIG.dig(:features, :public, :enabled) - = list_group_item t('views.general.public'), public_timeline_path + = list_group_item t('.public'), public_timeline_path %a.list-group-item.list-group-item-action.dropdown.dropdown-toggle{ class: list ? 'active' : '', type: :button, data: { toggle: :dropdown }, aria: { haspopup: true, expanded: false } } - if list = list.display_name - else - Lists + = t(".lists.title") .dropdown-menu.dropdown-menu-right.dropdown-menu--lists - if current_user.lists.empty? - .p-3 - %p Looks like you don't have any lists yet. - %p - You can create lists and add users to them using the - %i.fa.fa-fw.fa-list - icon in the navigation on user profiles that are not yours. - %p.mb-0 - Once you have done that, the lists will be shown here. - When you select a list you'll get a timeline view of all users within that list. + .p-3= t(".lists.notice_html") - current_user.lists.each do |list| %a.dropdown-item{ href: list_timeline_path(list.name) }= list.display_name diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index a8d02e97..b524b552 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -471,6 +471,21 @@ en: terms: "Terms of Service" privacy: "Privacy Policy" tabs: + feed: + public: "Public" + timeline: "Your Timeline" + lists: + title: "Lists" + notice_html: | +

Looks like you don't have any lists yet.

+

+ You can create lists and add users to them using the + icon in the navigation on user profiles that are not yours. +

+

+ Once you have done that, the lists will be shown here. + When you select a list you'll get a timeline view of all users within that list. +

moderation: all: "All reports" answers: :activerecord.models.answer.other From c9c0a8e296d786c4217649214c0f4bab2ed49b1d Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 31 Jul 2022 16:03:41 +0200 Subject: [PATCH 06/18] Add new translations for sidebar --- app/views/shared/_sidebar.haml | 4 ++-- config/locales/views.en.yml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/shared/_sidebar.haml b/app/views/shared/_sidebar.haml index 7d76746c..7b36b281 100644 --- a/app/views/shared/_sidebar.haml +++ b/app/views/shared/_sidebar.haml @@ -10,10 +10,10 @@ = current_user.screen_name - unless @list.nil? .card - .card-header= t('views.list.members') + .card-header= t(".list.title") .card-body - if @list.members.empty? - %p.text-muted No members yet. + %p.text-muted= t(".list.none") - @list.members.each do |member| %a{ href: user_path(member.user), title: member.user.screen_name, data: { toggle: :tooltip, placement: :top } } %img.avatar-xs{ src: member.user.profile_picture.url(:medium) } diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index b524b552..e316160d 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -470,6 +470,10 @@ en: source: "Source code" terms: "Terms of Service" privacy: "Privacy Policy" + sidebar: + list: + title: "Members" + none: "No members yet." tabs: feed: public: "Public" From 569f2e3458b8f9d90294ddc29be2e3651a568215 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 31 Jul 2022 16:04:07 +0200 Subject: [PATCH 07/18] Remove legacy translations --- config/locales/en.yml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 458c9b5b..b458723d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,24 +1,14 @@ en: language: 'English (US)' - messages: - noscript: "Please activate JavaScript." views: locale: languages: "Languages" - general: - timeline: "Timeline" - public: "Public" - list: - title: "List" - members: "Members" actions: list: "Manage list memberships" sessions: destroy: "Logout" create: "Sign in" new: "Sign up" - question: - title: "This question was not in your inbox? Answer it here!" navigation: timeline: "Timeline" inbox: "Inbox" @@ -29,9 +19,3 @@ en: admin: "Kontrollzentrum" sidekiq: "Sidekiq" moderation: "Moderation Panel" - user: - follows_you: "Follows you" - title: - admin: "Admin" - moderator: "Moderator" - banned: "Banned" From 416bf19132573c138836095f0a5f21068bbc5d0c Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 31 Jul 2022 16:06:09 +0200 Subject: [PATCH 08/18] Fix HAML codestyle in views --- app/views/question/show.haml | 12 ++++++------ app/views/shared/_sidebar.haml | 2 +- app/views/tabs/_feed.haml | 6 +++--- app/views/user/_profile.haml | 12 ++++++------ 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/views/question/show.haml b/app/views/question/show.haml index 3107b7e0..6ece7de6 100644 --- a/app/views/question/show.haml +++ b/app/views/question/show.haml @@ -1,12 +1,12 @@ - provide(:title, question_title(@question)) -= render 'question', question: @question, hidden: false -= render 'question', question: @question, hidden: true += render "question", question: @question, hidden: false += render "question", question: @question, hidden: true .container.question-page #answers - @answers.each do |a| - = render 'answerbox', a: a, show_question: false + = render "answerbox", a: a, show_question: false - = render 'shared/cursored_pagination_dummy', more_data_available: @more_data_available, last_id: @answers_last_id + = render "shared/cursored_pagination_dummy", more_data_available: @more_data_available, last_id: @answers_last_id - if @more_data_available .d-flex.justify-content-center.justify-content-sm-start @@ -15,7 +15,7 @@ - if user_signed_in? && !current_user.answered?(@question) && current_user != @question.user && @question.user&.privacy_allow_stranger_answers .card#q-answer-box - .card-header= t('.questionbox.title') + .card-header= t(".questionbox.title") .card-body %textarea.form-control#q-answer-text{ placeholder: t("inbox.entry.placeholder"), data: { id: @question.id } } %br/ @@ -23,5 +23,5 @@ = t("voc.answer") - current_user.services.each do |service| %label - %input{ type: 'checkbox', name: 'share', checked: :checked, data: { q_id: @question.id, service: service.provider } } + %input{ type: "checkbox", name: "share", checked: :checked, data: { q_id: @question.id, service: service.provider } } = t("inbox.entry.sharing.post_to", service: service.provider.capitalize) diff --git a/app/views/shared/_sidebar.haml b/app/views/shared/_sidebar.haml index 7b36b281..3ea4cf8a 100644 --- a/app/views/shared/_sidebar.haml +++ b/app/views/shared/_sidebar.haml @@ -18,4 +18,4 @@ %a{ href: user_path(member.user), title: member.user.screen_name, data: { toggle: :tooltip, placement: :top } } %img.avatar-xs{ src: member.user.profile_picture.url(:medium) } -= render 'shared/links' += render "shared/links" diff --git a/app/views/tabs/_feed.haml b/app/views/tabs/_feed.haml index 9bd586ea..d1da004d 100644 --- a/app/views/tabs/_feed.haml +++ b/app/views/tabs/_feed.haml @@ -1,9 +1,9 @@ .card .list-group.list-group-horizontal-sm.text-center - = list_group_item t('.timeline'), timeline_path + = list_group_item t(".timeline"), timeline_path - if APP_CONFIG.dig(:features, :public, :enabled) - = list_group_item t('.public'), public_timeline_path - %a.list-group-item.list-group-item-action.dropdown.dropdown-toggle{ class: list ? 'active' : '', + = list_group_item t(".public"), public_timeline_path + %a.list-group-item.list-group-item-action.dropdown.dropdown-toggle{ class: list ? "active" : "", type: :button, data: { toggle: :dropdown }, aria: { haspopup: true, expanded: false } } - if list = list.display_name diff --git a/app/views/user/_profile.haml b/app/views/user/_profile.haml index ff31cde4..8f94c83a 100644 --- a/app/views/user/_profile.haml +++ b/app/views/user/_profile.haml @@ -13,28 +13,28 @@ - if user.banned? %span.badge.badge-dark %i.fa.fa-fw.fa-ban - = t('.badge.banned') + = t(".badge.banned") - if user.following? current_user .badge.badge-light - = t('.badge.follows_you') + = t(".badge.follows_you") - if user_signed_in? && current_user.has_role?(:administrator) - if user.has_role?(:administrator) %span.badge.badge-danger %i.fa.fa-fw.fa-flask - = t('.badge.admin') + = t(".badge.admin") - if user.has_role?(:moderator) %span.badge.badge-success %i.fa.fa-fw.fa-users - = t('.badge.moderator') + = t(".badge.moderator") - unless user.profile.description.blank? .profile__biography = markdown user.profile.description - unless user.profile.website.blank? .profile__website %i.fa.fa-fw.fa-globe - %a{ href: user.profile.website, target: '_blank', rel: 'nofollow' }= user.profile.display_website + %a{ href: user.profile.website, target: "_blank", rel: "nofollow" }= user.profile.display_website - unless user.profile.location.blank? .profile__location %i.fa.fa-fw.fa-location-arrow = user.profile.location - = render 'user/actions', user: user, type: :follower + = render "user/actions", user: user, type: :follower From bf2c97184aadf54508e6a664c11866de8f564d30 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 31 Jul 2022 20:34:05 +0200 Subject: [PATCH 09/18] Add new translations for feedback pages --- app/views/feedback/consent.haml | 24 +++++++----------------- app/views/layouts/feedback.haml | 6 +++--- config/locales/views.en.yml | 20 ++++++++++++++++++++ 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/app/views/feedback/consent.haml b/app/views/feedback/consent.haml index e2a33871..94706697 100644 --- a/app/views/feedback/consent.haml +++ b/app/views/feedback/consent.haml @@ -1,26 +1,16 @@ - provide(:title, generate_title(t('.title'))) .text-center.mx-sm-5 - %h2 Notice + %h2= t(".heading") + + = t(".notice_html", app_name: APP_CONFIG["site_name"]) %p - = APP_CONFIG["site_name"] - uses Canny to collect feedback or bug reports on the following pages. + %a.text-muted{ href: "https://canny.io/privacy" }= t(".privacy") %p - Canny collects the username, user ID and email address for these purposes. - Unless you specifically consent to this, - = APP_CONFIG["site_name"] - will not send your data to Canny, but you can't use the feedback forms either. + = button_to t(".consent"), feedback_consent_update_path, class: "btn btn-primary", method: :post, params: { consent: true } + %p= t(".alternative") %p - %a.text-muted{ href: "https://canny.io/privacy" } Canny's Privacy Policy - - %p - = button_to "Consent and proceed", feedback_consent_update_path, class: "btn btn-primary", method: :post, params: { consent: true } - - %p - Alternatively, you can send us bug reports and feature requests directly on GitHub. - - %p - %a.btn.btn-outline-primary{ href: "https://github.com/Retrospring/retrospring/issues" } GitHub Issues + %a.btn.btn-outline-primary{ href: "https://github.com/Retrospring/retrospring/issues" }= t(".issues") diff --git a/app/views/layouts/feedback.haml b/app/views/layouts/feedback.haml index 6941130f..f264b929 100644 --- a/app/views/layouts/feedback.haml +++ b/app/views/layouts/feedback.haml @@ -1,13 +1,13 @@ .jumbotron.jumbotron--particles .jumbotron__particles#particles .jumbotron__content - %h1 Feedback + %h1= t(".heading") .container - unless params[:action] == "consent" .card .list-group.list-group-horizontal-sm.text-center - = list_group_item "Bugs", feedback_bugs_path - = list_group_item "Feature Requests", feedback_features_path + = list_group_item t(".tab.bugs"), feedback_bugs_path + = list_group_item t(".tab.features"), feedback_features_path .card .card-body = yield diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index e316160d..d80e76a3 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -163,6 +163,21 @@ en: feedback: consent: title: "Feedback" + heading: "Notice" + notice_html: | +

+ %{app_name} uses Canny to collect feedback or bug reports on the following pages. +

+

+ Canny collects the username, user ID and email address for these purposes. + Unless you specifically consent to this, + %{app_name} + will not send your data to Canny, but you can't use the feedback forms either. +

+ privacy: "Canny's Privacy Policy" + consent: "Consent and proceed" + alternative: "Alternatively, you can send us bug reports and feature requests directly on GitHub." + issues: "GitHub Issues" bugs: title: "Bugs – Feedback" features: @@ -198,6 +213,11 @@ en: heading: "Share" button: "Share on %{service}" layouts: + feedback: + heading: "Feedback" + tab: + bugs: "Bugs" + features: "Feature Requests" messages: noscript: "Please activate JavaScript." link_filter: From 77685d4229e5f65d43129507dd0b0bc3482196eb Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 31 Jul 2022 22:53:25 +0200 Subject: [PATCH 10/18] Add new translations for navigation --- app/views/navigation/_desktop.haml | 10 ++++---- app/views/navigation/_guest.haml | 6 ++--- app/views/navigation/_mobile.haml | 8 +++--- app/views/navigation/dropdown/_profile.haml | 27 +++++++++++---------- config/locales/views.en.yml | 21 ++++++++++++++++ config/locales/voc.en.yml | 1 + 6 files changed, 48 insertions(+), 25 deletions(-) diff --git a/app/views/navigation/_desktop.haml b/app/views/navigation/_desktop.haml index b49f8f38..9fdb0a0e 100644 --- a/app/views/navigation/_desktop.haml +++ b/app/views/navigation/_desktop.haml @@ -3,24 +3,24 @@ %a.navbar-brand{ href: '/' } = APP_CONFIG['site_name'] %ul.nav.navbar-nav.mr-auto - = nav_entry t('views.navigation.timeline'), root_path, icon: 'home' - = nav_entry t('views.navigation.inbox'), '/inbox', icon: 'inbox', badge: inbox_count + = nav_entry t("navigation.timeline"), root_path, icon: 'home' + = nav_entry t("navigation.inbox"), '/inbox', icon: 'inbox', badge: inbox_count - if APP_CONFIG.dig(:features, :discover, :enabled) || current_user.mod? - = nav_entry t('views.navigation.discover'), discover_path, icon: 'compass' + = nav_entry t("navigation.discover"), discover_path, icon: 'compass' %ul.nav.navbar-nav - if @user.present? && @user != current_user %li.nav-item.d-none.d-sm-block{ data: { toggle: 'tooltip', placement: 'bottom' }, title: t(".list") } %a.nav-link{ href: '#', data: { target: '#modal-list-memberships', toggle: :modal } } %i.fa.fa-list.hidden-xs %span.d-none.d-sm-inline.d-md-none= t(".list") - = nav_entry t('views.navigation.notifications'), notifications_path, badge: notification_count, class: 'd-block d-sm-none' + = nav_entry t("navigation.notifications"), notifications_path, badge: notification_count, class: 'd-block d-sm-none' %li.nav-item.dropdown.d-none.d-sm-block %a.nav-link.dropdown-toggle{ href: '#', data: { toggle: :dropdown } } - if notification_count.nil? %i.fa.fa-bell-o - else %i.fa.fa-bell - %span.sr-only= t('views.navigation.notifications') + %span.sr-only= t("navigation.notifications") %span.badge= notification_count = render 'navigation/dropdown/notifications', notifications: notifications, size: "desktop" %li.nav-item.d-none.d-sm-block{ data: { toggle: 'tooltip', placement: 'bottom' }, title: t('.ask_question') } diff --git a/app/views/navigation/_guest.haml b/app/views/navigation/_guest.haml index e174308c..d34f9455 100644 --- a/app/views/navigation/_guest.haml +++ b/app/views/navigation/_guest.haml @@ -2,9 +2,9 @@ .container{ class: ios_web_app? ? 'ios-web-app' : '' } %a.navbar-brand{ href: '/' }= APP_CONFIG['site_name'] %button.navbar-toggler{ data: { target: '#j2-main-navbar-collapse', toggle: :collapse }, type: :button } - %span.sr-only Toggle navigation + %span.sr-only= t("navigation.toggle") %span.navbar-toggler-icon .collapse.navbar-collapse#j2-main-navbar-collapse %ul.nav.navbar-nav.ml-auto - = nav_entry t('views.sessions.create'), new_user_session_path - = nav_entry t('views.sessions.new'), new_user_registration_path + = nav_entry t("voc.login"), new_user_session_path + = nav_entry t("voc.register"), new_user_registration_path diff --git a/app/views/navigation/_mobile.haml b/app/views/navigation/_mobile.haml index d8345c37..0cd8a89f 100644 --- a/app/views/navigation/_mobile.haml +++ b/app/views/navigation/_mobile.haml @@ -4,16 +4,16 @@ %nav.navbar.navbar-themed.bg-primary.fixed-bottom.d-lg-none.d-block.d-print-none#rs-mobile-nav{ role: :navigation } .container{ class: ios_web_app? ? 'ios-web-app' : '' } %ul.nav.navbar-nav.navbar-icon-row - = nav_entry t('views.navigation.timeline'), root_path, icon: 'home', icon_only: true - = nav_entry t('views.navigation.inbox'), '/inbox', + = nav_entry t("navigation.timeline"), root_path, icon: 'home', icon_only: true + = nav_entry t("navigation.inbox"), '/inbox', badge: inbox_count, badge_color: 'primary', badge_pill: true, icon: 'inbox', icon_only: true - if APP_CONFIG.dig(:features, :discover, :enabled) || current_user.mod? - = nav_entry t('views.navigation.discover'), discover_path, icon: 'compass', icon_only: true + = nav_entry t("navigation.discover"), discover_path, icon: 'compass', icon_only: true %li.nav-item %a.nav-link{ href: '#', data: { toggle: 'dropdown', target: '#rs-mobile-nav-notifications' }, aria: { controls: 'rs-mobile-nav-notifications', expanded: 'false' } } %i.fa{ class: "fa-#{notifications_icon}" } - %span.sr-only= t('views.navigation.notifications') + %span.sr-only= t("navigation.notifications") %span.badge.badge-pill.badge-primary= notification_count %li.nav-item.profile--image-dropdown %a.nav-link{ href: '#', data: { toggle: 'dropdown', target: '#rs-mobile-nav-profile' }, aria: { controls: 'rs-mobile-nav-profile', expanded: 'false' } } diff --git a/app/views/navigation/dropdown/_profile.haml b/app/views/navigation/dropdown/_profile.haml index 298608c1..20c52295 100644 --- a/app/views/navigation/dropdown/_profile.haml +++ b/app/views/navigation/dropdown/_profile.haml @@ -2,47 +2,48 @@ %h6.dropdown-header.d-none.d-sm-block= current_user.screen_name %a.dropdown-item{ href: user_path(current_user) } %i.fa.fa-fw.fa-user - = t("views.navigation.show") + = t(".profile") %a.dropdown-item{ href: edit_user_registration_path } %i.fa.fa-fw.fa-cog - = t("views.navigation.settings") + = t(".settings") .dropdown-divider - if current_user.has_role?(:administrator) %a.dropdown-item{ href: rails_admin_path } %i.fa.fa-fw.fa-cogs - = t("views.navigation.admin") + = t(".admin") %a.dropdown-item{ href: sidekiq_web_path } %i.fa.fa-fw.fa-bar-chart - = t("views.navigation.sidekiq") + = t(".sidekiq") %a.dropdown-item{ href: pghero_path } %i.fa.fa-fw.fa-database - Database Monitor + = t(".pghero") %a.dropdown-item{ href: announcement_index_path } %i.fa.fa-fw.fa-info - Announcements + = t(".announcements") .dropdown-divider - if current_user.mod? - if moderation_view? = link_to moderation_toggle_unmask_path, method: :post, class: "dropdown-item" do %i.fa.fa-toggle-on - Disable Moderation View + = t(".unmask.disable") - else = link_to moderation_toggle_unmask_path, method: :post, class: "dropdown-item" do %i.fa.fa-toggle-off - Enable Moderation View + = t(".unmask.enable") %a.dropdown-item{ href: moderation_path } %i.fa.fa-fw.fa-gavel - = t("views.navigation.moderation") + = t(".moderation") .dropdown-divider - if APP_CONFIG["canny"] - %h6.dropdown-header.d-none.d-sm-block Feedback + %h6.dropdown-header.d-none.d-sm-block + = t(".feedback.heading") %a.dropdown-item{ href: feedback_bugs_path } %i.fa.fa-fw.fa-bug - Bugs + = t(".feedback.bugs") %a.dropdown-item{ href: feedback_features_path } %i.fa.fa-fw.fa-flask - Feature Requests + = t(".feedback.features") .dropdown-divider = button_to destroy_user_session_path, method: "delete", class: "dropdown-item" do %i.fa.fa-fw.fa-sign-out - = t("views.sessions.destroy") + = t("voc.logout") diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index d80e76a3..2edb8c22 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -1,4 +1,5 @@ en: + language: "English (US)" about: index: subtitle: "Ask questions, give answers and learn more about your friends." @@ -279,11 +280,31 @@ en: until: "Until %{until}" expired: "Expired at %{until}" navigation: + toggle: "Toggle navigation" + timeline: "Timeline" + inbox: "Inbox" + discover: "Discover" + notifications: "Notifications" dropdown: notifications: none: :notifications.index.none all: "Show all notifications" new: "Show all new notifications" + profile: + profile: "Show profile" + settings: "Settings" + admin: "Rails Admin" + sidekiq: "Sidekiq" + pghero: "Database Monitor" + announcements: "Announcements" + unmask: + enable: "Enable Moderation View" + disable: "Disable Moderation View" + moderation: "Moderation Panel" + feedback: + heading: "Feedback" + bugs: "Bugs" + features: "Feature Requests" desktop: ask_question: "Ask a question" list: :user.actions.list diff --git a/config/locales/voc.en.yml b/config/locales/voc.en.yml index 3911aa4d..7e9a04ed 100644 --- a/config/locales/voc.en.yml +++ b/config/locales/voc.en.yml @@ -10,6 +10,7 @@ en: follow: "Follow" load: "Load more" login: "Sign in" + logout: "Logout" save: "Save changes" register: "Sign up" report: "Report" From 14221aea7164ed1d0b4a4d6e60c980a519807cbc Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 31 Jul 2022 22:55:03 +0200 Subject: [PATCH 11/18] Fix legacy locale references --- app/controllers/manifests_controller.rb | 2 +- app/views/application/_questionbox.haml | 2 +- app/views/question/_question.haml | 2 +- app/views/shared/_question.haml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/manifests_controller.rb b/app/controllers/manifests_controller.rb index c3fc2b44..c151076a 100644 --- a/app/controllers/manifests_controller.rb +++ b/app/controllers/manifests_controller.rb @@ -13,7 +13,7 @@ class ManifestsController < ApplicationController categories: %w[social], lang: I18n.locale, shortcuts: [ - webapp_shortcut(inbox_url, t("views.navigation.inbox"), "inbox") + webapp_shortcut(inbox_url, t("navigation.inbox"), "inbox") ], icons: webapp_icons, theme_color: theme_color, diff --git a/app/views/application/_questionbox.haml b/app/views/application/_questionbox.haml index 665b57da..066a4dcd 100644 --- a/app/views/application/_questionbox.haml +++ b/app/views/application/_questionbox.haml @@ -50,4 +50,4 @@ .col-xs-12.col-sm-10.offset-sm-1.text-center %small= t(".promote.join", app_title: APP_CONFIG["site_name"]) - else - %p= raw t(".required", signup: link_to(t("views.sessions.new"), new_user_registration_path)) + %p= raw t(".required", signup: link_to(t("voc.register"), new_user_registration_path)) diff --git a/app/views/question/_question.haml b/app/views/question/_question.haml index ccf20cc5..b1573adb 100644 --- a/app/views/question/_question.haml +++ b/app/views/question/_question.haml @@ -34,5 +34,5 @@ - if hidden = user_screen_name question.user, author_identifier: identifier, url: false - else - = raw t('views.answerbox.asked', user: user_screen_name(question.user, author_identifier: identifier), time: time_tooltip(question)) + = raw t("answerbox.header.asked", user: user_screen_name(question.user, author_identifier: identifier), time: time_tooltip(question)) .answerbox__question-text= question_markdown question.content diff --git a/app/views/shared/_question.haml b/app/views/shared/_question.haml index 110813de..24018b29 100644 --- a/app/views/shared/_question.haml +++ b/app/views/shared/_question.haml @@ -26,7 +26,7 @@ %i.fa.fa-gears = t("voc.view_in_rails_admin") %h6.media-heading.text-muted.answerbox__question-user - = raw t('views.answerbox.asked', user: user_screen_name(q.user), time: time_tooltip(q)) + = raw t('answerbox.header.asked', user: user_screen_name(q.user), time: time_tooltip(q)) - if q.answer_count > 1 · %a{ href: question_path(q.user.screen_name, q.id) } From 1ac4049007aa1c68ec15fbc748de67970604b86d Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 31 Jul 2022 22:55:16 +0200 Subject: [PATCH 12/18] Remove legacy locale file --- config/locales/en.yml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 config/locales/en.yml diff --git a/config/locales/en.yml b/config/locales/en.yml deleted file mode 100644 index b458723d..00000000 --- a/config/locales/en.yml +++ /dev/null @@ -1,21 +0,0 @@ -en: - language: 'English (US)' - views: - locale: - languages: "Languages" - actions: - list: "Manage list memberships" - sessions: - destroy: "Logout" - create: "Sign in" - new: "Sign up" - navigation: - timeline: "Timeline" - inbox: "Inbox" - discover: "Discover" - notifications: "Notifications" - show: "View profile" - settings: "Settings" - admin: "Kontrollzentrum" - sidekiq: "Sidekiq" - moderation: "Moderation Panel" From b4d380e57e3062d33fab443ce1983beccf0435e7 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 31 Jul 2022 23:20:13 +0200 Subject: [PATCH 13/18] Add missing badges --- config/locales/views.en.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index 2edb8c22..726efa51 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -580,10 +580,11 @@ en: title: "Actions" list: "Manage list memberships" profile: - admin: "Admin" - banned: "Banned" - follows_you: "Follows you" - moderator: "Moderator" + badge: + admin: "Admin" + banned: "Banned" + follows_you: "Follows you" + moderator: "Moderator" question: show: questionbox: From 1276a717c243d8a1b847771cbd1ba43b3bc4462b Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 2 Aug 2022 19:21:22 +0200 Subject: [PATCH 14/18] Update Crowdin configuration --- crowdin.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crowdin.yml b/crowdin.yml index 4cc48fc1..0f33bcb0 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1 +1,13 @@ -files: [] \ No newline at end of file +files: + - source: /config/locales/activerecord.en.yml + translation: /config/locales/activerecord.%two_letters_code%.yml + - source: /config/locales/controllers.en.yml + translation: /config/locales/controllers.%two_letters_code%.yml + - source: /config/locales/errors.en.yml + translation: /config/locales/errors.%two_letters_code%.yml + - source: /config/locales/frontend.en.yml + translation: /config/locales/frontend.%two_letters_code%.yml + - source: /config/locales/views.en.yml + translation: /config/locales/views.%two_letters_code%.yml + - source: /config/locales/voc.en.yml + translation: /config/locales/voc.%two_letters_code%.yml From f526dd86b04a844193c6d7b5b6f7fcbf31396179 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 2 Aug 2022 19:37:50 +0200 Subject: [PATCH 15/18] Add final newline to views.en.yml --- config/locales/views.en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index 726efa51..fe054d04 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -588,4 +588,4 @@ en: question: show: questionbox: - title: "This question was not in your inbox? Answer it here!" \ No newline at end of file + title: "This question was not in your inbox? Answer it here!" From 7a6c5cab3f4da1d4e926d7d76983de7f3a3d9b61 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 2 Aug 2022 22:31:16 +0200 Subject: [PATCH 16/18] Apply review suggestion from @raccube Co-authored-by: Karina Kwiatek <6197148+raccube@users.noreply.github.com> --- config/locales/views.en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index fe054d04..87b3362a 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -588,4 +588,4 @@ en: question: show: questionbox: - title: "This question was not in your inbox? Answer it here!" + title: "If this question did not appear in your inbox, you can answer it here." From 842d9faa3fb3b5062c5bfc5851f02d72a9826776 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Wed, 3 Aug 2022 11:56:05 +0200 Subject: [PATCH 17/18] Update config/locales/voc.en.yml Co-authored-by: Karina Kwiatek <6197148+raccube@users.noreply.github.com> --- config/locales/voc.en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/voc.en.yml b/config/locales/voc.en.yml index 7e9a04ed..3533a892 100644 --- a/config/locales/voc.en.yml +++ b/config/locales/voc.en.yml @@ -10,7 +10,7 @@ en: follow: "Follow" load: "Load more" login: "Sign in" - logout: "Logout" + logout: "Sign out" save: "Save changes" register: "Sign up" report: "Report" From 2a8711e7db555fe9f3d2e922623e92810ad80053 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Wed, 17 Aug 2022 22:18:37 +0200 Subject: [PATCH 18/18] Fix asked header in question and answerbox --- app/views/answerbox/_header.haml | 2 +- app/views/question/_question.haml | 2 +- app/views/shared/_question.haml | 2 +- config/locales/views.en.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/answerbox/_header.haml b/app/views/answerbox/_header.haml index 47cf5672..8b9277a1 100644 --- a/app/views/answerbox/_header.haml +++ b/app/views/answerbox/_header.haml @@ -25,7 +25,7 @@ %h6.text-muted.media-heading.answerbox__question-user - if a.question.author_is_anonymous %i.fa.fa-user-secret{ title: t(".anon_hint") } - = raw t(".asked", user: user_screen_name(a.question.user, context_user: a.user, author_identifier: a.question.author_is_anonymous ? a.question.author_identifier: nil), time: time_tooltip(a.question)) + = t(".asked_html", user: user_screen_name(a.question.user, context_user: a.user, author_identifier: a.question.author_is_anonymous ? a.question.author_identifier: nil), time: time_tooltip(a.question)) - if !a.question.author_is_anonymous && !a.question.direct · %a{ href: question_path(a.question.user.screen_name, a.question.id) } diff --git a/app/views/question/_question.haml b/app/views/question/_question.haml index b1573adb..10c834a6 100644 --- a/app/views/question/_question.haml +++ b/app/views/question/_question.haml @@ -34,5 +34,5 @@ - if hidden = user_screen_name question.user, author_identifier: identifier, url: false - else - = raw t("answerbox.header.asked", user: user_screen_name(question.user, author_identifier: identifier), time: time_tooltip(question)) + = t("answerbox.header.asked_html", user: user_screen_name(question.user, author_identifier: identifier), time: time_tooltip(question)) .answerbox__question-text= question_markdown question.content diff --git a/app/views/shared/_question.haml b/app/views/shared/_question.haml index 24018b29..c0e4db24 100644 --- a/app/views/shared/_question.haml +++ b/app/views/shared/_question.haml @@ -26,7 +26,7 @@ %i.fa.fa-gears = t("voc.view_in_rails_admin") %h6.media-heading.text-muted.answerbox__question-user - = raw t('answerbox.header.asked', user: user_screen_name(q.user), time: time_tooltip(q)) + = t("answerbox.header.asked_html", user: user_screen_name(q.user), time: time_tooltip(q)) - if q.answer_count > 1 · %a{ href: question_path(q.user.screen_name, q.id) } diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index 87b3362a..c99ba635 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -85,7 +85,7 @@ en: zero: "0 answers" one: "1 answer" other: "%{count} answers" - asked: "%{user} asked %{time} ago" + asked_html: "%{user} asked %{time} ago" actions: share: title: "Share"