Add new translations for navigation

This commit is contained in:
Andreas Nedbal 2022-07-31 22:53:25 +02:00
parent bf2c97184a
commit 77685d4229
6 changed files with 48 additions and 25 deletions

View File

@ -3,24 +3,24 @@
%a.navbar-brand{ href: '/' } %a.navbar-brand{ href: '/' }
= APP_CONFIG['site_name'] = APP_CONFIG['site_name']
%ul.nav.navbar-nav.mr-auto %ul.nav.navbar-nav.mr-auto
= nav_entry t('views.navigation.timeline'), root_path, icon: 'home' = nav_entry t("navigation.timeline"), root_path, icon: 'home'
= nav_entry t('views.navigation.inbox'), '/inbox', icon: 'inbox', badge: inbox_count = nav_entry t("navigation.inbox"), '/inbox', icon: 'inbox', badge: inbox_count
- if APP_CONFIG.dig(:features, :discover, :enabled) || current_user.mod? - 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 %ul.nav.navbar-nav
- if @user.present? && @user != current_user - if @user.present? && @user != current_user
%li.nav-item.d-none.d-sm-block{ data: { toggle: 'tooltip', placement: 'bottom' }, title: t(".list") } %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 } } %a.nav-link{ href: '#', data: { target: '#modal-list-memberships', toggle: :modal } }
%i.fa.fa-list.hidden-xs %i.fa.fa-list.hidden-xs
%span.d-none.d-sm-inline.d-md-none= t(".list") %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 %li.nav-item.dropdown.d-none.d-sm-block
%a.nav-link.dropdown-toggle{ href: '#', data: { toggle: :dropdown } } %a.nav-link.dropdown-toggle{ href: '#', data: { toggle: :dropdown } }
- if notification_count.nil? - if notification_count.nil?
%i.fa.fa-bell-o %i.fa.fa-bell-o
- else - else
%i.fa.fa-bell %i.fa.fa-bell
%span.sr-only= t('views.navigation.notifications') %span.sr-only= t("navigation.notifications")
%span.badge= notification_count %span.badge= notification_count
= render 'navigation/dropdown/notifications', notifications: notifications, size: "desktop" = 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') } %li.nav-item.d-none.d-sm-block{ data: { toggle: 'tooltip', placement: 'bottom' }, title: t('.ask_question') }

View File

@ -2,9 +2,9 @@
.container{ class: ios_web_app? ? 'ios-web-app' : '' } .container{ class: ios_web_app? ? 'ios-web-app' : '' }
%a.navbar-brand{ href: '/' }= APP_CONFIG['site_name'] %a.navbar-brand{ href: '/' }= APP_CONFIG['site_name']
%button.navbar-toggler{ data: { target: '#j2-main-navbar-collapse', toggle: :collapse }, type: :button } %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 %span.navbar-toggler-icon
.collapse.navbar-collapse#j2-main-navbar-collapse .collapse.navbar-collapse#j2-main-navbar-collapse
%ul.nav.navbar-nav.ml-auto %ul.nav.navbar-nav.ml-auto
= nav_entry t('views.sessions.create'), new_user_session_path = nav_entry t("voc.login"), new_user_session_path
= nav_entry t('views.sessions.new'), new_user_registration_path = nav_entry t("voc.register"), new_user_registration_path

View File

@ -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 } %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' : '' } .container{ class: ios_web_app? ? 'ios-web-app' : '' }
%ul.nav.navbar-nav.navbar-icon-row %ul.nav.navbar-nav.navbar-icon-row
= nav_entry t('views.navigation.timeline'), root_path, icon: 'home', icon_only: true = nav_entry t("navigation.timeline"), root_path, icon: 'home', icon_only: true
= nav_entry t('views.navigation.inbox'), '/inbox', = nav_entry t("navigation.inbox"), '/inbox',
badge: inbox_count, badge_color: 'primary', badge_pill: true, badge: inbox_count, badge_color: 'primary', badge_pill: true,
icon: 'inbox', icon_only: true icon: 'inbox', icon_only: true
- if APP_CONFIG.dig(:features, :discover, :enabled) || current_user.mod? - 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 %li.nav-item
%a.nav-link{ href: '#', data: { toggle: 'dropdown', target: '#rs-mobile-nav-notifications' }, aria: { controls: 'rs-mobile-nav-notifications', expanded: 'false' } } %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}" } %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 %span.badge.badge-pill.badge-primary= notification_count
%li.nav-item.profile--image-dropdown %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' } } %a.nav-link{ href: '#', data: { toggle: 'dropdown', target: '#rs-mobile-nav-profile' }, aria: { controls: 'rs-mobile-nav-profile', expanded: 'false' } }

View File

