Skip to content

Commit

Permalink
localizer
Browse files Browse the repository at this point in the history
  • Loading branch information
dorthl committed Aug 7, 2023
1 parent ece95c1 commit 7421049
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 12 deletions.
12 changes: 12 additions & 0 deletions src/Blogifier.Shared/Resources/Resource.resx
Original file line number Diff line number Diff line change
Expand Up @@ -774,4 +774,16 @@
<data name="page-not-found-message" xml:space="preserve">
<value>The Page you are looking for doesn't exist, or error occurred.</value>
</data>
<data name="next-post" xml:space="preserve">
<value>Next Post</value>
</data>
<data name="previous-post" xml:space="preserve">
<value>Previous Post</value>
</data>
<data name="related-posts" xml:space="preserve">
<value>Related Posts</value>
</data>
<data name="view-all" xml:space="preserve">
<value>View All</value>
</data>
</root>
15 changes: 15 additions & 0 deletions src/Blogifier.Shared/Resources/Resource.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -489,4 +489,19 @@
<data name="users-settings" xml:space="preserve">
<value>用户设置</value>
</data>
<data name="read-more" xml:space="preserve">
<value>阅读更多</value>
</data>
<data name="next-post" xml:space="preserve">
<value>下一篇</value>
</data>
<data name="previous-post" xml:space="preserve">
<value>上一篇</value>
</data>
<data name="related-posts" xml:space="preserve">
<value>推荐博客</value>
</data>
<data name="view-all" xml:space="preserve">
<value>查看所有</value>
</data>
</root>
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@model PostPagerModel

@inject IStringLocalizer<Resource> _localizer

@{
var featured = Model.Pager.Items.Where(p => p.State == PostState.Featured).Take(3).ToList();
}
Expand Down Expand Up @@ -56,7 +58,7 @@
@item.Description
</p>
<a class="featured-more" href="~/post/@item.Slug">
Read More
@_localizer["read-more"]
<svg width="16" height="16" class="bi bi-arrow-right">
<use xlink:href="/_content/@ThemesStandardConstant.AssemblyName/img/icon-sprites.svg#bi-arrow-right"></use>
</svg>
Expand All @@ -69,11 +71,15 @@
</div>
<button class="carousel-control-prev featured-prev d-none d-xl-block" type="button" data-bs-target="#carouselFeatured" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
<span class="visually-hidden">
@_localizer["previous"]
</span>
</button>
<button class="carousel-control-next featured-next d-none d-xl-block" type="button" data-bs-target="#carouselFeatured" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
<span class="visually-hidden">
@_localizer["next"]
</span>
</button>
</div>
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
@if (Model.PostSlug.Older != null)
{
<div class="col">
<a class="post-nav-item text-start" href="~/post/@Model.PostSlug.Older.Slug" aria-label="@_localizer["Previous post"]">
<span class="post-nav-text">@_localizer["Previous post"]</span>
<a class="post-nav-item text-start" href="~/post/@Model.PostSlug.Older.Slug" aria-label="@_localizer["previous-post"]">
<span class="post-nav-text">@_localizer["previous-post"]</span>
<h4 class="post-nav-title">@Model.PostSlug.Older.Title</h4>
</a>
</div>
}
@if (Model.PostSlug.Newer != null)
{
<div class="col">
<a class="post-nav-item text-end" href="~/post/@Model.PostSlug.Newer.Slug" aria-label="@_localizer["Next post"]">
<span class="post-nav-text">@_localizer["Next post"]</span>
<a class="post-nav-item text-end" href="~/post/@Model.PostSlug.Newer.Slug" aria-label="@_localizer["next-post"]">
<span class="post-nav-text">@_localizer["next-post"]</span>
<h4 class="post-nav-title">@Model.PostSlug.Newer.Title</h4>
</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
{
<section class="related">
<header class="related-header">
<h3 class="related-header-title">Related Posts</h3>
<h3 class="related-header-title">
@_localizer["related-posts"]
</h3>
<a class="related-header-link ms-auto" href="~/">
View All
@_localizer["view-all"]
<svg width="22" height="22" class="bi bi-arrow-left">
<use xlink:href="/_content/@ThemesStandardConstant.AssemblyName/img/icon-sprites.svg#bi-arrow-left"></use>
</svg>
Expand All @@ -44,7 +46,9 @@
<h2 class="post-grid-title">
<a class="post-grid-link" href="~/post/@post.Slug">@post.Title</a>
</h2>
<p class="post-grid-desc">@Html.Raw(post.DescriptionHtml)</p>
<p class="post-grid-desc">
@Html.Raw(post.Description)
</p>
<div class="post-grid-meta d-flex">
<div class="post-grid-author">
<img class="post-grid-author-img" src="@UserHelper.CheckGetAvatarUrl(post.User.Avatar)" width="16" height="16" alt="@post.User.NickName" aria-hidden="true">
Expand All @@ -57,7 +61,9 @@
<time class="post-grid-date-time">@DateTimeHelper.ToFriendlyShortDateString(post.PublishedAt)</time>
</div>
<a class="post-grid-more ms-auto" href="~/post/@post.Slug" tabindex="-1">
<span>Read</span>
<span>
@_localizer["read"]
</span>
<svg width="16" height="16" class="bi bi-arrow-right-short">
<use xlink:href="/_content/@ThemesStandardConstant.AssemblyName/img/icon-sprites.svg#bi-arrow-right-short"></use>
</svg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
<time class="post-grid-date-time">@DateTimeHelper.ToFriendlyShortDateString(post.PublishedAt)</time>
</div>
<a class="post-grid-more ms-auto" href="~/post/@post.Slug" tabindex="-1">
<span>Read</span>
<span>
@_localizer["read"]
</span>
<svg width="16" height="16" class="bi bi-arrow-right-short">
<use xlink:href="/_content/@ThemesStandardConstant.AssemblyName/img/icon-sprites.svg#bi-arrow-right-short"></use>
</svg>
Expand Down

0 comments on commit 7421049

Please sign in to comment.