Skip to content

Commit

Permalink
More translations on the Blog page
Browse files Browse the repository at this point in the history
  • Loading branch information
M-DinhHoangViet authored Dec 21, 2023
1 parent f80a888 commit c108c3b
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 11 deletions.
8 changes: 4 additions & 4 deletions app/views/blog/bits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 5 additions & 4 deletions app/views/blog/index.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")(
Expand All @@ -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(_) })
)
Expand Down Expand Up @@ -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()
)
)
)
2 changes: 1 addition & 1 deletion app/views/blog/show.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down
4 changes: 2 additions & 2 deletions app/views/ublog/index.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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))(
Expand Down
9 changes: 9 additions & 0 deletions modules/i18n/src/main/I18nKeys.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
9 changes: 9 additions & 0 deletions translation/source/ublog.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="communityBlog">Community blogs</string>
<string name="allBlogTopic">All blog topics</string>
<string name="friendBlog">Friends blogs</string>
<string name="likedBlog">Liked blog posts</string>
<string name="blogTopic">Blog topics</string>
<string name="lichessOfficialBlog">Lichess Official Blog</string>
<string name="continueReadingPost">Continue reading this post</string>
<string name="lichessBlogPostsFromXYear">Lichess blog posts in %s</string>
<string name="previousBlogPosts">Previous blog posts</string>
<string name="xBlog">%s's Blog</string>
<string name="newPost">New post</string>
<string name="editYourBlogPost">Edit your blog post</string>
Expand Down

0 comments on commit c108c3b

Please sign in to comment.