Skip to content

Commit

Permalink
Add more translations
Browse files Browse the repository at this point in the history
Signed-off-by: Jo Vandeginste <[email protected]>
  • Loading branch information
jovandeginste committed Feb 22, 2024
1 parent ca58246 commit 68f79cd
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GIT_COMMIT ?= $(shell git rev-parse HEAD)
BUILD_TIME ?= $(shell date -u --rfc-3339=seconds)
OUTPUT_FILE ?= tmp/main

I18N_LANGUAGES ?= en nl
I18N_LANGUAGES ?= nl
LANG_TO_GENERATE = $(patsubst generate-translation-%,%,$@)

.PHONY: all clean test build
Expand Down
17 changes: 0 additions & 17 deletions translations/en.json

This file was deleted.

10 changes: 9 additions & 1 deletion translations/messages.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
{
"Add workout": "Add workout",
"Average speed": "Average speed",
"Average speed (no pause)": "Average speed (no pause)",
"Create a new account": "Create a new account",
"Dashboard": "Dashboard",
"Dashboard for %s": "Dashboard for %s",
"duration": "duration",
"Logout": "Logout",
"Manage": "Manage",
"Max speed": "Max speed",
"Name": "Name",
"Other users": "Other users",
"Password": "Password",
"Recent activity": "Recent activity",
"Register": "Register",
"Running records": "Running records",
"Sign in": "Sign in",
"Statistics": "Statistics",
"Total distance": "Total distance",
"Total duration": "Total duration",
"Total up": "Total up",
"Username (email)": "Username (email)",
"Welcome!": "Welcome!",
"Workouts": "Workouts"
Expand Down
10 changes: 9 additions & 1 deletion translations/nl.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
{
"Add workout": "Workout toevoegen",
"Average speed": "Gemiddelde snelheid",
"Average speed (no pause)": "Gemiddelde snelheid (zonder pauze)",
"Create a new account": "Maak een nieuwe account",
"Dashboard": "Dashboard",
"Dashboard for %s": "Dashboard voor %s",
"duration": "duur",
"Logout": "Afmelden",
"Manage": "Beheer",
"Max speed": "Maximale snelheid",
"Name": "Naam",
"Other users": "Andere gebruikers",
"Password": "Wachtwoord",
"Recent activity": "Recente activiteit",
"Register": "Registreren",
"Running records": "Loop records",
"Sign in": "Aanmelden",
"Statistics": "Statistieken",
"Total distance": "Totale afstand",
"Total duration": "Totale duur",
"Total up": "Totaal omhoog",
"Username (email)": "Gebruikersnaam (e-mailadres)",
"Welcome!": "Welkom!",
"Workouts": "Workouts"
Expand Down
2 changes: 1 addition & 1 deletion views/partials/statistic_tile.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
>
{{ .Value }}
</div>
<div class="text-neutral-400 text-sm text-right">{{ i18n .Name }}</div>
<div class="text-neutral-400 text-sm text-right">{{ .Name }}</div>
</div>
</div>
</div>
Expand Down
20 changes: 13 additions & 7 deletions views/partials/stats_records_running.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{{ define "stats_records_running" }} {{ if .Active }}
<h3>
<span class="{{ IconFor `running` }}"></span>
Running records
{{ i18n "Running records" }}
</h3>
<table class="workout-info table-auto">
<tbody>
{{ with .AverageSpeed }}
<tr>
<th>
<span class="{{ IconFor `speed` }}">Average speed</span>
<span class="{{ IconFor `speed` }}">{{ i18n "Average speed" }}</span>
</th>
<td class="font-mono">{{ .Value | HumanSpeed }}</td>
<td>
Expand All @@ -19,7 +19,9 @@ <h3>
{{ end }} {{ with .AverageSpeedNoPause }}
<tr>
<th>
<span class="{{ IconFor `speed` }}">Average speed (no pause)</span>
<span class="{{ IconFor `speed` }}"
>{{ i18n "Average speed (no pause)" }}</span
>
</th>
<td class="font-mono">{{ .Value | HumanSpeed }}</td>
<td>
Expand All @@ -30,7 +32,7 @@ <h3>
{{ end }} {{ with .MaxSpeed }}
<tr>
<th>
<span class="{{ IconFor `max-speed` }}">Max speed</span>
<span class="{{ IconFor `max-speed` }}">{{ i18n "Max speed" }}</span>
</th>
<td class="font-mono">{{ .Value | HumanSpeed }}</td>
<td>
Expand All @@ -41,7 +43,9 @@ <h3>
{{ end }} {{ with .Distance }}
<tr>
<th>
<span class="{{ IconFor `distance` }}">Total distance</span>
<span class="{{ IconFor `distance` }}"
>{{ i18n "Total distance" }}</span
>
</th>
<td class="font-mono">{{ .Value | HumanDistance }}</td>
<td>
Expand All @@ -52,7 +56,7 @@ <h3>
{{ end }} {{ with .TotalUp }}
<tr>
<th>
<span class="{{ IconFor `up` }}">Total up</span>
<span class="{{ IconFor `up` }}">{{ i18n "Total up" }}</span>
</th>
<td class="font-mono">{{ .Value | HumanDistance }}</td>
<td>
Expand All @@ -63,7 +67,9 @@ <h3>
{{ end }} {{ with .Duration }}
<tr>
<th>
<span class="{{ IconFor `duration` }}">Total duration</span>
<span class="{{ IconFor `duration` }}"
>{{ i18n "Total duration" }}</span
>
</th>
<td class="font-mono">{{ .Value | HumanDuration }}</td>
<td>
Expand Down
11 changes: 6 additions & 5 deletions views/partials/stats_records_totals.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{{ define "stats_records_total" }}
<div class="md:flex md:flex-wrap">
{{ template "statistic_tile" (BuildDecoratedAttribute "workout" "workouts"
.Workouts) }} {{ template "statistic_tile" (BuildDecoratedAttribute "distance"
"distance" (.Distance | ToKilometer )) }} {{ template "statistic_tile"
(BuildDecoratedAttribute "up" "up" (.Up | HumanDistance)) }} {{ template
"statistic_tile" (BuildDecoratedAttribute "duration" "duration" (.Duration |
{{ template "statistic_tile" (BuildDecoratedAttribute "workout" ( i18n
"workouts" ) .Workouts) }} {{ template "statistic_tile"
(BuildDecoratedAttribute "distance" ( i18n "distance" ) (.Distance |
ToKilometer )) }} {{ template "statistic_tile" (BuildDecoratedAttribute "up" (
i18n "up" ) (.Up | HumanDistance)) }} {{ template "statistic_tile"
(BuildDecoratedAttribute "duration" ( i18n "duration" ) (.Duration |
HumanDuration)) }}
</div>
{{ end }}
4 changes: 2 additions & 2 deletions views/user/user_show.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ <h2 class="{{ IconFor `dashboard` }}">
</div>
{{ if .users }}
<div class="inner-form">
<h3 class="{{ IconFor `users` }}">Other users</h3>
<h3 class="{{ IconFor `users` }}">{{ i18n "Other users" }}</h3>

<div class="sm:flex sm:flex-wrap gap-5">
{{ range .users }} {{ if ne .ID $.user.ID }}
Expand All @@ -76,7 +76,7 @@ <h3 class="{{ IconFor `users` }}">Other users</h3>
</div>
</div>
<div class="inner-form">
<h3 class="{{ IconFor `workout` }}">Recent activity</h3>
<h3 class="{{ IconFor `workout` }}">{{ i18n "Recent activity" }}</h3>
<div class="sm:flex sm:flex-wrap justify-center">
{{ range .recentWorkouts }}{{ template "workout_item" . }}{{ end }}
</div>
Expand Down

0 comments on commit 68f79cd

Please sign in to comment.