From 2d63a807611da25cf2a3404db7b23a689633aae9 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Fri, 18 Feb 2022 23:36:24 +0100 Subject: [PATCH] Add translations for the data view --- app/views/settings/_data.haml | 72 +++++++++++++++++------------------ config/locales/views.en.yml | 29 ++++++++++++++ 2 files changed, 65 insertions(+), 36 deletions(-) diff --git a/app/views/settings/_data.haml b/app/views/settings/_data.haml index 0ede0262..afec6d03 100644 --- a/app/views/settings/_data.haml +++ b/app/views/settings/_data.haml @@ -1,73 +1,73 @@ .card .card-body - %h2 Your Profile Data - %p Everything we have about you! Really, not that much as you might expect. + %h2= t(".heading") + %p= t(".body") - %h3 General + %h3= t(".section.general") .row .col-md-6.col-sm-6.col-xs-12 - %h4 Profile + %h4= t(".section.profile") - %p.font-weight-bold.mb-0 User name + %p.font-weight-bold.mb-0= t("activerecord.attributes.user.screen_name") %p.text-muted= current_user.screen_name - %p.font-weight-bold.mb-0 Display name + %p.font-weight-bold.mb-0= t("activerecord.attributes.profile.display_name") %p.text-muted - if current_user.profile.display_name.blank? None set! - else = current_user.profile.display_name - %p.font-weight-bold.mb-0 Bio + %p.font-weight-bold.mb-0= t("activerecord.attributes.profile.description") %p.text-muted - if current_user.profile.description.blank? None set! - else = current_user.profile.description - %p.font-weight-bold.mb-0 Location + %p.font-weight-bold.mb-0= t("activerecord.attributes.profile.location") %p.text-muted - if current_user.profile.location.blank? None set! - else = current_user.profile.location - %p.font-weight-bold.mb-0 Website + %p.font-weight-bold.mb-0= t("activerecord.attributes.profile.website") %p.text-muted - if current_user.profile.website.blank? None set! - else = current_user.profile.website .col-md-6.col-sm-6.col-xs-12 - %h4 Pictures - %p.font-weight-bold.mb-0 Profile picture + %h4= t(".section.pictures") + %p.font-weight-bold.mb-0= t(".pictures.profile_picture.heading") .media .pull-left %img.profile--img{ src: current_user.profile_picture.url(:medium) } .media-body %ul %li - %a{ href: current_user.profile_picture.url(:small) } Small + %a{ href: current_user.profile_picture.url(:small) }= t(".pictures.profile_picture.size.small") %li - %a{ href: current_user.profile_picture.url(:medium) } Medium + %a{ href: current_user.profile_picture.url(:medium) }= t(".pictures.profile_picture.size.medium") %li - %a{ href: current_user.profile_picture.url(:large) } Large + %a{ href: current_user.profile_picture.url(:large) }= t(".pictures.profile_picture.size.large") %li - %a{ href: current_user.profile_picture.url(:original) } Original image + %a{ href: current_user.profile_picture.url(:original) }= t(".pictures.profile_picture.size.original") - %p.font-weight-bold.mb-0 Header picture + %p.font-weight-bold.mb-0= t(".pictures.profile_header.heading") %img{ src: current_user.profile_header.url(:mobile), style: 'width: 100%' } %p - %a{ href: current_user.profile_header.url(:mobile) } Mobile + %a{ href: current_user.profile_header.url(:mobile) }= t(".pictures.profile_header.size.mobile") | - %a{ href: current_user.profile_header.url(:web) } Web + %a{ href: current_user.profile_header.url(:web) }= t(".pictures.profile_header.size.web") | - %a{ href: current_user.profile_header.url(:retina) } Retina + %a{ href: current_user.profile_header.url(:retina) }= t(".pictures.profile_header.size.retina") | - %a{ href: current_user.profile_header.url(:original) } Original image + %a{ href: current_user.profile_header.url(:original) }= t(".pictures.profile_header.size.original") .row .col-md-6.col-sm-6.col-xs-12 - %h4 Statistics + %h4= t(".section.statistics") %p.font-weight-bold.mb-0 Answers %p.text-muted= current_user.answered_count @@ -87,7 +87,7 @@ %p.font-weight-bold.mb-0 Comments %p.text-muted= current_user.commented_count .col-md-6.col-sm-6.col-xs-12 - %h4 Badges + %h4= t(".section.badges") %p.font-weight-bold.mb-0 Admin %p @@ -108,41 +108,41 @@ %i.fa.fa-fw.fa-close .row .col-md-6.col-sm-6.col-xs-12 - %h3 IP - %p.font-weight-bold.mb-0 Current Sign In + %h3= t(".section.ip") + %p.font-weight-bold.mb-0= t("activerecord.attributes.user.current_sign_in_ip") %p.text-muted= current_user.current_sign_in_ip - %p.font-weight-bold.mb-0 Last Sign In + %p.font-weight-bold.mb-0= t("activerecord.attributes.user.last_sign_in_ip") %p.text-muted= current_user.last_sign_in_ip .col-md-6.col-sm-6.col-xs-12 - %h3 Miscellaneous + %h3= t(".section.miscellaneous") - %p.font-weight-bold.mb-0 Locale + %p.font-weight-bold.mb-0= t("activerecord.attributes.user.locale") %p.text-muted - if current_user.locale.blank? None set! - else = current_user.locale - %p.font-weight-bold.mb-0 Sign In count + %p.font-weight-bold.mb-0= t("activerecord.attributes.user.sign_in_count") %p.text-muted= current_user.sign_in_count - %h3 Dates + %h3= t(".section.dates") .row .col-md-6.col-sm-6.col-xs-12 - %h4 Sign In + %h4= t(".section.sign_in") - %p.font-weight-bold.mb-0 Current Sign In + %p.font-weight-bold.mb-0= t("activerecord.attributes.user.current_sign_in_at") %p.text-muted= current_user.current_sign_in_at ? localize(current_user.current_sign_in_at) : 'Not set' - %p.font-weight-bold.mb-0 Last Sign In + %p.font-weight-bold.mb-0= t("activerecord.attributes.user.last_sign_in_at") %p.text-muted= current_user.last_sign_in_at ? localize(current_user.last_sign_in_at) : 'Not set' - %p.font-weight-bold.mb-0 Remember me set at + %p.font-weight-bold.mb-0= t("activerecord.attributes.user.remember_created_at") %p.text-muted= current_user.remember_created_at ? localize(current_user.remember_created_at) : 'Not set' .col-md-6.col-sm-6.col-xs-12 - %h4 Create/Update + %h4= t(".section.create_update") - %p.font-weight-bold.mb-0 Account created + %p.font-weight-bold.mb-0= t("activerecord.attributes.user.created_at") %p.text-muted - if current_user.created_at = localize(current_user.created_at) @@ -150,7 +150,7 @@ - else Not set - %p.font-weight-bold.mb-0 Account last updated + %p.font-weight-bold.mb-0= t("activerecord.attributes.user.updated at") %p.text-muted - if current_user.created_at = localize(current_user.updated_at) diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index ec5d32bb..5fb54440 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -43,6 +43,33 @@ en: delete: action: "Delete my account" heading: "Unsatisfied?" + data: + heading: "Your Profile Data" + body: "Everything we have about you! Really, not that much as you might expect." + section: + general: "General" + profile: "Profile" + pictures: "Pictures" + ip: "IP" + miscellaneous: "Miscellaneous" + dates: "Dates" + sign_in: "Sign In" + create_update: "Create/Update" + pictures: + profile_picture: + heading: "Profile picture" + size: + small: "Small" + medium: "Medium" + large: "Large" + original: "Original image" + profile_header: + heading: "Profile header" + size: + mobile: "Mobile" + web: "Web" + retina: "Retina" + original: "Original image" export: heading: "Export your data" body_html: | @@ -147,6 +174,8 @@ en: accent: example: "Some text on top of a accented area on a raised element!" user: + data: + title: "Your Data" edit: title: "Profile Settings" edit_mute: