Skip to content

Commit

Permalink
Use I18n
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenpeels committed Dec 5, 2023
1 parent 8da9dad commit b82fdbd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ExampleSite/i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
[readMore]
other = 'Read more'

[estimatedReadingTime]
other = 'Estimated reading time: %d minutes'

[404_title]
other = 'Page not found'

Expand Down
3 changes: 3 additions & 0 deletions ExampleSite/i18n/pt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
[readMore]
other = 'Ler mais'

[estimatedReadingTime]
other = 'Tempo estimado de leitura: %d minutos'

[404_title]
other = 'Página não encontrada'

Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h2 class="title-large">{{ .Title }}</h2>
<div class="meta">
{{/* Publish date */}}
<time datetime="{{ .PublishDate }}" title='{{ .PublishDate.Format "Mon, Jan 2, 2006, 3:04 PM MST" }}'>
{{ .PublishDate.Format "02/01/2006" }} - {{ printf "Estimated reading time: %d minutes" .ReadingTime }}
{{ .PublishDate.Format "02/01/2006" }} - {{ printf i18n "estimatedReadingTime" .ReadingTime }}
</time>

{{/* Categories */}}
Expand Down

0 comments on commit b82fdbd

Please sign in to comment.