From c108c3b4d9ac87c0d5a2c6b3327410ccccb41202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90inh=20Ho=C3=A0ng=20Vi=E1=BB=87t?= <134517889+M-DinhHoangViet@users.noreply.github.com> Date: Thu, 21 Dec 2023 15:40:10 +0700 Subject: [PATCH] More translations on the Blog page --- app/views/blog/bits.scala | 8 ++++---- app/views/blog/index.scala | 9 +++++---- app/views/blog/show.scala | 2 +- app/views/ublog/index.scala | 4 ++-- modules/i18n/src/main/I18nKeys.scala | 9 +++++++++ translation/source/ublog.xml | 9 +++++++++ 6 files changed, 30 insertions(+), 11 deletions(-) diff --git a/app/views/blog/bits.scala b/app/views/blog/bits.scala index ef1acea90d934..2696cb0da7c2a 100644 --- a/app/views/blog/bits.scala +++ b/app/views/blog/bits.scala @@ -15,16 +15,16 @@ object bits: ctx.kid.no option a( cls := active.has("community").option("active"), href := langHref(routes.Ublog.communityAll()) - )("Community blogs"), + )(trans.ublog.communityBlog()), ctx.kid.no option a(cls := active.has("topics").option("active"), href := routes.Ublog.topics)( - "Blog topics" + trans.ublog.blogTopic() ), (ctx.isAuth && ctx.kid.no) option a( cls := active.has("friends").option("active"), href := routes.Ublog.friends() - )("Friends blogs"), + )(trans.ublog.friendBlog()), ctx.kid.no option a(cls := active.has("liked").option("active"), href := routes.Ublog.liked())( - "Liked blog posts" + trans.ublog.likedBlog() ), ctx.me .ifTrue(ctx.kid.no) diff --git a/app/views/blog/index.scala b/app/views/blog/index.scala index 3c686acb248a0..2fac65ee1adc3 100644 --- a/app/views/blog/index.scala +++ b/app/views/blog/index.scala @@ -25,13 +25,13 @@ object index: bits.menu(none, "lichess".some), div(cls := "blog index page-menu__content page-small box force-ltr")( boxTop( - h1("Lichess Official Blog"), + h1(trans.ublog.lichessOfficialBlog()), views.html.site.bits.atomLink(routes.Blog.atom) ), primaryPost map { post => frag( latestPost(post), - h2("Previous blog posts") + h2(trans.ublog.previousBlogPosts()) ) }, div(cls := "blog-cards box__pad list infinite-scroll")( @@ -53,7 +53,7 @@ object index: main(cls := "page-menu")( bits.menu(year.some, none), div(cls := "page-menu__content box box-pad force-ltr")( - boxTop(h1(s"Lichess blog posts from $year")), + boxTop(h1(trans.ublog.lichessBlogPostsFromXYear(year))), st.section( div(cls := "blog-cards")(posts map { bits.postCard(_) }) ) @@ -85,7 +85,8 @@ object index: href := routes.Blog.show(doc.id, doc.slug, ref = prismic.maybeRef), dataIcon := licon.PlayTriangle )( - " Continue reading this post" + " ", + trans.ublog.continueReadingPost() ) ) ) diff --git a/app/views/blog/show.scala b/app/views/blog/show.scala index d0a8b5fe642bd..30c1034726532 100644 --- a/app/views/blog/show.scala +++ b/app/views/blog/show.scala @@ -54,7 +54,7 @@ object show: cls := "button text discuss", dataIcon := licon.BubbleConvo ): - "Discuss this blog post in the forum" + trans.ublog.discussThisBlogPostInTheForum() else p("This is a preview."), views.html.base.bits.connectLinks, p(cls := "patron-info")(a(href := routes.Plan.index)(trans.lichessPatronInfo())) diff --git a/app/views/ublog/index.scala b/app/views/ublog/index.scala index 8906f74435d09..b3a8c0da3c8a0 100644 --- a/app/views/ublog/index.scala +++ b/app/views/ublog/index.scala @@ -91,7 +91,7 @@ object index: views.html.blog.bits.menu(none, "community".some), div(cls := "page-menu__content box box-pad ublog-index")( boxTop( - h1("Community blogs"), + h1(trans.ublog.communityBlog()), div(cls := "box__top__actions")( views.html.base.bits.mselect( "ublog-lang", @@ -133,7 +133,7 @@ object index: main(cls := "page-menu")( views.html.blog.bits.menu(none, "topics".some), div(cls := "page-menu__content box")( - boxTop(h1("All blog topics")), + boxTop(h1(trans.ublog.allBlogTopic())), div(cls := "ublog-topics")( tops.map { case UblogTopic.WithPosts(topic, posts, nb) => a(cls := "ublog-topics__topic", href := routes.Ublog.topic(topic.url))( diff --git a/modules/i18n/src/main/I18nKeys.scala b/modules/i18n/src/main/I18nKeys.scala index a5872c5bb4158..7238b74808f2f 100644 --- a/modules/i18n/src/main/I18nKeys.scala +++ b/modules/i18n/src/main/I18nKeys.scala @@ -2410,6 +2410,15 @@ object I18nKeys: val `playedNbRunsOfPuzzleStorm` = I18nKey("storm:playedNbRunsOfPuzzleStorm") object ublog: + val `communityBlog` = I18nKey("ublog:communityBlog") + val `allBlogTopic` = I18nKey("ublog:allBlogTopic") + val `friendBlog` = I18nKey("ublog:friendBlog") + val `likedBlog` = I18nKey("ublog:likedBlog") + val `blogTopic` = I18nKey("ublog:blogTopic") + val `lichessOfficialBlog` = I18nKey("ublog:lichessOfficialBlog") + val `continueReadingPost` = I18nKey("ublog:continueReadingPost") + val `lichessBlogPostsFromXYear` = I18nKey("ublog:lichessBlogPostsFromXYear") + val `previousBlogPosts` = I18nKey("ublog:previousBlogPosts") val `xBlog` = I18nKey("ublog:xBlog") val `newPost` = I18nKey("ublog:newPost") val `editYourBlogPost` = I18nKey("ublog:editYourBlogPost") diff --git a/translation/source/ublog.xml b/translation/source/ublog.xml index 25b3e6460be17..881a587d7bdcc 100644 --- a/translation/source/ublog.xml +++ b/translation/source/ublog.xml @@ -1,5 +1,14 @@ + Community blogs + All blog topics + Friends blogs + Liked blog posts + Blog topics + Lichess Official Blog + Continue reading this post + Lichess blog posts in %s + Previous blog posts %s's Blog New post Edit your blog post