From acbda16b8a79294a81ce1827017de1055ddcd97b Mon Sep 17 00:00:00 2001 From: Bervianto Leo Pratama Date: Fri, 8 Oct 2021 18:55:21 +0700 Subject: [PATCH] Translate some texts from Dashboard Page (#14963) * Extract some text from dashboard * Fix template code Signed-off-by: Bervianto Leo Pratama * Update translation for upload_a_video * Fix wrong link * Fix missing keys * Seperate plural posts & followers --- app/views/dashboards/_actions.html.erb | 12 ++++++------ app/views/dashboards/_actions_mobile.html.erb | 10 +++++----- app/views/dashboards/followers.html.erb | 6 ++++-- app/views/dashboards/show.html.erb | 10 ++++++---- config/locales/en.yml | 10 ++++++++++ config/locales/fr.yml | 10 ++++++++++ 6 files changed, 41 insertions(+), 17 deletions(-) diff --git a/app/views/dashboards/_actions.html.erb b/app/views/dashboards/_actions.html.erb index b2f2f16ec..f9a507a6c 100644 --- a/app/views/dashboards/_actions.html.erb +++ b/app/views/dashboards/_actions.html.erb @@ -4,7 +4,7 @@ " href="<%= dashboard_path %>" <%= params[:action] == "show" && (params[:which] == "organization" || params[:which].blank?) ? ' aria-current="page"'.html_safe : "" %>> - Posts + <%= t("core.posts") %> <%= @user.articles_count %> @@ -13,7 +13,7 @@ " href="<%= user_series_path(current_user.username) %>" <%= params[:action] == "series" && (params[:which] == "organization" || params[:which].blank?) ? ' aria-current="page"'.html_safe : "" %>> - Series + <%= t("core.series") %> <%= @user.collections.count %> @@ -22,7 +22,7 @@ " href="/dashboard/user_followers" <%= params[:action] == "followers" ? ' aria-current="page"'.html_safe : "" %>> - Followers + <%= t("core.followers") %> <%= @user.followers_count %> @@ -65,14 +65,14 @@
  • - Listings + <%= t("core.listings") %> <%= inline_svg_tag("external-link.svg", aria_hidden: true, class: "crayons-icon") %>
  • - Analytics + <%= t("core.analytics") %>
  • @@ -86,7 +86,7 @@ <% if policy(:video).new? && policy(:video).enabled? %>
  • - Upload a video + <%= t("dashboard.upload_a_video") %>
  • <% end %> diff --git a/app/views/dashboards/_actions_mobile.html.erb b/app/views/dashboards/_actions_mobile.html.erb index a3509179b..f1eebe54c 100644 --- a/app/views/dashboards/_actions_mobile.html.erb +++ b/app/views/dashboards/_actions_mobile.html.erb @@ -1,15 +1,15 @@
    diff --git a/app/views/dashboards/followers.html.erb b/app/views/dashboards/followers.html.erb index a4a191857..b2d3d02d3 100644 --- a/app/views/dashboards/followers.html.erb +++ b/app/views/dashboards/followers.html.erb @@ -3,9 +3,11 @@
    +
    +

    » /h1>
    -

    Dashboard » Followers

    +

    <%= t("core.dashboard") %> » <%= t("core.followers") %><

    <%= render "actions_mobile" %>
    @@ -42,7 +44,7 @@ <% end %>

    <% else %> -
    You don't have any followers yet...
    +
    <%= t("dashboard.empty_follower") %>
    <% end %> <%= render "sublist" %> diff --git a/app/views/dashboards/show.html.erb b/app/views/dashboards/show.html.erb index a5544c845..0c6288583 100644 --- a/app/views/dashboards/show.html.erb +++ b/app/views/dashboards/show.html.erb @@ -1,7 +1,9 @@ <% title "Dashboard" %> +
    +

    -

    Dashboard

    +

    <%= t("core.dashboard") %>

    <%= render "actions_mobile" %> <%= render "analytics" %>
    @@ -13,7 +15,7 @@
    - +
    <% if params[:which] != "organization" %> @@ -59,8 +61,8 @@ <% image_url = Images::Optimizer.call(Settings::General.mascot_image_url, width: 300, crop: "imagga_scale") %> <%= image_tag(image_url, class: "sloan mb-7", alt: "Mascot image") %> <% end %> -

    This is where you can manage your posts, but you haven't written anything yet.

    -

    Write your first post now

    +

    <%= t("dashboard.empty_post") %>

    +

    <%= t("dashboard.write_new_post") %>

    <% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 4c0524b2b..dc6c7abf3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3,16 +3,20 @@ en: core: add_comment: Add comment all: All + analytics: Analytics comment: Comment copy_link: Copy link community_name_is_great: "%{community_name} is great!" create_account: Create account create_post: Create Post + dashboard: Dashboard discussion: Discussion edit_profile: Edit profile feed: Feed follow: Follow follow_back: Follow back + follower: Follower + followers: Followers following: Following following_tags: "Following tags" full: Full @@ -27,6 +31,7 @@ en: my_tags: My Tags popular_tags: Popular Tags post: Post + posts: Posts reaction: Reaction reactions: heart: Heart @@ -37,6 +42,7 @@ en: report_abuse: Report abuse search: Search see_all: See all + series: Series share_to: Share to %{media} tags: "Tags" tags_to_follow: "Tags to follow on %{community_name}" @@ -50,10 +56,14 @@ en: if_we_can_help_html: Contact us if there is anything we can help with. if_any_questions_html: Contact us if you have any questions. dashboard: + empty_follower: You don't have any followers yet... + empty_post: This is where you can manage your posts, but you haven't written anything yet. following_users: Following users loading: loading... not_following_any_users: You don't follow any users... page_title: Dashboard + upload_a_video: Upload a video + write_new_post: Write your first post now errors: messages: accepted: must be accepted diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 2ba83a9ab..f75555ec6 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -3,16 +3,20 @@ fr: core: add_comment: Ajouter un commentaire all: Tout + analytics: Analytique comment: Commentaire community_name_is_great: "%{community_name} est super" copy_link: Copier le lien create_account: Créer un profil create_post: Créer une publication + dashboard: Tableau de bord discussion: Discussion edit_profile: Editer le profil feed: Fil follow: Suivre follow_back: Suivre aussi + follower: Suiveur + followers: Suiveurs following: Abonné following_tags: Sujets suivis full: Complet @@ -27,6 +31,7 @@ fr: my_tags: Mes sujets popular_tags: Sujets populaires post: Publication + posts: Publications reaction: Réaction reactions: heart: Coeur @@ -37,6 +42,7 @@ fr: report_abuse: Signaler un abus search: Recherche see_all: Tout voir + series: Séries share_to: Partager sur %{media} tags: Sujets tags_to_follow: Sujets dans %{community_name} @@ -50,10 +56,14 @@ fr: if_we_can_help_html: Contactez-nous si nous pouvons vous aider. if_any_questions_html: Contactez-nous si vous avez des questions. dashboard: + empty_follower: Vous n'avez pas encore d'abonnés... + empty_post: C'est ici que vous pouvez gérer vos messages, mais vous n'avez encore rien écrit following_users: Utilisateurs suivis loading: Chargement en cours... not_following_any_users: Vous ne suivez aucun utilisateur... page_title: Tableau de bord + upload_a_video: Charger une vidéo + write_new_post: Écrivez votre premier message maintenant date: abbr_month_names: -