aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2025-08-01 20:50:38 +0200
committerThomas Voss <mail@thomasvoss.com> 2025-08-01 20:50:38 +0200
commitc60251ec546224a7eef10fd873c56fd1e3caadd1 (patch)
tree8175bf3b7a39551f98a5df343f91d376b6b3fc06 /src
parent1d10750ce6d048b8fdf0921e78b812451292b470 (diff)
Use context for country names
Diffstat (limited to 'src')
-rw-r--r--src/countries.go50
-rw-r--r--src/templates/banknotes-codes.html.tmpl90
2 files changed, 70 insertions, 70 deletions
diff --git a/src/countries.go b/src/countries.go
index d209c65..8e69f50 100644
--- a/src/countries.go
+++ b/src/countries.go
@@ -15,32 +15,32 @@ type country struct {
func sortedCountries(p i18n.Printer) []country {
xs := []country{
- {Code: "ad", Name: p.Get("Andorra")},
- {Code: "at", Name: p.Get("Austria")},
- {Code: "be", Name: p.Get("Belgium")},
+ {Code: "ad", Name: p.GetC("Andorra", "Country Name")},
+ {Code: "at", Name: p.GetC("Austria", "Country Name")},
+ {Code: "be", Name: p.GetC("Belgium", "Country Name")},
/* TODO(2026): Add Bulgaria */
- /* {Code: "bg", Name: p.Get("Bulgaria")}, */
- {Code: "cy", Name: p.Get("Cyprus")},
- {Code: "de", Name: p.Get("Germany")},
- {Code: "ee", Name: p.Get("Estonia")},
- {Code: "es", Name: p.Get("Spain")},
- {Code: "fi", Name: p.Get("Finland")},
- {Code: "fr", Name: p.Get("France")},
- {Code: "gr", Name: p.Get("Greece")},
- {Code: "hr", Name: p.Get("Croatia")},
- {Code: "ie", Name: p.Get("Ireland")},
- {Code: "it", Name: p.Get("Italy")},
- {Code: "lt", Name: p.Get("Lithuania")},
- {Code: "lu", Name: p.Get("Luxembourg")},
- {Code: "lv", Name: p.Get("Latvia")},
- {Code: "mc", Name: p.Get("Monaco")},
- {Code: "mt", Name: p.Get("Malta")},
- {Code: "nl", Name: p.Get("Netherlands")},
- {Code: "pt", Name: p.Get("Portugal")},
- {Code: "si", Name: p.Get("Slovenia")},
- {Code: "sk", Name: p.Get("Slovakia")},
- {Code: "sm", Name: p.Get("San Marino")},
- {Code: "va", Name: p.Get("Vatican City")},
+ /* {Code: "bg", Name: p.GetC("Bulgaria", "Country Name")}, */
+ {Code: "cy", Name: p.GetC("Cyprus", "Country Name")},
+ {Code: "de", Name: p.GetC("Germany", "Country Name")},
+ {Code: "ee", Name: p.GetC("Estonia", "Country Name")},
+ {Code: "es", Name: p.GetC("Spain", "Country Name")},
+ {Code: "fi", Name: p.GetC("Finland", "Country Name")},
+ {Code: "fr", Name: p.GetC("France", "Country Name")},
+ {Code: "gr", Name: p.GetC("Greece", "Country Name")},
+ {Code: "hr", Name: p.GetC("Croatia", "Country Name")},
+ {Code: "ie", Name: p.GetC("Ireland", "Country Name")},
+ {Code: "it", Name: p.GetC("Italy", "Country Name")},
+ {Code: "lt", Name: p.GetC("Lithuania", "Country Name")},
+ {Code: "lu", Name: p.GetC("Luxembourg", "Country Name")},
+ {Code: "lv", Name: p.GetC("Latvia", "Country Name")},
+ {Code: "mc", Name: p.GetC("Monaco", "Country Name")},
+ {Code: "mt", Name: p.GetC("Malta", "Country Name")},
+ {Code: "nl", Name: p.GetC("Netherlands", "Country Name")},
+ {Code: "pt", Name: p.GetC("Portugal", "Country Name")},
+ {Code: "si", Name: p.GetC("Slovenia", "Country Name")},
+ {Code: "sk", Name: p.GetC("Slovakia", "Country Name")},
+ {Code: "sm", Name: p.GetC("San Marino", "Country Name")},
+ {Code: "va", Name: p.GetC("Vatican City", "Country Name")},
}
c := collate.New(language.MustParse(p.Bcp))
slices.SortFunc(xs, func(x, y country) int {
diff --git a/src/templates/banknotes-codes.html.tmpl b/src/templates/banknotes-codes.html.tmpl
index a921644..2ff6395 100644
--- a/src/templates/banknotes-codes.html.tmpl
+++ b/src/templates/banknotes-codes.html.tmpl
@@ -58,67 +58,67 @@
<tbody>
<tr>
<td>D</td>
- <td>{{ .Get "Estonia" }}</td>
+ <td>{{ .GetC "Estonia" "Country Name" }}</td>
</tr>
<tr>
<td>E</td>
- <td>{{ .Get "Slovakia" }}</td>
+ <td>{{ .GetC "Slovakia" "Country Name" }}</td>
</tr>
<tr>
<td>F</td>
- <td>{{ .Get "Malta" }}</td>
+ <td>{{ .GetC "Malta" "Country Name" }}</td>
</tr>
<tr>
<td>G</td>
- <td>{{ .Get "Cyprus" }}</td>
+ <td>{{ .GetC "Cyprus" "Country Name" }}</td>
</tr>
<tr>
<td>H</td>
- <td>{{ .Get "Slovenia" }}</td>
+ <td>{{ .GetC "Slovenia" "Country Name" }}</td>
</tr>
<tr>
<td>L</td>
- <td>{{ .Get "Finland" }}</td>
+ <td>{{ .GetC "Finland" "Country Name" }}</td>
</tr>
<tr>
<td>M</td>
- <td>{{ .Get "Portugal" }}</td>
+ <td>{{ .GetC "Portugal" "Country Name" }}</td>
</tr>
<tr>
<td>N</td>
- <td>{{ .Get "Austria" }}</td>
+ <td>{{ .GetC "Austria" "Country Name" }}</td>
</tr>
<tr>
<td>P</td>
- <td>{{ .Get "Netherlands" }}</td>
+ <td>{{ .GetC "Netherlands" "Country Name" }}</td>
</tr>
<tr>
<td>S</td>
- <td>{{ .Get "Italy" }}</td>
+ <td>{{ .GetC "Italy" "Country Name" }}</td>
</tr>
<tr>
<td>T</td>
- <td>{{ .Get "Ireland" }}</td>
+ <td>{{ .GetC "Ireland" "Country Name" }}</td>
</tr>
<tr>
<td>U</td>
- <td>{{ .Get "France" }}</td>
+ <td>{{ .GetC "France" "Country Name" }}</td>
</tr>
<tr>
<td>V</td>
- <td>{{ .Get "Spain" }}</td>
+ <td>{{ .GetC "Spain" "Country Name" }}</td>
</tr>
<tr>
<td>X</td>
- <td>{{ .Get "Germany" }}</td>
+ <td>{{ .GetC "Germany" "Country Name" }}</td>
</tr>
<tr>
<td>Y</td>
- <td>{{ .Get "Greece" }}</td>
+ <td>{{ .GetC "Greece" "Country Name" }}</td>
</tr>
<tr>
<td>Z</td>
- <td>{{ .Get "Belgium" }}</td>
+ <td>{{ .GetC "Belgium" "Country Name" }}</td>
</tr>
</tbody>
</table>
@@ -138,17 +138,17 @@
<tbody>
<tr>
<td>D</td>
- <td>{{ .Get "Finland" }}</td>
+ <td>{{ .GetC "Finland" "Country Name" }}</td>
<td>SETEC</td>
</tr>
<tr>
<td>E</td>
- <td>{{ .Get "France" }}</td>
+ <td>{{ .GetC "France" "Country Name" }}</td>
<td>Oberthur</td>
</tr>
<tr>
<td>F</td>
- <td>{{ .Get "Austria" }}</td>
+ <td>{{ .GetC "Austria" "Country Name" }}</td>
<td>
<span lang="de">
Österreichische Banknoten- und Sicherheitsdruck GmbH
@@ -157,57 +157,57 @@
</tr>
<tr>
<td>G</td>
- <td>{{ .Get "Netherlands" }}</td>
+ <td>{{ .GetC "Netherlands" "Country Name" }}</td>
<td><span lang="nl">Koninklijke Joh. Enschedé</span></td>
</tr>
<tr>
<td>H</td>
- <td>{{ .Get "United Kingdom" }}</td>
+ <td>{{ .GetC "United Kingdom" "Country Name" }}</td>
<td>De La Rue</td>
</tr>
<tr>
<td>J</td>
- <td>{{ .Get "Italy" }}</td>
+ <td>{{ .GetC "Italy" "Country Name" }}</td>
<td>{{ .Get "Bank of Italy" }}</td>
</tr>
<tr>
<td>K</td>
- <td>{{ .Get "Ireland" }}</td>
+ <td>{{ .GetC "Ireland" "Country Name" }}</td>
<td>{{ .Get "Central Bank of Ireland" }}</td>
</tr>
<tr>
<td>L</td>
- <td>{{ .Get "France" }}</td>
+ <td>{{ .GetC "France" "Country Name" }}</td>
<td>{{ .Get "Bank of France" }}</td>
</tr>
<tr>
<td>M</td>
- <td>{{ .Get "Spain" }}</td>
+ <td>{{ .GetC "Spain" "Country Name" }}</td>
<td>{{ .Get "Royal Mint of Spain" }}</td>
</tr>
<tr>
<td>N</td>
- <td>{{ .Get "Greece" }}</td>
+ <td>{{ .GetC "Greece" "Country Name" }}</td>
<td>{{ .Get "Bank of Greece" }}</td>
</tr>
<tr>
<td>P</td>
- <td>{{ .Get "Germany" }}</td>
+ <td>{{ .GetC "Germany" "Country Name" }}</td>
<td>Giesecke+Devrient GmbH</td>
</tr>
<tr>
<td>R</td>
- <td>{{ .Get "Germany" }}</td>
+ <td>{{ .GetC "Germany" "Country Name" }}</td>
<td><span lang="de">Bundesdruckerei GmbH</span></td>
</tr>
<tr>
<td>T</td>
- <td>{{ .Get "Belgium" }}</td>
+ <td>{{ .GetC "Belgium" "Country Name" }}</td>
<td>{{ .Get "National Bank of Belgium" }}</td>
</tr>
<tr>
<td>U</td>
- <td>{{ .Get "Portugal" }}</td>
+ <td>{{ .GetC "Portugal" "Country Name" }}</td>
<td>Valora S.A.</td>
</tr>
</tbody>
@@ -227,22 +227,22 @@
</thead>
<tr>
<td>E</td>
- <td>{{ .Get "France" }}</td>
+ <td>{{ .GetC "France" "Country Name" }}</td>
<td>Oberthur</td>
</tr>
<tr>
<td>F</td>
- <td>{{ .Get "Bulgaria" }}</td>
+ <td>{{ .GetC "Bulgaria" "Country Name" }}</td>
<td>Oberthur Fiduciaire AD</td>
</tr>
<tr>
<td>M</td>
- <td>{{ .Get "Portugal" }}</td>
+ <td>{{ .GetC "Portugal" "Country Name" }}</td>
<td>Valora S.A.</td>
</tr>
<tr>
<td>N</td>
- <td>{{ .Get "Austria" }}</td>
+ <td>{{ .GetC "Austria" "Country Name" }}</td>
<td>
<span lang="de">
Österreichische Banknoten- und Sicherheitsdruck GmbH
@@ -251,52 +251,52 @@
</tr>
<tr>
<td>P</td>
- <td>{{ .Get "Netherlands" }}</td>
+ <td>{{ .GetC "Netherlands" "Country Name" }}</td>
<td><span lang="nl">Koninklijke Joh. Enschedé</span></td>
</tr>
<tr>
<td>R</td>
- <td>{{ .Get "Germany" }}</td>
+ <td>{{ .GetC "Germany" "Country Name" }}</td>
<td><span lang="de">Bundesdruckerei GmbH</span></td>
</tr>
<tr>
<td>S</td>
- <td>{{ .Get "Italy" }}</td>
+ <td>{{ .GetC "Italy" "Country Name" }}</td>
<td>{{ .Get "Bank of Italy" }}</td>
</tr>
<tr>
<td>T</td>
- <td>{{ .Get "Ireland" }}</td>
+ <td>{{ .GetC "Ireland" "Country Name" }}</td>
<td>{{ .Get "Central Bank of Ireland" }}</td>
</tr>
<tr>
<td>U</td>
- <td>{{ .Get "France" }}</td>
+ <td>{{ .GetC "France" "Country Name" }}</td>
<td>{{ .Get "Bank of France" }}</td>
</tr>
<tr>
<td>V</td>
- <td>{{ .Get "Spain" }}</td>
+ <td>{{ .GetC "Spain" "Country Name" }}</td>
<td>{{ .Get "Royal Mint of Spain" }}</td>
</tr>
<tr>
<td>W</td>
- <td>{{ .Get "Germany" }}</td>
+ <td>{{ .GetC "Germany" "Country Name" }}</td>
<td>Giesecke+Devrient GmbH {{ .Get "Leipzig" }}</td>
</tr>
<tr>
<td>X</td>
- <td>{{ .Get "Germany" }}</td>
+ <td>{{ .GetC "Germany" "Country Name" }}</td>
<td>Giesecke+Devrient GmbH {{ .Get "Munich" }}</td>
</tr>
<tr>
<td>Y</td>
- <td>{{ .Get "Greece" }}</td>
+ <td>{{ .GetC "Greece" "Country Name" }}</td>
<td>{{ .Get "Bank of Greece" }}</td>
</tr>
<tr>
<td>Z</td>
- <td>{{ .Get "Belgium" }}</td>
+ <td>{{ .GetC "Belgium" "Country Name" }}</td>
<td>{{ .Get "National Bank of Belgium" }}</td>
</tr>
</table>
@@ -316,4 +316,4 @@
alt={{ $p.GetN "Printer code on a {N} euro bill" "Printer code on a {N} euro bill" $d $args }}
>
</details>
-{{ end }}
+{{ end }} \ No newline at end of file