@ -2,47 +2,48 @@
%h6.dropdown-header.d-none.d-sm-block= current_user.screen_name %h6.dropdown-header.d-none.d-sm-block= current_user.screen_name
%a.dropdown-item{ href: user_path(current_user) } %a.dropdown-item{ href: user_path(current_user) }
%i.fa.fa-fw.fa-user %i.fa.fa-fw.fa-user
= t("views.navigation.show") = t(".profile")
%a.dropdown-item{ href: edit_user_registration_path } %a.dropdown-item{ href: edit_user_registration_path }
%i.fa.fa-fw.fa-cog %i.fa.fa-fw.fa-cog
= t("views.navigation.settings") = t(".settings")
.dropdown-divider .dropdown-divider
- if current_user.has_role?(:administrator) - if current_user.has_role?(:administrator)
%a.dropdown-item{ href: rails_admin_path } %a.dropdown-item{ href: rails_admin_path }
%i.fa.fa-fw.fa-cogs %i.fa.fa-fw.fa-cogs
= t("views.navigation.admin") = t(".admin")
%a.dropdown-item{ href: sidekiq_web_path } %a.dropdown-item{ href: sidekiq_web_path }
%i.fa.fa-fw.fa-bar-chart %i.fa.fa-fw.fa-bar-chart
= t("views.navigation.sidekiq") = t(".sidekiq")
%a.dropdown-item{ href: pghero_path } %a.dropdown-item{ href: pghero_path }
%i.fa.fa-fw.fa-database %i.fa.fa-fw.fa-database
Database Monitor = t(".pghero")
%a.dropdown-item{ href: announcement_index_path } %a.dropdown-item{ href: announcement_index_path }
%i.fa.fa-fw.fa-info %i.fa.fa-fw.fa-info
Announcements = t(".announcements")
.dropdown-divider .dropdown-divider
- if current_user.mod? - if current_user.mod?
- if moderation_view? - if moderation_view?
= link_to moderation_toggle_unmask_path, method: :post, class: "dropdown-item" do = link_to moderation_toggle_unmask_path, method: :post, class: "dropdown-item" do
%i.fa.fa-toggle-on %i.fa.fa-toggle-on
Disable Moderation View = t(".unmask.disable")
- else - else
= link_to moderation_toggle_unmask_path, method: :post, class: "dropdown-item" do = link_to moderation_toggle_unmask_path, method: :post, class: "dropdown-item" do
%i.fa.fa-toggle-off %i.fa.fa-toggle-off
Enable Moderation View = t(".unmask.enable")
%a.dropdown-item{ href: moderation_path } %a.dropdown-item{ href: moderation_path }
%i.fa.fa-fw.fa-gavel %i.fa.fa-fw.fa-gavel
= t("views.navigation.moderation") = t(".moderation")
.dropdown-divider .dropdown-divider
- if APP_CONFIG["canny"] - 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 } %a.dropdown-item{ href: feedback_bugs_path }
%i.fa.fa-fw.fa-bug %i.fa.fa-fw.fa-bug
Bugs = t(".feedback.bugs")
%a.dropdown-item{ href: feedback_features_path } %a.dropdown-item{ href: feedback_features_path }
%i.fa.fa-fw.fa-flask %i.fa.fa-fw.fa-flask
Feature Requests = t(".feedback.features")
.dropdown-divider .dropdown-divider
= button_to destroy_user_session_path, method: "delete", class: "dropdown-item" do = button_to destroy_user_session_path, method: "delete", class: "dropdown-item" do
%i.fa.fa-fw.fa-sign-out %i.fa.fa-fw.fa-sign-out
= t("views.sessions.destroy") = t("voc.logout")

View File

@ -1,4 +1,5 @@
en: en:
language: "English (US)"
about: about:
index: index:
subtitle: "Ask questions, give answers and learn more about your friends." subtitle: "Ask questions, give answers and learn more about your friends."
@ -279,11 +280,31 @@ en:
until: "Until %{until}" until: "Until %{until}"
expired: "Expired at %{until}" expired: "Expired at %{until}"
navigation: navigation:
toggle: "Toggle navigation"
timeline: "Timeline"
inbox: "Inbox"
discover: "Discover"
notifications: "Notifications"
dropdown: dropdown:
notifications: notifications:
none: :notifications.index.none none: :notifications.index.none
all: "Show all notifications" all: "Show all notifications"
new: "Show all new 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: desktop:
ask_question: "Ask a question" ask_question: "Ask a question"
list: :user.actions.list list: :user.actions.list

View File

@ -10,6 +10,7 @@ en:
follow: "Follow" follow: "Follow"
load: "Load more" load: "Load more"
login: "Sign in" login: "Sign in"
logout: "Logout"
save: "Save changes" save: "Save changes"
register: "Sign up" register: "Sign up"
report: "Report" report: "Report"