diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/i18n/i18n.go | 62 | ||||
-rw-r--r-- | src/templates/-404.html.tmpl | 2 | ||||
-rw-r--r-- | src/templates/-error.html.tmpl | 4 |
3 files changed, 35 insertions, 33 deletions
diff --git a/src/i18n/i18n.go b/src/i18n/i18n.go index fdc02f6..b996681 100644 --- a/src/i18n/i18n.go +++ b/src/i18n/i18n.go @@ -21,7 +21,8 @@ type LocaleInfo struct { Eurozone, Enabled bool DateFormat string GroupSeparator, DecimalSeparator rune - MonetaryPre, MonetaryPost [2]string + MonetaryPre [2]string + MonetaryPost string } type number interface { @@ -53,7 +54,7 @@ var ( GroupSeparator: '.', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, { Bcp: "de", @@ -64,7 +65,7 @@ var ( GroupSeparator: '.', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, { Bcp: "el", @@ -75,7 +76,7 @@ var ( GroupSeparator: '.', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, { Bcp: "en", @@ -96,7 +97,7 @@ var ( GroupSeparator: '.', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, { Bcp: "et", @@ -107,7 +108,7 @@ var ( GroupSeparator: ' ', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, { Bcp: "fi", @@ -118,7 +119,7 @@ var ( GroupSeparator: ' ', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, { Bcp: "fr", @@ -129,7 +130,7 @@ var ( GroupSeparator: ' ', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, { Bcp: "ga", @@ -150,7 +151,7 @@ var ( GroupSeparator: '.', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, { Bcp: "it", @@ -161,7 +162,7 @@ var ( GroupSeparator: '.', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, { Bcp: "lb", @@ -172,7 +173,7 @@ var ( GroupSeparator: '.', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, { Bcp: "lt", @@ -183,7 +184,7 @@ var ( GroupSeparator: ' ', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, { Bcp: "lv", @@ -194,7 +195,7 @@ var ( GroupSeparator: ' ', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, { Bcp: "mt", @@ -235,7 +236,7 @@ var ( GroupSeparator: ' ', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, { Bcp: "sl", @@ -246,7 +247,7 @@ var ( GroupSeparator: '.', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, { Bcp: "sv", @@ -257,7 +258,7 @@ var ( GroupSeparator: ' ', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, /* Non-Eurozone locales */ { @@ -269,14 +270,17 @@ var ( GroupSeparator: ' ', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, { - Bcp: "en-US", - Name: "English (US)", - DateFormat: "1/2/2006", - Eurozone: false, - Enabled: false, + Bcp: "en-US", + Name: "English (US)", + DateFormat: "1/2/2006", + Eurozone: false, + Enabled: false, + GroupSeparator: ',', + DecimalSeparator: '.', + MonetaryPre: [2]string{"€", "-€"}, }, { Bcp: "ro", @@ -287,7 +291,7 @@ var ( GroupSeparator: '.', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, { Bcp: "uk", @@ -298,7 +302,7 @@ var ( GroupSeparator: ' ', DecimalSeparator: ',', MonetaryPre: [2]string{"", "-"}, - MonetaryPost: [2]string{" €", " €"}, + MonetaryPost: " €", }, } /* Map of language codes to printers. We do this instead of just @@ -469,16 +473,14 @@ func sprintfm(li LocaleInfo, bob *strings.Builder, v any) error { switch v.(type) { case int: n := v.(int) - i := btoi(n >= 0) - htmlesc(bob, li.MonetaryPre[i]) + htmlesc(bob, li.MonetaryPre[btoi(n >= 0)]) writeInt(bob, abs(n), li.GroupSeparator) - htmlesc(bob, li.MonetaryPost[i]) + htmlesc(bob, li.MonetaryPost) case float64: n := v.(float64) - i := btoi(n >= 0) - htmlesc(bob, li.MonetaryPre[i]) + htmlesc(bob, li.MonetaryPre[btoi(n >= 0)]) writeFloat(bob, abs(n), li.GroupSeparator, li.DecimalSeparator) - htmlesc(bob, li.MonetaryPost[i]) + htmlesc(bob, li.MonetaryPost) default: return errors.New("TODO") } diff --git a/src/templates/-404.html.tmpl b/src/templates/-404.html.tmpl index 06ac02b..03602e1 100644 --- a/src/templates/-404.html.tmpl +++ b/src/templates/-404.html.tmpl @@ -5,7 +5,7 @@ </header> <main> <p> - {{ .Get "The page you were looking for does not exist. If you believe this is a mistake then don’t hesitate to contact ‘@onetruemangoman’ on Discord or email us at %(Email:e)." + {{ .Get "The page you were looking for does not exist. If you believe this is a mistake then don’t hesitate to contact ‘@onetruemangoman’ on Discord or email us at {Email:e}." (map "Email" "mail@euro-cash.eu") }} </p> </main> diff --git a/src/templates/-error.html.tmpl b/src/templates/-error.html.tmpl index 5b8258b..a18ec3e 100644 --- a/src/templates/-error.html.tmpl +++ b/src/templates/-error.html.tmpl @@ -8,8 +8,8 @@ {{ .Get "If you’re seeing this page, it means that something went wrong on our end that we need to fix. Our team has been notified of this error, and we apologise for the inconvenience." }} </p> <p> - {{ .Get "If this issue persists, don’t hesitate to contact ‘@onetruemangoman’ on Discord or to email us at %(Email:e)" - (map "Email" "mail@euro-cash.eu") }} + {{ .Get "If this issue persists, don’t hesitate to contact ‘@onetruemangoman’ on Discord or to email us at {Email:e}" + (map "Email" "mail@euro-cash.eu") }} </p> </main> {{ end }}
\ No newline at end of file |