Quellcode durchsuchen

Fixed localization of post cards (#821)

* Fixed date localization on post card

* fixed also labeling localization for post card

* adressed change request by using the hugo feature of singular/plural automagic for translation

* Fix reading time translation

Signed-off-by: hossainemruz <hossainemruz@gmail.com>

---------

Signed-off-by: hossainemruz <hossainemruz@gmail.com>
Co-authored-by: hossainemruz <hossainemruz@gmail.com>
Augusto Pace vor 1 Jahr
Ursprung
Commit
e61d6b796b
5 geänderte Dateien mit 23 neuen und 12 gelöschten Zeilen
  1. 3 0
      i18n/bn.toml
  2. 4 0
      i18n/en.toml
  3. 11 7
      i18n/it.toml
  4. 1 1
      layouts/_default/single.html
  5. 4 4
      layouts/partials/cards/post.html

+ 3 - 0
i18n/bn.toml

@@ -121,3 +121,6 @@ other = "দায় বিজ্ঞপ্তি"
 
 [search]
 other = "অনুসন্ধান করুন"
+
+[minute]
+other = "মিনিট"

+ 4 - 0
i18n/en.toml

@@ -124,3 +124,7 @@ other = "Liability Notice"
 
 [search]
 other = "Search"
+
+[minute]
+one = "minute"
+other = "minutes"

+ 11 - 7
i18n/it.toml

@@ -3,7 +3,7 @@
 other = "Home"
 
 [posts]
-other = "Post"
+other = "Articoli"
 
 [toc_heading]
 other = "Contenuti"
@@ -92,20 +92,20 @@ other = "Responsabilità:"
 [present]
 other = "Ad oggi"
 
-# [comments_javascript]
-# other = "Please enable JavaScript to view the"
+[comments_javascript]
+other = "Per favore attiva JavaScript per vedere il"
 
 # [comments_by]
 # other = "comments powered by"
 
-# [read]
-# other = "Read"
+[read]
+other = "Leggi"
 
 # [project_star]
 # other = "Star"
 
-# [project_details]
-# other = "Details"
+[project_details]
+other = "Dettagli"
 
 # [err_404]
 # other = "The page you are looking for is not there yet."
@@ -124,3 +124,7 @@ other = "Avviso di responsabilità"
 
 [search]
 other = "Ricerca"
+
+[minute]
+one = "minuto"
+other = "minuti"

+ 1 - 1
layouts/_default/single.html

@@ -39,7 +39,7 @@
         <div class="author-profile ml-auto align-self-lg-center">
           <img class="rounded-circle" src='{{ partial "helpers/get-author-image.html" . }}' alt="Author Image">
           <h5 class="author-name">{{ partial "helpers/get-author-name.html" . }}</h5>
-          <p class="text-muted">{{ .Page.Date | time.Format ":date_full" }}{{ if site.Params.features.readingTime }} | {{ .ReadingTime }} minute{{ if (ne .ReadingTime 1) }}s{{ end }}{{ end }}</p>
+          <p class="text-muted">{{ .Page.Date | time.Format ":date_full" }}{{ if site.Params.features.readingTime }} | {{ .ReadingTime }} {{i18n "minute" .ReadingTime }}{{ end }}</p>
         </div>
 
         <div class="title">

+ 4 - 4
layouts/partials/cards/post.html

@@ -12,12 +12,12 @@
         {{ end }}
       </div>
       <div class="card-footer">
-        <span class="float-left">{{ .Date.Format "January 2, 2006" }}{{ if site.Params.features.readingTime }} | {{ .ReadingTime }} minute{{ if (ne .ReadingTime 1) }}s{{ end }}{{ end }}</span>
+        <span class="float-left">
+            {{ .Date | time.Format ":date_full" }}
+            {{ if site.Params.features.readingTime }} | {{.ReadingTime}} {{ i18n "minute" .ReadingTime }} {{ end }}</span>
         <a
         href="{{ .RelPermalink | relLangURL }}"
-        class="float-right btn btn-outline-info btn-sm"
-        >{{ i18n "read" }}</a
-        >
+        class="float-right btn btn-outline-info btn-sm">{{ i18n "read" }}</a>
       </div>
     </div>
   </a>