Skip to content

Commit

Permalink
i18n: add months format strings
Browse files Browse the repository at this point in the history
  • Loading branch information
loup-brun committed Jan 23, 2020
1 parent 6f083ca commit d0355f9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
12 changes: 12 additions & 0 deletions exampleSite/data/en/months.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
1: "January"
2: "February"
3: "March"
4: "April"
5: "May"
6: "June"
7: "July"
8: "August"
9: "September"
10: "October"
11: "November"
12: "Décember"
12 changes: 12 additions & 0 deletions exampleSite/data/fr/months.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
1: "janvier"
2: "février"
3: "mars"
4: "avril"
5: "mai"
6: "juin"
7: "juillet"
8: "août"
9: "septembre"
10: "octobre"
11: "novembre"
12: "décembre"
2 changes: 1 addition & 1 deletion exampleSite/i18n/fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

- id: join
translation: S’abonner

- id: enter_email
translation: Entrez votre courriel…

Expand Down
4 changes: 3 additions & 1 deletion layouts/_default/event.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{- $data := index .Site.Data .Site.Language.Lang -}}

<div class="card border-0 rounded-0 hover-shadow">
<div class="card-img position-relative">
<img class="card-img-top rounded-0" src="{{ .Params.Image | relURL }}" alt="{{ .Title }}">
<div class="card-date"><span>{{ .PublishDate.Format "02" }}</span><br>{{ .PublishDate.Format "JANUARY"}}</div>
<div class="card-date"><span>{{ .PublishDate.Format "02" }}</span><br>{{ index $data.months (printf "%d" .PublishDate.Month) }}</div>
</div>
<div class="card-body">
<!-- location -->
Expand Down

0 comments on commit d0355f9

Please sign in to comment.