summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.exrc4
-rw-r--r--.gitignore2
-rw-r--r--Makefile4
-rw-r--r--cmd/mfmt/main.go2
-rw-r--r--cmd/mfmt/util_test.go2
-rw-r--r--lib/countries.go46
-rw-r--r--lib/i18n.go (renamed from i18n/printer.go)33
-rw-r--r--lib/locales/bg/messages.gotext.json (renamed from i18n/locales/bg/messages.gotext.json)247
-rw-r--r--lib/locales/el/messages.gotext.json (renamed from i18n/locales/el/messages.gotext.json)247
-rw-r--r--lib/locales/en/messages.gotext.json (renamed from i18n/locales/en/messages.gotext.json)309
-rw-r--r--lib/locales/nl/messages.gotext.json (renamed from i18n/locales/nl/messages.gotext.json)247
-rw-r--r--lib/mintage/parser.go (renamed from mintage/parser.go)0
-rw-r--r--lib/mintage/parser_test.go (renamed from mintage/parser_test.go)0
-rw-r--r--main.go82
-rw-r--r--middleware/i18n.go42
-rw-r--r--template/about.templ (renamed from templates/about.templ)6
-rw-r--r--template/base.go3
-rw-r--r--template/base.templ (renamed from templates/base.templ)36
-rw-r--r--template/coins.templ (renamed from templates/coins.templ)8
-rw-r--r--template/coins_designs.templ (renamed from templates/coins_designs.templ)16
-rw-r--r--template/coins_designs_nl.templ (renamed from templates/coins_designs_nl.templ)6
-rw-r--r--template/coins_mintages.templ112
-rw-r--r--template/language.templ (renamed from templates/language.templ)8
-rw-r--r--template/navbar.templ (renamed from templates/navbar.templ)6
-rw-r--r--template/root.templ (renamed from templates/root.templ)6
-rw-r--r--templates/base.go63
26 files changed, 990 insertions, 547 deletions
diff --git a/.exrc b/.exrc
index 858eea9..f67ec8e 100644
--- a/.exrc
+++ b/.exrc
@@ -26,5 +26,5 @@ autocmd FileType templ autocmd BufWritePre <buffer>
nnoremap <silent> gM :wall \| make all-i18n<CR>
nnoremap <silent> <LocalLeader>t :vimgrep /\CTODO/ **/*<CR>
-let &wildignore = netrw_gitignore#Hide() . ',catalog.go,*_templ.go,.git/*,vendor/*'
-let g:netrw_list_hide .= ",catalog.go,.*_templ\\.go$"
+let &wildignore = netrw_gitignore#Hide() . ',.git/*,vendor/*'
+let g:netrw_list_hide .= ",.*\\.gen\\..*,.*_templ\\.go$"
diff --git a/.gitignore b/.gitignore
index c7fa2cf..e58bfc9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,6 @@
euro-cash.eu
-i18n/catalog.go
mfmt
!cmd/mfmt
out.gotext.json
+*.gen.*
*_templ.go
diff --git a/Makefile b/Makefile
index e9106cb..85ba3d9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,10 @@
# Generating translations is rather slow; so don’t do that by default
all:
- TEMPL_EXPERIMENT=rawgo go generate ./templates
+ TEMPL_EXPERIMENT=rawgo go generate ./template
go build
all-i18n:
- TEMPL_EXPERIMENT=rawgo go generate ./templates ./i18n
+ TEMPL_EXPERIMENT=rawgo go generate ./template ./lib
find . -name out.gotext.json | mcp -b sed s/out/messages/
go build
diff --git a/cmd/mfmt/main.go b/cmd/mfmt/main.go
index 3144372..cb9b0cd 100644
--- a/cmd/mfmt/main.go
+++ b/cmd/mfmt/main.go
@@ -7,7 +7,7 @@ import (
"path/filepath"
"unsafe"
- "git.thomasvoss.com/euro-cash.eu/mintage"
+ "git.thomasvoss.com/euro-cash.eu/lib/mintage"
)
const cols = unsafe.Sizeof(mintage.Row{}.Cols) /
diff --git a/cmd/mfmt/util_test.go b/cmd/mfmt/util_test.go
index af97146..1041e4f 100644
--- a/cmd/mfmt/util_test.go
+++ b/cmd/mfmt/util_test.go
@@ -6,7 +6,7 @@ package main
import (
"testing"
- "git.thomasvoss.com/euro-cash.eu/mintage"
+ "git.thomasvoss.com/euro-cash.eu/lib/mintage"
)
func TestFormatInt(t *testing.T) {
diff --git a/lib/countries.go b/lib/countries.go
new file mode 100644
index 0000000..565f61c
--- /dev/null
+++ b/lib/countries.go
@@ -0,0 +1,46 @@
+package lib
+
+import (
+ "slices"
+
+ "golang.org/x/text/collate"
+ "golang.org/x/text/language"
+)
+
+type Country struct {
+ Code, Name string
+}
+
+func SortedCountries(p Printer) []Country {
+ xs := []Country{
+ {Code: "ad", Name: p.T("Andorra")},
+ {Code: "at", Name: p.T("Austria")},
+ {Code: "be", Name: p.T("Belgium")},
+ {Code: "cy", Name: p.T("Cyprus")},
+ {Code: "de", Name: p.T("Germany")},
+ {Code: "ee", Name: p.T("Estonia")},
+ {Code: "es", Name: p.T("Spain")},
+ {Code: "fi", Name: p.T("Finland")},
+ {Code: "fr", Name: p.T("France")},
+ {Code: "gr", Name: p.T("Greece")},
+ {Code: "hr", Name: p.T("Croatia")},
+ {Code: "ie", Name: p.T("Ireland")},
+ {Code: "it", Name: p.T("Italy")},
+ {Code: "lt", Name: p.T("Lithuania")},
+ {Code: "lu", Name: p.T("Luxembourg")},
+ {Code: "lv", Name: p.T("Latvia")},
+ {Code: "mc", Name: p.T("Monaco")},
+ {Code: "mt", Name: p.T("Malta")},
+ {Code: "nl", Name: p.T("Netherlands")},
+ {Code: "pt", Name: p.T("Portugal")},
+ {Code: "si", Name: p.T("Slovenia")},
+ {Code: "sk", Name: p.T("Slovakia")},
+ {Code: "sm", Name: p.T("San Marino")},
+ {Code: "va", Name: p.T("Vatican City")},
+ }
+ c := collate.New(language.MustParse(p.Locale.Bcp))
+ slices.SortFunc(xs, func(x, y Country) int {
+ return c.CompareString(x.Name, y.Name)
+ })
+ return xs
+}
diff --git a/i18n/printer.go b/lib/i18n.go
index a933622..50652cb 100644
--- a/i18n/printer.go
+++ b/lib/i18n.go
@@ -1,4 +1,6 @@
-package i18n
+//go:generate gotext -srclang=en update -out=catalog.gen.go -lang=bg,el,en,nl git.thomasvoss.com/euro-cash.eu
+
+package lib
import (
"fmt"
@@ -9,20 +11,15 @@ import (
"golang.org/x/text/message"
)
-//go:generate gotext -srclang=en update -out=catalog.go -lang=bg,el,en,nl git.thomasvoss.com/euro-cash.eu
-
type Printer struct {
- Locale Locale
- printer *message.Printer
+ Locale Locale
+ inner *message.Printer
}
type Locale struct {
- Bcp string
- Name string
- dateFmt string
- moneyFmt string
- Eurozone bool
- Enabled bool
+ Bcp, Name string
+ dateFmt, moneyFmt string
+ Eurozone, Enabled bool
}
var (
@@ -191,7 +188,7 @@ var (
Enabled: false,
},
}
- /* Map of language codes to printers. We do this instead of just
+ /* Map of language codes to Printers. We do this instead of just
using language.MustParse() directly so that we can easily see if a
language is supported or not. */
Printers map[string]Printer = make(map[string]Printer, len(Locales))
@@ -203,8 +200,8 @@ func InitPrinters() {
if loc.Enabled {
lang := language.MustParse(loc.Bcp)
Printers[strings.ToLower(loc.Bcp)] = Printer{
- Locale: loc,
- printer: message.NewPrinter(lang),
+ Locale: loc,
+ inner: message.NewPrinter(lang),
}
}
}
@@ -212,7 +209,11 @@ func InitPrinters() {
}
func (p Printer) T(fmt string, args ...any) string {
- return p.printer.Sprintf(fmt, args...)
+ return p.inner.Sprintf(fmt, args...)
+}
+
+func (p Printer) N(n int) string {
+ return p.inner.Sprint(n)
}
func (p Printer) Date(d time.Time) string {
@@ -225,7 +226,7 @@ func (p Printer) Money(val float64, round bool) string {
/* Hack to avoid gotext writing these two ‘translations’ into the
translations file */
- f := p.printer.Sprintf
+ f := p.inner.Sprintf
if round {
valstr = f("%d", int(val))
} else {
diff --git a/i18n/locales/bg/messages.gotext.json b/lib/locales/bg/messages.gotext.json
index 0cb77fa..d43d6f8 100644
--- a/i18n/locales/bg/messages.gotext.json
+++ b/lib/locales/bg/messages.gotext.json
@@ -7,89 +7,6 @@
"translation": ""
},
{
- "id": "About Us",
- "message": "About Us",
- "translation": ""
- },
- {
- "id": "Open Source",
- "message": "Open Source",
- "translation": ""
- },
- {
- "id": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
- "message": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
- "translation": "",
- "placeholders": [
- {
- "id": "RepoLinkStart",
- "string": "%[1]s",
- "type": "string",
- "underlyingType": "string",
- "argNum": 1,
- "expr": "repoLinkStart"
- },
- {
- "id": "LinkEnd",
- "string": "%[2]s",
- "type": "string",
- "underlyingType": "string",
- "argNum": 2,
- "expr": "linkEnd"
- }
- ]
- },
- {
- "id": "Contact Us",
- "message": "Contact Us",
- "translation": ""
- },
- {
- "id": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
- "message": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
- "translation": "",
- "placeholders": [
- {
- "id": "ContactEmail",
- "string": "%[1]s",
- "type": "string",
- "underlyingType": "string",
- "argNum": 1,
- "expr": "contactEmail"
- }
- ]
- },
- {
- "id": "Special Thanks",
- "message": "Special Thanks",
- "translation": ""
- },
- {
- "id": "Development",
- "message": "Development",
- "translation": ""
- },
- {
- "id": "Research",
- "message": "Research",
- "translation": ""
- },
- {
- "id": "Translations",
- "message": "Translations",
- "translation": ""
- },
- {
- "id": "British- \u0026 American English",
- "message": "British- \u0026 American English",
- "translation": ""
- },
- {
- "id": "Icelandic",
- "message": "Icelandic",
- "translation": ""
- },
- {
"id": "Andorra",
"message": "Andorra",
"translation": "Андора"
@@ -210,6 +127,89 @@
"translation": "град Ватикана"
},
{
+ "id": "About Us",
+ "message": "About Us",
+ "translation": ""
+ },
+ {
+ "id": "Open Source",
+ "message": "Open Source",
+ "translation": ""
+ },
+ {
+ "id": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
+ "message": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
+ "translation": "",
+ "placeholders": [
+ {
+ "id": "RepoLinkStart",
+ "string": "%[1]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 1,
+ "expr": "repoLinkStart"
+ },
+ {
+ "id": "LinkEnd",
+ "string": "%[2]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 2,
+ "expr": "linkEnd"
+ }
+ ]
+ },
+ {
+ "id": "Contact Us",
+ "message": "Contact Us",
+ "translation": ""
+ },
+ {
+ "id": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
+ "message": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
+ "translation": "",
+ "placeholders": [
+ {
+ "id": "ContactEmail",
+ "string": "%[1]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 1,
+ "expr": "contactEmail"
+ }
+ ]
+ },
+ {
+ "id": "Special Thanks",
+ "message": "Special Thanks",
+ "translation": ""
+ },
+ {
+ "id": "Development",
+ "message": "Development",
+ "translation": ""
+ },
+ {
+ "id": "Research",
+ "message": "Research",
+ "translation": ""
+ },
+ {
+ "id": "Translations",
+ "message": "Translations",
+ "translation": ""
+ },
+ {
+ "id": "British- \u0026 American English",
+ "message": "British- \u0026 American English",
+ "translation": ""
+ },
+ {
+ "id": "Icelandic",
+ "message": "Icelandic",
+ "translation": ""
+ },
+ {
"id": "Found a mistake or want to contribute missing information?",
"message": "Found a mistake or want to contribute missing information?",
"translation": ""
@@ -278,11 +278,92 @@
"translation": ""
},
{
+ "id": "Additional Notes",
+ "message": "Additional Notes",
+ "translation": ""
+ },
+ {
+ "id": "Most coins from the years 2003–2016 are listed as NIFC coins while other popular sources such as Numista claim they were minted for circulation. For more information on why others are wrong, {MuntrolpakketLinkStart}click here{LinkEnd}.",
+ "message": "Most coins from the years 2003–2016 are listed as NIFC coins while other popular sources such as Numista claim they were minted for circulation. For more information on why others are wrong, {MuntrolpakketLinkStart}click here{LinkEnd}.",
+ "translation": "",
+ "placeholders": [
+ {
+ "id": "MuntrolpakketLinkStart",
+ "string": "%[1]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 1,
+ "expr": "muntrolpakketLinkStart"
+ },
+ {
+ "id": "LinkEnd",
+ "string": "%[2]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 2,
+ "expr": "linkEnd"
+ }
+ ]
+ },
+ {
+ "id": "In 2003 Numista calculated a total of {217503} coins issued for coin sets per denomination. Our own calculations found only {177003}. Numista also forgot to include the many hundred thousand coins from the coin roll sets that were produced.",
+ "message": "In 2003 Numista calculated a total of {217503} coins issued for coin sets per denomination. Our own calculations found only {177003}. Numista also forgot to include the many hundred thousand coins from the coin roll sets that were produced.",
+ "translation": "",
+ "placeholders": [
+ {
+ "id": "217503",
+ "string": "%[1]d",
+ "type": "int",
+ "underlyingType": "int",
+ "argNum": 1,
+ "expr": "217503"
+ },
+ {
+ "id": "177003",
+ "string": "%[2]d",
+ "type": "int",
+ "underlyingType": "int",
+ "argNum": 2,
+ "expr": "177003"
+ }
+ ]
+ },
+ {
"id": "Country",
"message": "Country",
"translation": ""
},
{
+ "id": "Circulation Coins",
+ "message": "Circulation Coins",
+ "translation": ""
+ },
+ {
+ "id": "NIFC / BU Sets",
+ "message": "NIFC / BU Sets",
+ "translation": ""
+ },
+ {
+ "id": "Proof Coins",
+ "message": "Proof Coins",
+ "translation": ""
+ },
+ {
+ "id": "Filter",
+ "message": "Filter",
+ "translation": ""
+ },
+ {
+ "id": "Year",
+ "message": "Year",
+ "translation": ""
+ },
+ {
+ "id": "Unknown",
+ "message": "Unknown",
+ "translation": ""
+ },
+ {
"id": "Euro Coins",
"message": "Euro Coins",
"translation": ""
diff --git a/i18n/locales/el/messages.gotext.json b/lib/locales/el/messages.gotext.json
index dad7af6..278c3fa 100644
--- a/i18n/locales/el/messages.gotext.json
+++ b/lib/locales/el/messages.gotext.json
@@ -7,89 +7,6 @@
"translation": ""
},
{
- "id": "About Us",
- "message": "About Us",
- "translation": ""
- },
- {
- "id": "Open Source",
- "message": "Open Source",
- "translation": ""
- },
- {
- "id": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
- "message": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
- "translation": "",
- "placeholders": [
- {
- "id": "RepoLinkStart",
- "string": "%[1]s",
- "type": "string",
- "underlyingType": "string",
- "argNum": 1,
- "expr": "repoLinkStart"
- },
- {
- "id": "LinkEnd",
- "string": "%[2]s",
- "type": "string",
- "underlyingType": "string",
- "argNum": 2,
- "expr": "linkEnd"
- }
- ]
- },
- {
- "id": "Contact Us",
- "message": "Contact Us",
- "translation": ""
- },
- {
- "id": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
- "message": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
- "translation": "",
- "placeholders": [
- {
- "id": "ContactEmail",
- "string": "%[1]s",
- "type": "string",
- "underlyingType": "string",
- "argNum": 1,
- "expr": "contactEmail"
- }
- ]
- },
- {
- "id": "Special Thanks",
- "message": "Special Thanks",
- "translation": ""
- },
- {
- "id": "Development",
- "message": "Development",
- "translation": ""
- },
- {
- "id": "Research",
- "message": "Research",
- "translation": ""
- },
- {
- "id": "Translations",
- "message": "Translations",
- "translation": ""
- },
- {
- "id": "British- \u0026 American English",
- "message": "British- \u0026 American English",
- "translation": ""
- },
- {
- "id": "Icelandic",
- "message": "Icelandic",
- "translation": ""
- },
- {
"id": "Andorra",
"message": "Andorra",
"translation": "Ανδόρα"
@@ -210,6 +127,89 @@
"translation": "Βατικανό"
},
{
+ "id": "About Us",
+ "message": "About Us",
+ "translation": ""
+ },
+ {
+ "id": "Open Source",
+ "message": "Open Source",
+ "translation": ""
+ },
+ {
+ "id": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
+ "message": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
+ "translation": "",
+ "placeholders": [
+ {
+ "id": "RepoLinkStart",
+ "string": "%[1]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 1,
+ "expr": "repoLinkStart"
+ },
+ {
+ "id": "LinkEnd",
+ "string": "%[2]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 2,
+ "expr": "linkEnd"
+ }
+ ]
+ },
+ {
+ "id": "Contact Us",
+ "message": "Contact Us",
+ "translation": ""
+ },
+ {
+ "id": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
+ "message": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
+ "translation": "",
+ "placeholders": [
+ {
+ "id": "ContactEmail",
+ "string": "%[1]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 1,
+ "expr": "contactEmail"
+ }
+ ]
+ },
+ {
+ "id": "Special Thanks",
+ "message": "Special Thanks",
+ "translation": ""
+ },
+ {
+ "id": "Development",
+ "message": "Development",
+ "translation": ""
+ },
+ {
+ "id": "Research",
+ "message": "Research",
+ "translation": ""
+ },
+ {
+ "id": "Translations",
+ "message": "Translations",
+ "translation": ""
+ },
+ {
+ "id": "British- \u0026 American English",
+ "message": "British- \u0026 American English",
+ "translation": ""
+ },
+ {
+ "id": "Icelandic",
+ "message": "Icelandic",
+ "translation": ""
+ },
+ {
"id": "Found a mistake or want to contribute missing information?",
"message": "Found a mistake or want to contribute missing information?",
"translation": ""
@@ -278,11 +278,92 @@
"translation": ""
},
{
+ "id": "Additional Notes",
+ "message": "Additional Notes",
+ "translation": ""
+ },
+ {
+ "id": "Most coins from the years 2003–2016 are listed as NIFC coins while other popular sources such as Numista claim they were minted for circulation. For more information on why others are wrong, {MuntrolpakketLinkStart}click here{LinkEnd}.",
+ "message": "Most coins from the years 2003–2016 are listed as NIFC coins while other popular sources such as Numista claim they were minted for circulation. For more information on why others are wrong, {MuntrolpakketLinkStart}click here{LinkEnd}.",
+ "translation": "",
+ "placeholders": [
+ {
+ "id": "MuntrolpakketLinkStart",
+ "string": "%[1]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 1,
+ "expr": "muntrolpakketLinkStart"
+ },
+ {
+ "id": "LinkEnd",
+ "string": "%[2]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 2,
+ "expr": "linkEnd"
+ }
+ ]
+ },
+ {
+ "id": "In 2003 Numista calculated a total of {217503} coins issued for coin sets per denomination. Our own calculations found only {177003}. Numista also forgot to include the many hundred thousand coins from the coin roll sets that were produced.",
+ "message": "In 2003 Numista calculated a total of {217503} coins issued for coin sets per denomination. Our own calculations found only {177003}. Numista also forgot to include the many hundred thousand coins from the coin roll sets that were produced.",
+ "translation": "",
+ "placeholders": [
+ {
+ "id": "217503",
+ "string": "%[1]d",
+ "type": "int",
+ "underlyingType": "int",
+ "argNum": 1,
+ "expr": "217503"
+ },
+ {
+ "id": "177003",
+ "string": "%[2]d",
+ "type": "int",
+ "underlyingType": "int",
+ "argNum": 2,
+ "expr": "177003"
+ }
+ ]
+ },
+ {
"id": "Country",
"message": "Country",
"translation": ""
},
{
+ "id": "Circulation Coins",
+ "message": "Circulation Coins",
+ "translation": ""
+ },
+ {
+ "id": "NIFC / BU Sets",
+ "message": "NIFC / BU Sets",
+ "translation": ""
+ },
+ {
+ "id": "Proof Coins",
+ "message": "Proof Coins",
+ "translation": ""
+ },
+ {
+ "id": "Filter",
+ "message": "Filter",
+ "translation": ""
+ },
+ {
+ "id": "Year",
+ "message": "Year",
+ "translation": ""
+ },
+ {
+ "id": "Unknown",
+ "message": "Unknown",
+ "translation": ""
+ },
+ {
"id": "Euro Coins",
"message": "Euro Coins",
"translation": ""
diff --git a/i18n/locales/en/messages.gotext.json b/lib/locales/en/messages.gotext.json
index e739b20..cfe64f2 100644
--- a/i18n/locales/en/messages.gotext.json
+++ b/lib/locales/en/messages.gotext.json
@@ -9,111 +9,6 @@
"fuzzy": true
},
{
- "id": "About Us",
- "message": "About Us",
- "translation": "About Us",
- "translatorComment": "Copied from source.",
- "fuzzy": true
- },
- {
- "id": "Open Source",
- "message": "Open Source",
- "translation": "Open Source",
- "translatorComment": "Copied from source.",
- "fuzzy": true
- },
- {
- "id": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
- "message": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
- "translation": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
- "translatorComment": "Copied from source.",
- "placeholders": [
- {
- "id": "RepoLinkStart",
- "string": "%[1]s",
- "type": "string",
- "underlyingType": "string",
- "argNum": 1,
- "expr": "repoLinkStart"
- },
- {
- "id": "LinkEnd",
- "string": "%[2]s",
- "type": "string",
- "underlyingType": "string",
- "argNum": 2,
- "expr": "linkEnd"
- }
- ],
- "fuzzy": true
- },
- {
- "id": "Contact Us",
- "message": "Contact Us",
- "translation": "Contact Us",
- "translatorComment": "Copied from source.",
- "fuzzy": true
- },
- {
- "id": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
- "message": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
- "translation": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
- "translatorComment": "Copied from source.",
- "placeholders": [
- {
- "id": "ContactEmail",
- "string": "%[1]s",
- "type": "string",
- "underlyingType": "string",
- "argNum": 1,
- "expr": "contactEmail"
- }
- ],
- "fuzzy": true
- },
- {
- "id": "Special Thanks",
- "message": "Special Thanks",
- "translation": "Special Thanks",
- "translatorComment": "Copied from source.",
- "fuzzy": true
- },
- {
- "id": "Development",
- "message": "Development",
- "translation": "Development",
- "translatorComment": "Copied from source.",
- "fuzzy": true
- },
- {
- "id": "Research",
- "message": "Research",
- "translation": "Research",
- "translatorComment": "Copied from source.",
- "fuzzy": true
- },
- {
- "id": "Translations",
- "message": "Translations",
- "translation": "Translations",
- "translatorComment": "Copied from source.",
- "fuzzy": true
- },
- {
- "id": "British- \u0026 American English",
- "message": "British- \u0026 American English",
- "translation": "British- \u0026 American English",
- "translatorComment": "Copied from source.",
- "fuzzy": true
- },
- {
- "id": "Icelandic",
- "message": "Icelandic",
- "translation": "Icelandic",
- "translatorComment": "Copied from source.",
- "fuzzy": true
- },
- {
"id": "Andorra",
"message": "Andorra",
"translation": "Andorra",
@@ -282,6 +177,111 @@
"fuzzy": true
},
{
+ "id": "About Us",
+ "message": "About Us",
+ "translation": "About Us",
+ "translatorComment": "Copied from source.",
+ "fuzzy": true
+ },
+ {
+ "id": "Open Source",
+ "message": "Open Source",
+ "translation": "Open Source",
+ "translatorComment": "Copied from source.",
+ "fuzzy": true
+ },
+ {
+ "id": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
+ "message": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
+ "translation": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
+ "translatorComment": "Copied from source.",
+ "placeholders": [
+ {
+ "id": "RepoLinkStart",
+ "string": "%[1]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 1,
+ "expr": "repoLinkStart"
+ },
+ {
+ "id": "LinkEnd",
+ "string": "%[2]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 2,
+ "expr": "linkEnd"
+ }
+ ],
+ "fuzzy": true
+ },
+ {
+ "id": "Contact Us",
+ "message": "Contact Us",
+ "translation": "Contact Us",
+ "translatorComment": "Copied from source.",
+ "fuzzy": true
+ },
+ {
+ "id": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
+ "message": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
+ "translation": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
+ "translatorComment": "Copied from source.",
+ "placeholders": [
+ {
+ "id": "ContactEmail",
+ "string": "%[1]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 1,
+ "expr": "contactEmail"
+ }
+ ],
+ "fuzzy": true
+ },
+ {
+ "id": "Special Thanks",
+ "message": "Special Thanks",
+ "translation": "Special Thanks",
+ "translatorComment": "Copied from source.",
+ "fuzzy": true
+ },
+ {
+ "id": "Development",
+ "message": "Development",
+ "translation": "Development",
+ "translatorComment": "Copied from source.",
+ "fuzzy": true
+ },
+ {
+ "id": "Research",
+ "message": "Research",
+ "translation": "Research",
+ "translatorComment": "Copied from source.",
+ "fuzzy": true
+ },
+ {
+ "id": "Translations",
+ "message": "Translations",
+ "translation": "Translations",
+ "translatorComment": "Copied from source.",
+ "fuzzy": true
+ },
+ {
+ "id": "British- \u0026 American English",
+ "message": "British- \u0026 American English",
+ "translation": "British- \u0026 American English",
+ "translatorComment": "Copied from source.",
+ "fuzzy": true
+ },
+ {
+ "id": "Icelandic",
+ "message": "Icelandic",
+ "translation": "Icelandic",
+ "translatorComment": "Copied from source.",
+ "fuzzy": true
+ },
+ {
"id": "Found a mistake or want to contribute missing information?",
"message": "Found a mistake or want to contribute missing information?",
"translation": "Found a mistake or want to contribute missing information?",
@@ -370,6 +370,63 @@
"fuzzy": true
},
{
+ "id": "Additional Notes",
+ "message": "Additional Notes",
+ "translation": "Additional Notes",
+ "translatorComment": "Copied from source.",
+ "fuzzy": true
+ },
+ {
+ "id": "Most coins from the years 2003–2016 are listed as NIFC coins while other popular sources such as Numista claim they were minted for circulation. For more information on why others are wrong, {MuntrolpakketLinkStart}click here{LinkEnd}.",
+ "message": "Most coins from the years 2003–2016 are listed as NIFC coins while other popular sources such as Numista claim they were minted for circulation. For more information on why others are wrong, {MuntrolpakketLinkStart}click here{LinkEnd}.",
+ "translation": "Most coins from the years 2003–2016 are listed as NIFC coins while other popular sources such as Numista claim they were minted for circulation. For more information on why others are wrong, {MuntrolpakketLinkStart}click here{LinkEnd}.",
+ "translatorComment": "Copied from source.",
+ "placeholders": [
+ {
+ "id": "MuntrolpakketLinkStart",
+ "string": "%[1]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 1,
+ "expr": "muntrolpakketLinkStart"
+ },
+ {
+ "id": "LinkEnd",
+ "string": "%[2]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 2,
+ "expr": "linkEnd"
+ }
+ ],
+ "fuzzy": true
+ },
+ {
+ "id": "In 2003 Numista calculated a total of {217503} coins issued for coin sets per denomination. Our own calculations found only {177003}. Numista also forgot to include the many hundred thousand coins from the coin roll sets that were produced.",
+ "message": "In 2003 Numista calculated a total of {217503} coins issued for coin sets per denomination. Our own calculations found only {177003}. Numista also forgot to include the many hundred thousand coins from the coin roll sets that were produced.",
+ "translation": "In 2003 Numista calculated a total of {217503} coins issued for coin sets per denomination. Our own calculations found only {177003}. Numista also forgot to include the many hundred thousand coins from the coin roll sets that were produced.",
+ "translatorComment": "Copied from source.",
+ "placeholders": [
+ {
+ "id": "217503",
+ "string": "%[1]d",
+ "type": "int",
+ "underlyingType": "int",
+ "argNum": 1,
+ "expr": "217503"
+ },
+ {
+ "id": "177003",
+ "string": "%[2]d",
+ "type": "int",
+ "underlyingType": "int",
+ "argNum": 2,
+ "expr": "177003"
+ }
+ ],
+ "fuzzy": true
+ },
+ {
"id": "Country",
"message": "Country",
"translation": "Country",
@@ -377,6 +434,48 @@
"fuzzy": true
},
{
+ "id": "Circulation Coins",
+ "message": "Circulation Coins",
+ "translation": "Circulation Coins",
+ "translatorComment": "Copied from source.",
+ "fuzzy": true
+ },
+ {
+ "id": "NIFC / BU Sets",
+ "message": "NIFC / BU Sets",
+ "translation": "NIFC / BU Sets",
+ "translatorComment": "Copied from source.",
+ "fuzzy": true
+ },
+ {
+ "id": "Proof Coins",
+ "message": "Proof Coins",
+ "translation": "Proof Coins",
+ "translatorComment": "Copied from source.",
+ "fuzzy": true
+ },
+ {
+ "id": "Filter",
+ "message": "Filter",
+ "translation": "Filter",
+ "translatorComment": "Copied from source.",
+ "fuzzy": true
+ },
+ {
+ "id": "Year",
+ "message": "Year",
+ "translation": "Year",
+ "translatorComment": "Copied from source.",
+ "fuzzy": true
+ },
+ {
+ "id": "Unknown",
+ "message": "Unknown",
+ "translation": "Unknown",
+ "translatorComment": "Copied from source.",
+ "fuzzy": true
+ },
+ {
"id": "Euro Coins",
"message": "Euro Coins",
"translation": "Euro Coins",
diff --git a/i18n/locales/nl/messages.gotext.json b/lib/locales/nl/messages.gotext.json
index 4d5e53b..e3e8170 100644
--- a/i18n/locales/nl/messages.gotext.json
+++ b/lib/locales/nl/messages.gotext.json
@@ -7,89 +7,6 @@
"translation": ""
},
{
- "id": "About Us",
- "message": "About Us",
- "translation": ""
- },
- {
- "id": "Open Source",
- "message": "Open Source",
- "translation": ""
- },
- {
- "id": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
- "message": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
- "translation": "",
- "placeholders": [
- {
- "id": "RepoLinkStart",
- "string": "%[1]s",
- "type": "string",
- "underlyingType": "string",
- "argNum": 1,
- "expr": "repoLinkStart"
- },
- {
- "id": "LinkEnd",
- "string": "%[2]s",
- "type": "string",
- "underlyingType": "string",
- "argNum": 2,
- "expr": "linkEnd"
- }
- ]
- },
- {
- "id": "Contact Us",
- "message": "Contact Us",
- "translation": ""
- },
- {
- "id": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
- "message": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
- "translation": "",
- "placeholders": [
- {
- "id": "ContactEmail",
- "string": "%[1]s",
- "type": "string",
- "underlyingType": "string",
- "argNum": 1,
- "expr": "contactEmail"
- }
- ]
- },
- {
- "id": "Special Thanks",
- "message": "Special Thanks",
- "translation": ""
- },
- {
- "id": "Development",
- "message": "Development",
- "translation": ""
- },
- {
- "id": "Research",
- "message": "Research",
- "translation": ""
- },
- {
- "id": "Translations",
- "message": "Translations",
- "translation": ""
- },
- {
- "id": "British- \u0026 American English",
- "message": "British- \u0026 American English",
- "translation": ""
- },
- {
- "id": "Icelandic",
- "message": "Icelandic",
- "translation": ""
- },
- {
"id": "Andorra",
"message": "Andorra",
"translation": "Andorra"
@@ -210,6 +127,89 @@
"translation": "Vaticaanstad"
},
{
+ "id": "About Us",
+ "message": "About Us",
+ "translation": ""
+ },
+ {
+ "id": "Open Source",
+ "message": "Open Source",
+ "translation": ""
+ },
+ {
+ "id": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
+ "message": "This website is an open project, and a collaboration between developers, translators, and researchers. All source code, data, images, and more for the website are open source and can be found {RepoLinkStart}here{LinkEnd}. This site is licensed under the BSD 0-Clause license giving you the full freedom to do whatever you would like with any of the content on this site.",
+ "translation": "",
+ "placeholders": [
+ {
+ "id": "RepoLinkStart",
+ "string": "%[1]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 1,
+ "expr": "repoLinkStart"
+ },
+ {
+ "id": "LinkEnd",
+ "string": "%[2]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 2,
+ "expr": "linkEnd"
+ }
+ ]
+ },
+ {
+ "id": "Contact Us",
+ "message": "Contact Us",
+ "translation": ""
+ },
+ {
+ "id": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
+ "message": "While we try to stay as up-to-date as possible and to fact check our information, it is always possible that we get something wrong, lack a translation, or are missing some piece of data you may have. In such a case don’t hesitate to contact us; we’ll try to get the site updated or fixed as soon as possible. You are always free to contribute via a git patch if you are more technically included, but if not you can always send an email to {ContactEmail} or contact ‘@onetruemangoman’ on Discord.",
+ "translation": "",
+ "placeholders": [
+ {
+ "id": "ContactEmail",
+ "string": "%[1]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 1,
+ "expr": "contactEmail"
+ }
+ ]
+ },
+ {
+ "id": "Special Thanks",
+ "message": "Special Thanks",
+ "translation": ""
+ },
+ {
+ "id": "Development",
+ "message": "Development",
+ "translation": ""
+ },
+ {
+ "id": "Research",
+ "message": "Research",
+ "translation": ""
+ },
+ {
+ "id": "Translations",
+ "message": "Translations",
+ "translation": ""
+ },
+ {
+ "id": "British- \u0026 American English",
+ "message": "British- \u0026 American English",
+ "translation": ""
+ },
+ {
+ "id": "Icelandic",
+ "message": "Icelandic",
+ "translation": ""
+ },
+ {
"id": "Found a mistake or want to contribute missing information?",
"message": "Found a mistake or want to contribute missing information?",
"translation": ""
@@ -278,11 +278,92 @@
"translation": ""
},
{
+ "id": "Additional Notes",
+ "message": "Additional Notes",
+ "translation": ""
+ },
+ {
+ "id": "Most coins from the years 2003–2016 are listed as NIFC coins while other popular sources such as Numista claim they were minted for circulation. For more information on why others are wrong, {MuntrolpakketLinkStart}click here{LinkEnd}.",
+ "message": "Most coins from the years 2003–2016 are listed as NIFC coins while other popular sources such as Numista claim they were minted for circulation. For more information on why others are wrong, {MuntrolpakketLinkStart}click here{LinkEnd}.",
+ "translation": "",
+ "placeholders": [
+ {
+ "id": "MuntrolpakketLinkStart",
+ "string": "%[1]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 1,
+ "expr": "muntrolpakketLinkStart"
+ },
+ {
+ "id": "LinkEnd",
+ "string": "%[2]s",
+ "type": "string",
+ "underlyingType": "string",
+ "argNum": 2,
+ "expr": "linkEnd"
+ }
+ ]
+ },
+ {
+ "id": "In 2003 Numista calculated a total of {217503} coins issued for coin sets per denomination. Our own calculations found only {177003}. Numista also forgot to include the many hundred thousand coins from the coin roll sets that were produced.",
+ "message": "In 2003 Numista calculated a total of {217503} coins issued for coin sets per denomination. Our own calculations found only {177003}. Numista also forgot to include the many hundred thousand coins from the coin roll sets that were produced.",
+ "translation": "",
+ "placeholders": [
+ {
+ "id": "217503",
+ "string": "%[1]d",
+ "type": "int",
+ "underlyingType": "int",
+ "argNum": 1,
+ "expr": "217503"
+ },
+ {
+ "id": "177003",
+ "string": "%[2]d",
+ "type": "int",
+ "underlyingType": "int",
+ "argNum": 2,
+ "expr": "177003"
+ }
+ ]
+ },
+ {
"id": "Country",
"message": "Country",
"translation": ""
},
{
+ "id": "Circulation Coins",
+ "message": "Circulation Coins",
+ "translation": ""
+ },
+ {
+ "id": "NIFC / BU Sets",
+ "message": "NIFC / BU Sets",
+ "translation": ""
+ },
+ {
+ "id": "Proof Coins",
+ "message": "Proof Coins",
+ "translation": ""
+ },
+ {
+ "id": "Filter",
+ "message": "Filter",
+ "translation": ""
+ },
+ {
+ "id": "Year",
+ "message": "Year",
+ "translation": ""
+ },
+ {
+ "id": "Unknown",
+ "message": "Unknown",
+ "translation": ""
+ },
+ {
"id": "Euro Coins",
"message": "Euro Coins",
"translation": ""
diff --git a/mintage/parser.go b/lib/mintage/parser.go
index 4c5e6f9..4c5e6f9 100644
--- a/mintage/parser.go
+++ b/lib/mintage/parser.go
diff --git a/mintage/parser_test.go b/lib/mintage/parser_test.go
index dd78c71..dd78c71 100644
--- a/mintage/parser_test.go
+++ b/lib/mintage/parser_test.go
diff --git a/main.go b/main.go
index e0c73e6..21a3b1a 100644
--- a/main.go
+++ b/main.go
@@ -2,32 +2,36 @@ package main
import (
"cmp"
+ "context"
"errors"
"flag"
"fmt"
"log"
"math"
"net/http"
+ "os"
+ "path/filepath"
"strconv"
"strings"
- "git.thomasvoss.com/euro-cash.eu/i18n"
- "git.thomasvoss.com/euro-cash.eu/middleware"
- "git.thomasvoss.com/euro-cash.eu/templates"
+ "git.thomasvoss.com/euro-cash.eu/lib"
+ "git.thomasvoss.com/euro-cash.eu/lib/mintage"
+ "git.thomasvoss.com/euro-cash.eu/template"
"github.com/a-h/templ"
)
var components = map[string]templ.Component{
- "/": templates.Root(),
- "/about": templates.About(),
- "/coins": templates.Coins(),
- "/coins/designs": templates.CoinsDesigns(),
- "/coins/designs/nl": templates.CoinsDesignsNl(),
- "/language": templates.Language(),
+ "/": template.Root(),
+ "/about": template.About(),
+ "/coins": template.Coins(),
+ "/coins/designs": template.CoinsDesigns(),
+ "/coins/designs/nl": template.CoinsDesignsNl(),
+ "/coins/mintages": template.CoinsMintages(),
+ "/language": template.Language(),
}
func main() {
- i18n.InitPrinters()
+ lib.InitPrinters()
port := flag.Int("port", 8080, "port number")
flag.Parse()
@@ -38,7 +42,8 @@ func main() {
mux.Handle("GET /favicon.ico", fs)
mux.Handle("GET /fonts/", fs)
mux.Handle("GET /style.css", fs)
- mux.Handle("GET /", middleware.I18n(http.HandlerFunc(finalHandler)))
+ mux.Handle("GET /coins/mintages", i18nHandler(mintageHandler(http.HandlerFunc(finalHandler))))
+ mux.Handle("GET /", i18nHandler(http.HandlerFunc(finalHandler)))
mux.Handle("POST /language", http.HandlerFunc(setUserLanguage))
portStr := ":" + strconv.Itoa(*port)
@@ -47,7 +52,7 @@ func main() {
}
func finalHandler(w http.ResponseWriter, r *http.Request) {
- p := r.Context().Value("printer").(i18n.Printer)
+ p := r.Context().Value("printer").(lib.Printer)
/* Strip trailing slash from the URL */
path := r.URL.Path
@@ -69,15 +74,62 @@ func finalHandler(w http.ResponseWriter, r *http.Request) {
Value: cmp.Or(r.Referer(), "/"),
})
}
- templates.Base(nil, c).Render(r.Context(), w)
+ template.Base(c).Render(r.Context(), w)
}
}
+func i18nHandler(next http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ var p, pZero lib.Printer
+
+ if c, err := r.Cookie("locale"); errors.Is(err, http.ErrNoCookie) {
+ log.Println("Language cookie not set")
+ } else {
+ var ok bool
+ p, ok = lib.Printers[strings.ToLower(c.Value)]
+ if !ok {
+ log.Printf("Language ‘%s’ is unsupported\n", c.Value)
+ }
+ }
+
+ ctx := context.WithValue(
+ r.Context(), "printer", cmp.Or(p, lib.DefaultPrinter))
+
+ if p == pZero {
+ http.SetCookie(w, &http.Cookie{
+ Name: "redirect",
+ Value: r.URL.Path,
+ })
+ template.Base(template.Language()).Render(ctx, w)
+ } else {
+ next.ServeHTTP(w, r.WithContext(ctx))
+ }
+ })
+}
+
+func mintageHandler(next http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ countries := lib.SortedCountries(
+ r.Context().Value("printer").(lib.Printer))
+ code := cmp.Or(r.FormValue("c"), countries[0].Code)
+
+ path := filepath.Join("data", "mintages", code)
+ f, _ := os.Open(path) // TODO: Handle error
+ defer f.Close()
+ set, _ := mintage.Parse(f, path) // TODO: Handle error
+
+ ctx := context.WithValue(r.Context(), "code", code)
+ ctx = context.WithValue(ctx, "set", set)
+ ctx = context.WithValue(ctx, "countries", countries)
+ next.ServeHTTP(w, r.WithContext(ctx))
+ })
+}
+
func setUserLanguage(w http.ResponseWriter, r *http.Request) {
loc := r.FormValue("locale")
- _, ok := i18n.Printers[strings.ToLower(loc)]
+ _, ok := lib.Printers[strings.ToLower(loc)]
if !ok {
- w.WriteHeader(http.StatusBadRequest)
+ w.WriteHeader(http.StatusUnprocessableEntity)
fmt.Fprintf(w, "Locale ‘%s’ is invalid or unsupported", loc)
return
}
diff --git a/middleware/i18n.go b/middleware/i18n.go
deleted file mode 100644
index 921534e..0000000
--- a/middleware/i18n.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package middleware
-
-import (
- "cmp"
- "context"
- "errors"
- "log"
- "net/http"
- "strings"
-
- "git.thomasvoss.com/euro-cash.eu/i18n"
- "git.thomasvoss.com/euro-cash.eu/templates"
-)
-
-func I18n(next http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- var p, pZero i18n.Printer
-
- if c, err := r.Cookie("locale"); errors.Is(err, http.ErrNoCookie) {
- log.Println("Language cookie not set")
- } else {
- var ok bool
- p, ok = i18n.Printers[strings.ToLower(c.Value)]
- if !ok {
- log.Printf("Language ‘%s’ is unsupported\n", c.Value)
- }
- }
-
- ctx := context.WithValue(
- r.Context(), "printer", cmp.Or(p, i18n.DefaultPrinter))
-
- if p == pZero {
- http.SetCookie(w, &http.Cookie{
- Name: "redirect",
- Value: r.URL.Path,
- })
- templates.Base(nil, templates.Language()).Render(ctx, w)
- } else {
- next.ServeHTTP(w, r.WithContext(ctx))
- }
- })
-}
diff --git a/templates/about.templ b/template/about.templ
index 8add2dd..d7dfa06 100644
--- a/templates/about.templ
+++ b/template/about.templ
@@ -1,6 +1,6 @@
-package templates
+package template
-import "git.thomasvoss.com/euro-cash.eu/i18n"
+import "git.thomasvoss.com/euro-cash.eu/lib"
const (
contactEmail = `<a href="mailto:mail@euro-cash.eu">mail@euro-cash.eu</a>`
@@ -9,7 +9,7 @@ const (
)
templ About() {
- {{ p := ctx.Value("printer").(i18n.Printer) }}
+ {{ p := ctx.Value("printer").(lib.Printer) }}
<header>
@navbar()
<h1>{ p.T("About Us") }</h1>
diff --git a/template/base.go b/template/base.go
new file mode 100644
index 0000000..392b1c2
--- /dev/null
+++ b/template/base.go
@@ -0,0 +1,3 @@
+//go:generate templ generate -log-level warn
+
+package template
diff --git a/templates/base.templ b/template/base.templ
index e6c4a1d..bd8c082 100644
--- a/templates/base.templ
+++ b/template/base.templ
@@ -1,9 +1,9 @@
-package templates
+package template
-import "git.thomasvoss.com/euro-cash.eu/i18n"
+import "git.thomasvoss.com/euro-cash.eu/lib"
-templ Base(head, body templ.Component) {
- {{ p := ctx.Value("printer").(i18n.Printer) }}
+templ Base(body templ.Component) {
+ {{ p := ctx.Value("printer").(lib.Printer) }}
<!DOCTYPE html>
<html lang={ p.Locale.Bcp }>
<head>
@@ -12,40 +12,32 @@ templ Base(head, body templ.Component) {
<link rel="stylesheet" type="text/css" href="/style.css"/>
<title>Euro Cash</title>
<script type="text/javascript">
+ const $ = q => document.querySelector(q);
+ const $$ = q => document.querySelectorAll(q);
+
const validate = theme =>
["light", "dark"].includes(theme) ? theme : "light";
-
const toggle = theme =>
theme == "light" ? "dark" : "light";
const setTheme = theme => {
localStorage.setItem("theme", theme);
- document
- .getElementsByTagName("html")[0]
- .setAttribute("data-theme", theme);
- document
- .getElementById(`nav-icon-theme-${theme}`)
- .style.display = '';
- document
- .getElementById(`nav-icon-theme-${toggle(theme)}`)
- .style.display = 'none';
+ $("html").setAttribute("data-theme", theme);
+ $(`#nav-icon-theme-${theme}`)
+ .style.display = "";
+ $(`#nav-icon-theme-${toggle(theme)}`)
+ .style.display = "none";
};
document.addEventListener('DOMContentLoaded', _ => {
- document.getElementById("theme-button").onclick = () => {
+ $("#theme-button").onclick = () =>
setTheme(toggle(validate(localStorage.getItem("theme"))));
- };
setTheme(validate(localStorage.getItem("theme")));
});
</script>
- if head != nil {
- @head
- }
</head>
<body>
- if body != nil {
- @body
- }
+ @body
<footer>
<p>
<small>
diff --git a/templates/coins.templ b/template/coins.templ
index 050d7e8..ef1b0a1 100644
--- a/templates/coins.templ
+++ b/template/coins.templ
@@ -1,11 +1,11 @@
-package templates
+package template
-import "git.thomasvoss.com/euro-cash.eu/i18n"
+import "git.thomasvoss.com/euro-cash.eu/lib"
const newsLinkStart = `<a href="/news">`
templ Coins() {
- {{ p := ctx.Value("printer").(i18n.Printer) }}
+ {{ p := ctx.Value("printer").(lib.Printer) }}
<header>
@navbar()
<h1>{ p.T("Euro Coins") }</h1>
@@ -27,7 +27,7 @@ templ Coins() {
</main>
</article>
</a>
- <a class="no-deco" href="#TODO">
+ <a class="no-deco" href="/coins/mintages">
<article>
<header>
<h3>{ p.T("Mintages") }</h3>
diff --git a/templates/coins_designs.templ b/template/coins_designs.templ
index 4732ab0..de47482 100644
--- a/templates/coins_designs.templ
+++ b/template/coins_designs.templ
@@ -1,21 +1,21 @@
-package templates
+package template
import (
"fmt"
"strings"
- "git.thomasvoss.com/euro-cash.eu/i18n"
+ "git.thomasvoss.com/euro-cash.eu/lib"
)
var varietiesLinkStart = `<a href="/coins/varieties">`
-func makeURL(c country) templ.SafeURL {
- url := fmt.Sprintf("/coins/designs/%s", strings.ToLower(c.code))
+func makeURL(c lib.Country) templ.SafeURL {
+ url := fmt.Sprintf("/coins/designs/%s", c.Code)
return templ.SafeURL(url)
}
templ CoinsDesigns() {
- {{ p := ctx.Value("printer").(i18n.Printer) }}
+ {{ p := ctx.Value("printer").(lib.Printer) }}
<header>
@navbar()
<h1>{ p.T("Euro Coin Designs") }</h1>
@@ -26,14 +26,14 @@ templ CoinsDesigns() {
</p>
<hr/>
<div class="country-grid">
- for _, c := range countries(p, sortByName) {
+ for _, c := range lib.SortedCountries(p) {
<a
role="button"
class="outline"
- data-code={ c.code }
+ data-code={ strings.ToUpper(c.Code) }
href={ makeURL(c) }
>
- { p.T(c.name) }
+ { p.T(c.Name) }
</a>
}
</div>
diff --git a/templates/coins_designs_nl.templ b/template/coins_designs_nl.templ
index d0d82da..819b294 100644
--- a/templates/coins_designs_nl.templ
+++ b/template/coins_designs_nl.templ
@@ -1,9 +1,9 @@
-package templates
+package template
-import "git.thomasvoss.com/euro-cash.eu/i18n"
+import "git.thomasvoss.com/euro-cash.eu/lib"
templ CoinsDesignsNl() {
- {{ p := ctx.Value("printer").(i18n.Printer) }}
+ {{ p := ctx.Value("printer").(lib.Printer) }}
<header>
@navbar()
<h1>{ p.T("Dutch Euro Coin Designs") }</h1>
diff --git a/template/coins_mintages.templ b/template/coins_mintages.templ
new file mode 100644
index 0000000..b6ed2de
--- /dev/null
+++ b/template/coins_mintages.templ
@@ -0,0 +1,112 @@
+package template
+
+import (
+ "strconv"
+
+ "git.thomasvoss.com/euro-cash.eu/lib"
+ "git.thomasvoss.com/euro-cash.eu/lib/mintage"
+)
+
+const muntrolpakketLinkStart = `<a href="#TODO">`
+
+var denoms = [...]float64{
+ 0.01, 0.02, 0.05, 0.10,
+ 0.20, 0.50, 1.00, 2.00,
+}
+
+templ CoinsMintages() {
+ {{
+ code := ctx.Value("code").(string)
+ set := ctx.Value("set").(mintage.Set)
+ p := ctx.Value("printer").(lib.Printer)
+ }}
+ <header>
+ @navbar()
+ <h1>{ p.T("Euro Coin Mintages") }</h1>
+ </header>
+ <main>
+ <p>
+ { p.T("Here you’ll be able to view all the known mintages for all coins. You’ll also be able to filter on country, denomination, etc. If you have any mintage data that’s missing from our site, feel free to contact us.") }
+ </p>
+ <hr/>
+ if code == "nl" {
+ <h2>{ p.T("Additional Notes") }</h2>
+ <ul>
+ <li>
+ @templ.Raw(p.T("Most coins from the years 2003–2016 are listed as NIFC coins while other popular sources such as Numista claim they were minted for circulation. For more information on why others are wrong, %sclick here%s.", muntrolpakketLinkStart, linkEnd))
+ </li>
+ <li>
+ { p.T("In 2003 Numista calculated a total of %d coins issued for coin sets per denomination. Our own calculations found only %d. Numista also forgot to include the many hundred thousand coins from the coin roll sets that were produced.", 217503, 177003) }
+ </li>
+ </ul>
+ }
+ <section>
+ <form>
+ <div class="grid">
+ <label for="country-dd">
+ { p.T("Country") }
+ <select id="country-dd" name="c">
+ for _, c := range ctx.Value("countries").
+ ([]lib.Country) {
+ <option
+ value={ c.Code }
+ selected?={ c.Code == code }
+ >
+ { c.Name }
+ </option>
+ }
+ </select>
+ </label>
+ <fieldset>
+ <label for="compact-circ">
+ <input id="compact-circ" type="checkbox" name="circ" checked/>
+ { p.T("Circulation Coins") }
+ </label>
+ <label for="compact-nifc">
+ <input id="compact-nifc" type="checkbox" name="nifc"/>
+ { p.T("NIFC / BU Sets") }
+ </label>
+ <label for="compact-proof">
+ <input id="compact-proof" type="checkbox" name="proof"/>
+ { p.T("Proof Coins") }
+ </label>
+ </fieldset>
+ </div>
+ <button type="submit">{ p.T("Filter") }</button>
+ </form>
+ <figure>
+ <table class="mintage-table" role="grid">
+ <thead>
+ <th>{ p.T("Year") }</th>
+ for _, x := range denoms {
+ <th>{ p.Money(x, false) }</th>
+ }
+ </thead>
+ <tbody>
+ for _, row := range set.Circ {
+ <tr>
+ <th scope="col">
+ if row.Mintmark != "" {
+ { strconv.Itoa(row.Year) }&nbsp;<sub><small>{ row.Mintmark }</small></sub>
+ } else {
+ { strconv.Itoa(row.Year) }
+ }
+ </th>
+ for _, col := range row.Cols {
+ switch col {
+ case mintage.Unknown:
+ <td>{ p.T("Unknown") }</td>
+ case 0:
+ <td>—</td>
+ default:
+ <td>{ p.N(col) }</td>
+ }
+ }
+ </tr>
+ }
+ </tbody>
+ </table>
+ </figure>
+ </section>
+ </main>
+}
diff --git a/templates/language.templ b/template/language.templ
index 58dc8b6..1b48295 100644
--- a/templates/language.templ
+++ b/template/language.templ
@@ -1,13 +1,13 @@
-package templates
+package template
import (
"strings"
- "git.thomasvoss.com/euro-cash.eu/i18n"
+ "git.thomasvoss.com/euro-cash.eu/lib"
)
templ Language() {
- {{ p := ctx.Value("printer").(i18n.Printer) }}
+ {{ p := ctx.Value("printer").(lib.Printer) }}
<header>
@navbar()
<h1>{ p.T("Select Your Language") }</h1>
@@ -32,7 +32,7 @@ templ Language() {
templ languageGrid(eurozone bool) {
<form action="/language" method="POST">
<div class="lang-grid">
- for _, loc := range i18n.Locales {
+ for _, loc := range lib.Locales {
if loc.Eurozone == eurozone {
<button
type="submit"
diff --git a/templates/navbar.templ b/template/navbar.templ
index f0b030c..2aceac2 100644
--- a/templates/navbar.templ
+++ b/template/navbar.templ
@@ -1,9 +1,9 @@
-package templates
+package template
-import "git.thomasvoss.com/euro-cash.eu/i18n"
+import "git.thomasvoss.com/euro-cash.eu/lib"
templ navbar() {
- {{ p := ctx.Value("printer").(i18n.Printer) }}
+ {{ p := ctx.Value("printer").(lib.Printer) }}
<nav>
<menu>
<li><a href="/">{ p.T("Home") }</a></li>
diff --git a/templates/root.templ b/template/root.templ
index bfe9210..657314c 100644
--- a/templates/root.templ
+++ b/template/root.templ
@@ -1,9 +1,9 @@
-package templates
+package template
-import "git.thomasvoss.com/euro-cash.eu/i18n"
+import "git.thomasvoss.com/euro-cash.eu/lib"
templ Root() {
- {{ p := ctx.Value("printer").(i18n.Printer) }}
+ {{ p := ctx.Value("printer").(lib.Printer) }}
<header>
@navbar()
<hgroup>
diff --git a/templates/base.go b/templates/base.go
deleted file mode 100644
index 76a4da6..0000000
--- a/templates/base.go
+++ /dev/null
@@ -1,63 +0,0 @@
-//go:generate templ generate -log-level warn
-
-package templates
-
-import (
- "fmt"
- "slices"
-
- "git.thomasvoss.com/euro-cash.eu/i18n"
- "golang.org/x/text/collate"
- "golang.org/x/text/language"
-)
-
-type country struct {
- code, name string
-}
-
-type sortType int
-
-const (
- sortByCode sortType = iota
- sortByName
-)
-
-func countries(p i18n.Printer, sort sortType) []country {
- xs := []country{
- {code: "AD", name: p.T("Andorra")},
- {code: "AT", name: p.T("Austria")},
- {code: "BE", name: p.T("Belgium")},
- {code: "CY", name: p.T("Cyprus")},
- {code: "DE", name: p.T("Germany")},
- {code: "EE", name: p.T("Estonia")},
- {code: "ES", name: p.T("Spain")},
- {code: "FI", name: p.T("Finland")},
- {code: "FR", name: p.T("France")},
- {code: "GR", name: p.T("Greece")},
- {code: "HR", name: p.T("Croatia")},
- {code: "IE", name: p.T("Ireland")},
- {code: "IT", name: p.T("Italy")},
- {code: "LT", name: p.T("Lithuania")},
- {code: "LU", name: p.T("Luxembourg")},
- {code: "LV", name: p.T("Latvia")},
- {code: "MC", name: p.T("Monaco")},
- {code: "MT", name: p.T("Malta")},
- {code: "NL", name: p.T("Netherlands")},
- {code: "PT", name: p.T("Portugal")},
- {code: "SI", name: p.T("Slovenia")},
- {code: "SK", name: p.T("Slovakia")},
- {code: "SM", name: p.T("San Marino")},
- {code: "VA", name: p.T("Vatican City")},
- }
- switch sort {
- case sortByCode:
- case sortByName:
- c := collate.New(language.MustParse(p.Locale.Bcp))
- slices.SortFunc(xs, func(x, y country) int {
- return c.CompareString(x.name, y.name)
- })
- default:
- panic(fmt.Sprintf("Attempted to sort by invalid sortType=%d", sort))
- }
- return xs
-}