Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make sure to translate the interface #98

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 4 additions & 28 deletions i18n/de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,11 @@
- id: nextPost
translation: "Nächster Post"
- id: readTime
translation: "Minuten"
one: "Eine Minute"
other: "{{.Count}} Minuten"
- id: words
translation: "Wörter"

# Date
- id: January
translation: "Januar"
- id: February
translation: "Februar"
- id: March
translation: "März"
- id: April
translation: "April"
- id: May
translation: "Mai"
- id: June
translation: "Juni"
- id: July
translation: "Juli"
- id: August
translation: "August"
- id: September
translation: "September"
- id: October
translation: "Oktober"
- id: November
translation: "November"
- id: December
translation: "Dezember"
one: "Ein Wort"
other: "{{.Count}} Wörter"

# 404 page
- id: pageNotFound
Expand Down
18 changes: 16 additions & 2 deletions i18n/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,18 @@
- id: nextPost
translation: "Next Post"
- id: readTime
translation: "minutes"
one: "One minute"
other: "{{.Count}} minutes"
- id: words
translation: "words"
one: "One word"
other: "{{.Count}} words"


# 404 page
- id: pageNotFound
translation: "Whoops, this page doesn't exist. Move along. (404 error)"
- id: goHome
translation: "Go to home"

# Footer
- id: poweredBy # Accepts HTML
Expand All @@ -45,6 +49,16 @@
- id: gcseClose
translation: "Close"

# Search
- id: searchPlaceholder
translation: "Enter search query"
- id: searchResults
translation: "Results"
- id: searchNoResults
translation: "No results found"
- id: searchNoResultsDesc
translation: "Try adjusting your search query"

# Staticman
- id: noComment
translation: "No comment"
Expand Down
44 changes: 16 additions & 28 deletions i18n/fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,17 @@
- id: nextPost
translation: "Articles suivants"
- id: readTime
translation: "minutes"
one: "Une minute"
other: "{{.Count}} minutes"
- id: words
translation: "mots"

# Date
- id: January
translation: "Janvier"
- id: February
translation: "Février"
- id: March
translation: "Mars"
- id: April
translation: "Avril"
- id: May
translation: "Mai"
- id: June
translation: "Juin"
- id: July
translation: "Juillet"
- id: August
translation: "Août"
- id: September
translation: "Septembre"
- id: October
translation: "Octobre"
- id: November
translation: "Novembre"
- id: December
translation: "Décembre"
one: "One mot"
other: "{{.Count}} mots"

# 404 page
- id: pageNotFound
translation: "Whoops, cette page n'existe pas. Circulez. (404 error)"
- id: goHome
translation: "Retourner à l'accueil"

# Footer
- id: poweredBy # Accepts HTML
Expand All @@ -70,6 +48,16 @@
- id: gcseClose
translation: "Fermer"

# Search
- id: searchPlaceholder
translation: "Rechercher…"
- id: searchResults
translation: "Résultats"
- id: searchNoResults
translation: "Aucun résultat"
- id: searchNoResultsDesc
translation: "Essayez avec d'autres mots-clés"

# Staticman
- id: noComment
translation: "Pas de commentaire"
Expand Down
4 changes: 2 additions & 2 deletions layouts/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
</svg>
<div class="mt-16 z-10">
<a class="px-6 py-4 rounded-lg bg-gray-100 text-gray-800 hover:text-gray-900 hover:bg-gray-200 transition-colors"
href="{{ .Site.BaseURL }}">Go to home</a>
href="{{ .Site.BaseURL }}">{{ i18n "goHome" }}</a>
</div>
</section>

{{ end }}
{{ end }}
8 changes: 4 additions & 4 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ define "main" }}
{{ $lastmodstr := (partial "date.html" (dict "date" .Lastmod "language" $.Page.Language "format" "long")) }}
{{ $datestr := (partial "date.html" (dict "date" .Date "language" $.Page.Language "format" "long")) }}
{{ $lastmodstr := (.Lastmod | time.Format ":date_long") }}
{{ $datestr := (.Date | time.Format ":date_long") }}

{{ if (and .Params.thumbnail (not (or .Site.Params.hidePageThumbnail .Params.hidePageThumbnail)) ) }}
<div class="relative max-w-5xl mx-auto px-4">
Expand Down Expand Up @@ -37,7 +37,7 @@ <h5 class="text-sm flex items-center flex-wrap">
<circle cx="12" cy="12" r="9" />
<polyline points="12 7 12 12 15 15" />
</svg>
{{ i18n "readingTime"}}{{ .ReadingTime }}&nbsp;{{ i18n "readTime" }}
{{ i18n "readTime" .ReadingTime }}
&nbsp;&bull;
<svg xmlns="http://www.w3.org/2000/svg" class="mx-1" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
Expand All @@ -47,7 +47,7 @@ <h5 class="text-sm flex items-center flex-wrap">
<line x1="12" y1="6" x2="12" y2="19" />
<line x1="21" y1="6" x2="21" y2="19" />
</svg>
{{ .WordCount }}&nbsp;{{ i18n "words" }}
{{ i18n "words" .WordCount }}
{{ if not (or (or .Site.Params.hideOtherLanguages .Params.hideOtherLanguages) false) }}
{{ if .IsTranslated -}}
{{- $sortedTranslations := sort .Translations "Site.Language.Weight" -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/blog-card.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<img src="{{ .Params.thumbnail }}" alt="{{ .Params.title }}" class="rounded-lg shadow-sm w-full h-52 object-cover" />
{{ if not (or (or .Site.Params.hideMeta .Params.hideMeta) false) }}
<div class="absolute top-4 right-4 rounded shadow bg-white text-gray-900 dark:bg-gray-900 dark:text-white text-sm px-2 py-0.5">
{{ partial "date.html" (dict "date" .Date "language" $.Page.Language "format" "short") }}
{{ .Date | time.Format ":date_medium" }}
</div>
{{ end }}
</div>
Expand Down
13 changes: 0 additions & 13 deletions layouts/partials/date.html

This file was deleted.

10 changes: 5 additions & 5 deletions layouts/partials/search-ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
</div>

<input type="search" class="py-2 px-3 w-full dark:text-black border dark:border-transparent"
placeholder="Enter search query" />
placeholder="{{ i18n "searchPlaceholder" }}" />

<div class="search-results text-lg font-medium my-4 hidden">Results</div>
<div class="search-results text-lg font-medium my-4 hidden">{{ i18n "searchResults" }}</div>
<ul class="search-list my-2">

</ul>

<div class="no-results text-center my-8 hidden">
<div class="text-xl font-semibold mb-2">No results found</div>
<p class="font-light text-sm">Try adjusting your search query</p>
<div class="text-xl font-semibold mb-2">{{ i18n "searchNoResults" }}</div>
<p class="font-light text-sm">{{ i18n "searchNoResultsDesc" }}</p>
</div>
</div>
</div>
Expand All @@ -32,4 +32,4 @@
{{ $search := resources.Get "js/search.js" }}

{{ $concatjs := slice $fuse $search | resources.Concat "js/scripts.js" | resources.Minify }}
<script src="{{ $concatjs.Permalink }}"></script>
<script src="{{ $concatjs.Permalink }}"></script>