diff options
author | Thomas Voss <mail@thomasvoss.com> | 2025-08-02 18:50:00 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2025-08-02 18:50:00 +0200 |
commit | 1e275c07b6de4864f8048777e3302ded20a11b34 (patch) | |
tree | 175fdf8e31e8663d4d123ae8400827c6016abaf2 /src | |
parent | 032d880706f4a2b3b66ab652d71455e74b5dbef6 (diff) |
Use the new Wikipedia module
Diffstat (limited to 'src')
-rw-r--r-- | src/i18n/i18n.go | 6 | ||||
-rw-r--r-- | src/templates/coins-designs-ad.html.tmpl | 2 | ||||
-rw-r--r-- | src/templates/coins-designs-be.html.tmpl | 2 | ||||
-rw-r--r-- | src/templates/coins-designs-de.html.tmpl | 2 | ||||
-rw-r--r-- | src/templates/coins-designs-ee.html.tmpl | 4 | ||||
-rw-r--r-- | src/templates/coins-designs-hr.html.tmpl | 6 | ||||
-rw-r--r-- | src/wikipedia/links.gen.go | 11 |
7 files changed, 21 insertions, 12 deletions
diff --git a/src/i18n/i18n.go b/src/i18n/i18n.go index b356478..7510b98 100644 --- a/src/i18n/i18n.go +++ b/src/i18n/i18n.go @@ -16,6 +16,8 @@ import ( "git.thomasvoss.com/euro-cash.eu/pkg/atexit" "git.thomasvoss.com/euro-cash.eu/pkg/watch" "github.com/leonelquinteros/gotext" + + "git.thomasvoss.com/euro-cash.eu/src/wikipedia" ) type Printer struct { @@ -96,6 +98,10 @@ func Locales() []LocaleInfo { return locales[:] } +func (p Printer) Wikipedia(title string) string { + return wikipedia.Url(title, p.Bcp) +} + func (p Printer) Get(fmt string, args ...map[string]any) string { return p.Sprintf(p.inner.Get(fmt), args...) } diff --git a/src/templates/coins-designs-ad.html.tmpl b/src/templates/coins-designs-ad.html.tmpl index 6db744a..cc68a91 100644 --- a/src/templates/coins-designs-ad.html.tmpl +++ b/src/templates/coins-designs-ad.html.tmpl @@ -54,7 +54,7 @@ </p> <p> {{ .Get "Finally, the €2 coin features the {Link:L}coat of arms of Andorra{-:E}." - (map "Link" "https://en.wikipedia.org/wiki/Coat_of_arms_of_Andorra") }} + (map "Link" (.Printer.Wikipedia "Coat of arms of Andorra")) }} </p> </main> {{ end }}
\ No newline at end of file diff --git a/src/templates/coins-designs-be.html.tmpl b/src/templates/coins-designs-be.html.tmpl index 618c2e4..6bf0759 100644 --- a/src/templates/coins-designs-be.html.tmpl +++ b/src/templates/coins-designs-be.html.tmpl @@ -25,7 +25,7 @@ </div> <p> {{ .Get "Since 1999 Belgium has released three series of euro coins, with each series having a single design repeated on all denominations. Starting in 1999 the Belgian euro coins featured the portrait of King Albert II with the {Link:L}royal monogram{-:E} in the outer ring of the coins." - (map "Link" "https://www.wikipedia.org/wiki/Royal_cypher") }} + (map "Link" (.Printer.Wikipedia "Royal cypher")) }} </p> <p> {{ .Get "In 2008 a second series of coins was released featuring a slightly modified design in which the royal monogram was moved to the inner portion of the coin along with the year of mintage in order to comply with the European Commission’s guidelines. The country code ‘BE’ was also added to the design underneath the royal monogram. The 2008 redesign also saw the use of a slightly modified portrait of the King, but this design change was reverted in 2009." }} diff --git a/src/templates/coins-designs-de.html.tmpl b/src/templates/coins-designs-de.html.tmpl index 37e03a5..702b5fc 100644 --- a/src/templates/coins-designs-de.html.tmpl +++ b/src/templates/coins-designs-de.html.tmpl @@ -58,7 +58,7 @@ </p> <p> {{ .Get "The €1 and €2 coins feature an interpretation of the German Federal Eagle (German: ‘{GermanStart:r}Bundesadler{GermanEnd:E}’). The eagle is a common motif in German heraldry — including in the {Link:L}German coat of arms{-:E} — and represents strength and freedom. The mint mark is located to the right of the year." - (map "Link" "https://en.wikipedia.org/wiki/Coat_of_arms_of_Germany") $deargs }} + (map "Link" (.Printer.Wikipedia "Coat of arms of Germany")) $deargs }} </p> <p> <!-- TODO: Get a picture of the edge-inscription --> diff --git a/src/templates/coins-designs-ee.html.tmpl b/src/templates/coins-designs-ee.html.tmpl index af84768..53cb35b 100644 --- a/src/templates/coins-designs-ee.html.tmpl +++ b/src/templates/coins-designs-ee.html.tmpl @@ -19,8 +19,8 @@ (map "EstonianStart" `<span lang="et"><em>` "EstonianEnd" "em,span") }} </p> <p> - {{ .Get "The design of the Estonian euro coins was chosen as part of a {EVLink:L}Eurovision{-:E}-style public televote where it competed and won against 9 other designs." - (map "EVLink" "https://en.wikipedia.org/wiki/Eurovision_Song_Contest" ) }} + {{ .Get "The design of the Estonian euro coins was chosen as part of a {Link:L}Eurovision{-:E}-style public televote where it competed and won against 9 other designs." + (map "Link" (.Printer.Wikipedia "Eurovision Song Contest")) }} </p> <p> {{ .Get "In June 2004 a public design competition was announced with a deadline for the 19th of October. In total 134 designs were submitted by the deadline and 10 designs were selected by a jury. These 10 designs were then voted on in a public vote over the course of one week. In total 45,453 people voted and the current design won with a total of 12,482 votes (27.46%)." }} diff --git a/src/templates/coins-designs-hr.html.tmpl b/src/templates/coins-designs-hr.html.tmpl index 2112bb1..a0d3361 100644 --- a/src/templates/coins-designs-hr.html.tmpl +++ b/src/templates/coins-designs-hr.html.tmpl @@ -23,11 +23,11 @@ </p> <p> {{ .Get "The 1-, 2- and 5 euro cent coins were designed by Maja Škripelj and feature a motif of the letters ‘ⰘⰓ’ from the {Link:L}Glagolitic script{-:E} — an old Slavic script that saw use in Croatia up until the 19th century — representing Croatia’s country code (‘HR’ in the Latin alphabet)." - (map "Link" "https://www.wikipedia.org/wiki/Glagolitic_script") }} + (map "Link" (.Printer.Wikipedia "Glagolitic script")) }} </p> <p> {{ .Get "The 10-, 20- and 50 euro cent coins were designed by Ivan Domagoj Račić and feature the portrait of the inventor and engineer {Link:L}Nikola Tesla{-:E}. The design of these coins caused controversy when they were first announced with the National Bank of Serbia claiming that it would be an appropriation of the cultural and scientific heritage of the Serbian people to feature the portrait of someone who ‘declared himself to be Serbian by origin’." - (map "Link" "https://www.wikipedia.org/wiki/Nikola_Tesla") }} + (map "Link" (.Printer.Wikipedia "Nikola Tesla")) }} </p> <p> {{ .Get "The 1 euro coin was designed by Jagor Šunde, David Čemeljić and Fran Zekan and features a marten. The marten is the semi-official national animal of Croatia and the Kuna — their pre-Euro currency — was named after the marten (‘{CroatianStart:r}kuna zlatica{CroatianEnd:E}’ in Croatian)." @@ -36,7 +36,7 @@ <p> <!-- TODO: Include a photo of the edge inscription --> {{ .Get "The 2 euro coin was designed by Ivan Šivak and features the map of Croatia. The coin also has an edge-inscription that reads ‘{CroatianStart:r}O LIJEPA O DRAGA O SLATKA SLOBODO{CroatianEnd:E}’ (English: ‘OH BEAUTIFUL, OH DEAR, OH SWEET FREEDOM’) which is a line from the play {Link:L}Dubravka{-:E} by Ivan Gundulić." - $hrargs (map "Link" "https://www.wikipedia.org/wiki/Dubravka_(drama)") }} + $hrargs (map "Link" (.Printer.Wikipedia "Dubravka (drama)")) }} </p> </main> {{ end }}
\ No newline at end of file diff --git a/src/wikipedia/links.gen.go b/src/wikipedia/links.gen.go index 2aa3c39..9e491fd 100644 --- a/src/wikipedia/links.gen.go +++ b/src/wikipedia/links.gen.go @@ -3,8 +3,11 @@ package wikipedia /* TODO: Extract these programmatically */ var extractedTitles = [...]string{ - "Coat_of_arms_of_Andorra", - "Coat_of_arms_of_Bulgaria", - "Coat_of_arms_of_Croatia", - "Coat_of_arms_of_Germany", + "Coat of arms of Andorra", + "Royal cypher", + "Coat of arms of Germany", + "Eurovision Song Contest", + "Nikola Tesla", + "Glagolitic script", + "Dubravka (drama)", } |