aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2025-08-02 03:47:16 +0200
committerThomas Voss <mail@thomasvoss.com> 2025-08-02 03:55:22 +0200
commit5a92e842d4b3b45447284d93190c1b09394a1f30 (patch)
treea5c50e9db37b20933cf99b8cde1906dc5ff0e1e9 /src
parent62df5a38c564bfe997c468d40e6d4d0988f348f3 (diff)
Generate locales programatically
Diffstat (limited to 'src')
-rwxr-xr-xsrc/i18n/gen.py168
-rw-r--r--src/i18n/i18n.go311
-rw-r--r--src/i18n/locales.gen.go277
3 files changed, 451 insertions, 305 deletions
diff --git a/src/i18n/gen.py b/src/i18n/gen.py
new file mode 100755
index 0000000..2f86ae9
--- /dev/null
+++ b/src/i18n/gen.py
@@ -0,0 +1,168 @@
+#!/usr/bin/python3
+
+import concurrent.futures
+import dataclasses
+import json
+import os
+import re
+import subprocess
+import sys
+import urllib.request
+from dataclasses import dataclass
+from typing import TextIO
+
+
+FILENAME = "locales.gen.go"
+
+@dataclass
+class Locale:
+ bcp: str
+ eurozone: bool
+ enabled: bool
+ territory: str | None = dataclasses.field(default=None)
+ name: str = dataclasses.field(init=False)
+ date_format: str = dataclasses.field(init=False)
+ group_separator: int = dataclasses.field(init=False)
+ decimal_separator: int = dataclasses.field(init=False)
+ monetary_pre: str = dataclasses.field(init=False)
+ monetary_suf: str = dataclasses.field(init=False)
+ percent_format: str = dataclasses.field(init=False)
+
+LOCALES = (
+ Locale(bcp="ca", eurozone=True, enabled=False),
+ Locale(bcp="de", eurozone=True, enabled=False),
+ Locale(bcp="el", eurozone=True, enabled=False),
+ Locale(bcp="en", eurozone=True, enabled=True, territory="GB"),
+ Locale(bcp="es", eurozone=True, enabled=False),
+ Locale(bcp="et", eurozone=True, enabled=False),
+ Locale(bcp="fi", eurozone=True, enabled=False),
+ Locale(bcp="fr", eurozone=True, enabled=False),
+ Locale(bcp="ga", eurozone=True, enabled=False),
+ Locale(bcp="hr", eurozone=True, enabled=False),
+ Locale(bcp="it", eurozone=True, enabled=False),
+ Locale(bcp="lb", eurozone=True, enabled=False),
+ Locale(bcp="lt", eurozone=True, enabled=False),
+ Locale(bcp="lv", eurozone=True, enabled=False),
+ Locale(bcp="mt", eurozone=True, enabled=False),
+ Locale(bcp="nl", eurozone=True, enabled=True),
+ Locale(bcp="pt", eurozone=True, enabled=False, territory="PT"),
+ Locale(bcp="sk", eurozone=True, enabled=False),
+ Locale(bcp="sl", eurozone=True, enabled=False),
+ Locale(bcp="sv", eurozone=True, enabled=True),
+ Locale(bcp="tr", eurozone=True, enabled=False),
+ Locale(bcp="bg", eurozone=False, enabled=False),
+ Locale(bcp="ro", eurozone=False, enabled=False),
+ Locale(bcp="uk", eurozone=False, enabled=False),
+)
+
+BASELINK = "https://raw.githubusercontent.com/unicode-org/cldr-json/refs/heads/main/cldr-json/%s/main/%%s/%s"
+NUMBERS_LINK, DATES_LINK, LANGUAGES_LINK = (
+ BASELINK % ("cldr-numbers-full", "numbers.json"),
+ BASELINK % ("cldr-dates-full", "ca-gregorian.json"),
+ BASELINK % ("cldr-localenames-full", "languages.json"),
+)
+
+
+def main() -> int:
+ rv = 0
+ nprocs = os.cpu_count()
+ with concurrent.futures.ThreadPoolExecutor(max_workers=nprocs) as executor:
+ for x in [executor.submit(write_locale, l) for l in LOCALES]:
+ try:
+ x.result()
+ except Exception as e:
+ print(f"gen.py: {e}", file=sys.stderr)
+ rv = 1
+
+ with open(FILENAME, "w") as f:
+ f.write("""// Code generated by gen.py. DO NOT EDIT.
+
+package i18n
+
+import "github.com/leonelquinteros/gotext"
+
+type LocaleInfo struct {
+ Bcp, Name string
+ Eurozone, Enabled bool
+ DateFormat string
+ GroupSeparator, DecimalSeparator rune
+ MonetaryPre [2]string
+ MonetarySuf string
+ PercentFormat string
+}
+
+var locales = [...]LocaleInfo{
+""")
+ for x in LOCALES:
+ f.write("{\n")
+ for k, v in x.__dict__.items():
+ if not v or k == "territory":
+ continue
+ f.write("%s: " % pascal(k))
+ match v:
+ case bool():
+ f.write("true" if v else "false")
+ case int():
+ f.write("'%s'" % chr(v))
+ case str() if not v.startswith("gotext"):
+ f.write('"%s"' % v)
+ case str():
+ f.write(v)
+ case [str(), str()]:
+ f.write('[2]string{"%s", "%s"}' % (v[0], v[1]))
+ f.write(",\n")
+ f.write("},\n")
+ f.write("}")
+
+ subprocess.run(["gofmt", "-w", FILENAME])
+ return rv
+
+
+def write_locale(l: Locale) -> None:
+ bcp = '%s-%s' % (l.bcp, l.territory) if l.territory else l.bcp
+ jn, jd, jl = map(json.load, (
+ urllib.request.urlopen(NUMBERS_LINK % bcp),
+ urllib.request.urlopen(DATES_LINK % bcp),
+ urllib.request.urlopen(LANGUAGES_LINK % bcp),
+ ))
+ name = jl["main"][bcp]["localeDisplayNames"]["languages"][l.bcp].capitalize()
+ l.name = 'gotext.GetC("%s", "Language Name")' % name
+ syms = jn["main"][bcp]["numbers"]["symbols-numberSystem-latn"]
+ l.group_separator = ord(syms["group"])
+ l.decimal_separator = ord(syms["decimal"])
+
+ fmt = jn["main"][bcp]["numbers"]["percentFormats-numberSystem-latn"]["standard"]
+ fmt = fmt.replace("%", "%%")
+ l.percent_format = re.sub(r"[0#,.]+", "%s", fmt)
+
+ fmt = jd["main"][bcp]["dates"]["calendars"]["gregorian"]["dateFormats"]["short"]
+ l.date_format = (
+ fmt
+ .replace("yy", "06")
+ .replace("MM", "01")
+ .replace("dd", "02")
+ .replace("y", "2006")
+ .replace("M", "1")
+ .replace("d", "2")
+ .replace("'", "")
+ )
+
+ fmt = jn["main"][bcp]["numbers"]["currencyFormats-numberSystem-latn"]["standard"]
+ parts = fmt.replace("¤", "€").split(";")
+ l.monetary_pre = ["", ""]
+
+ for i, x in enumerate(parts):
+ pre_suf = re.split(r"[0#,.]+", x)
+ l.monetary_pre[i] = pre_suf[0]
+ l.monetary_suf = pre_suf[1]
+ if len(parts) == 1:
+ l.monetary_pre[1] = "-" + l.monetary_pre[0]
+
+
+def pascal(s: str) -> str:
+ return ''.join(map(str.capitalize, s.split('_')))
+
+
+if __name__ == "__main__":
+ os.chdir(os.path.dirname(sys.argv[0]))
+ sys.exit(main()) \ No newline at end of file
diff --git a/src/i18n/i18n.go b/src/i18n/i18n.go
index ff7b6ce..7d4ae5e 100644
--- a/src/i18n/i18n.go
+++ b/src/i18n/i18n.go
@@ -1,3 +1,5 @@
+//go:generate ./gen.py
+
package i18n
import (
@@ -21,16 +23,6 @@ type Printer struct {
inner *gotext.Locale
}
-type LocaleInfo struct {
- Bcp, Name string
- Eurozone, Enabled bool
- DateFormat string
- GroupSeparator, DecimalSeparator rune
- MonetaryPre [2]string
- MonetarySuf string
- PercentPre, PercentSuf string
-}
-
type number interface {
int | float64
}
@@ -49,293 +41,6 @@ var (
'r': sprintfr,
}
- /* To determine the correct currency-, date-, and number formats to
- use, use the ‘getfmt’ script in the repository root */
- locales = [...]LocaleInfo{
- {
- Bcp: "ca",
- Name: gotext.GetC("Català", "Language Name"),
- DateFormat: "2/1/2006",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: '.',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: " %",
- },
- {
- Bcp: "de",
- Name: gotext.GetC("Deutsch", "Language Name"),
- DateFormat: "2.1.2006",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: '.',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: " %",
- },
- {
- Bcp: "el",
- Name: gotext.GetC("Ελληνικά", "Language Name"),
- DateFormat: "2/1/2006",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: '.',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: "%",
- },
- {
- Bcp: "en",
- Name: gotext.GetC("English", "Language Name"),
- DateFormat: "02/01/2006",
- Eurozone: true,
- Enabled: true,
- GroupSeparator: ',',
- DecimalSeparator: '.',
- MonetaryPre: [2]string{"€", "-€"},
- PercentSuf: "%",
- },
- {
- Bcp: "es",
- Name: gotext.GetC("Español", "Language Name"),
- DateFormat: "2/1/2006",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: '.',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: " %",
- },
- {
- Bcp: "et",
- Name: gotext.GetC("Eesti", "Language Name"),
- DateFormat: "2.1.2006",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: ' ',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: "%",
- },
- {
- Bcp: "fi",
- Name: gotext.GetC("Suomi", "Language Name"),
- DateFormat: "2.1.2006",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: ' ',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: " %",
- },
- {
- Bcp: "fr",
- Name: gotext.GetC("Français", "Language Name"),
- DateFormat: "02/01/2006",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: ' ',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: " %",
- },
- {
- Bcp: "ga",
- Name: gotext.GetC("Gaeilge", "Language Name"),
- DateFormat: "02/01/2006",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: ',',
- DecimalSeparator: '.',
- MonetaryPre: [2]string{"€", "-€"},
- PercentSuf: "%",
- },
- {
- Bcp: "hr",
- Name: gotext.GetC("Hrvatski", "Language Name"),
- DateFormat: "02. 01. 2006.",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: '.',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: " %",
- },
- {
- Bcp: "it",
- Name: gotext.GetC("Italiano", "Language Name"),
- DateFormat: "02/01/2006",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: '.',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: "%",
- },
- {
- Bcp: "lb",
- Name: gotext.GetC("Lëtzebuergesch", "Language Name"),
- DateFormat: "2.1.2006",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: '.',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: " %",
- },
- {
- Bcp: "lt",
- Name: gotext.GetC("Lietuvių", "Language Name"),
- DateFormat: "2006-01-02",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: ' ',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: " %",
- },
- {
- Bcp: "lv",
- Name: gotext.GetC("Latviešu", "Language Name"),
- DateFormat: "2.01.2006.",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: ' ',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: "%",
- },
- {
- Bcp: "mt",
- Name: gotext.GetC("Malti", "Language Name"),
- DateFormat: "2/1/2006",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: ',',
- DecimalSeparator: '.',
- MonetaryPre: [2]string{"€", "-€"},
- PercentSuf: "%",
- },
- {
- Bcp: "nl",
- Name: gotext.GetC("Nederlands", "Language Name"),
- DateFormat: "2-1-2006",
- Eurozone: true,
- Enabled: true,
- GroupSeparator: '.',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"€ ", "€ -"},
- PercentSuf: "%",
- },
- {
- Bcp: "pt",
- Name: gotext.GetC("Português", "Language Name"),
- DateFormat: "02/01/2006",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: '.',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"€ ", "€ -"},
- PercentSuf: "%",
- },
- {
- Bcp: "sk",
- Name: gotext.GetC("Slovenčina", "Language Name"),
- DateFormat: "2. 1. 2006",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: ' ',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: " %",
- },
- {
- Bcp: "sl",
- Name: gotext.GetC("Slovenščina", "Language Name"),
- DateFormat: "2. 1. 2006",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: '.',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: " %",
- },
- {
- Bcp: "sv",
- Name: gotext.GetC("Svenska", "Language Name"),
- DateFormat: "2006-01-02",
- Eurozone: true,
- Enabled: true,
- GroupSeparator: ' ',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: " %",
- },
- {
- Bcp: "tr",
- Name: gotext.GetC("Türkçe", "Language Name"),
- DateFormat: "2.01.2006",
- Eurozone: true,
- Enabled: false,
- GroupSeparator: '.',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"€", "-€"},
- PercentPre: "%",
- },
- /* Non-Eurozone locales */
- {
- Bcp: "bg",
- Name: gotext.GetC("Български", "Language Name"),
- DateFormat: "2.01.2006 г.",
- Eurozone: false, /* TODO(2026): Set to true */
- Enabled: false,
- GroupSeparator: ' ',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: "%",
- },
- {
- Bcp: "ro",
- Name: gotext.GetC("Română", "Language Name"),
- DateFormat: "02.01.2006",
- Eurozone: false,
- Enabled: false,
- GroupSeparator: '.',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: " %",
- },
- {
- Bcp: "uk",
- Name: gotext.GetC("Yкраїнська", "Language Name"),
- DateFormat: "02.01.2006",
- Eurozone: false,
- Enabled: false,
- GroupSeparator: ' ',
- DecimalSeparator: ',',
- MonetaryPre: [2]string{"", "-"},
- MonetarySuf: " €",
- PercentSuf: "%",
- },
- }
Printers map[string]Printer = make(map[string]Printer, len(locales))
DefaultPrinter Printer
)
@@ -593,20 +298,16 @@ func sprintfm(li LocaleInfo, bob *strings.Builder, v any) error {
}
func sprintfp(li LocaleInfo, bob *strings.Builder, v any) error {
+ var bob2 strings.Builder
switch v.(type) {
case int:
- n := v.(int)
- htmlesc(bob, li.PercentPre)
- writeInt(bob, n, li)
- htmlesc(bob, li.PercentSuf)
+ writeInt(&bob2, v.(int), li)
case float64:
- n := v.(float64)
- htmlesc(bob, li.PercentPre)
- writeFloat(bob, n, li)
- htmlesc(bob, li.PercentSuf)
+ writeFloat(&bob2, v.(float64), li)
default:
return errors.New("TODO")
}
+ bob.WriteString(fmt.Sprintf(li.PercentFormat, bob2.String()))
return nil
}
diff --git a/src/i18n/locales.gen.go b/src/i18n/locales.gen.go
new file mode 100644
index 0000000..1ab431f
--- /dev/null
+++ b/src/i18n/locales.gen.go
@@ -0,0 +1,277 @@
+// Code generated by gen.py. DO NOT EDIT.
+
+package i18n
+
+import "github.com/leonelquinteros/gotext"
+
+type LocaleInfo struct {
+ Bcp, Name string
+ Eurozone, Enabled bool
+ DateFormat string
+ GroupSeparator, DecimalSeparator rune
+ MonetaryPre [2]string
+ MonetarySuf string
+ PercentFormat string
+}
+
+var locales = [...]LocaleInfo{
+ {
+ Bcp: "ca",
+ Eurozone: true,
+ Name: gotext.GetC("Català", "Language Name"),
+ GroupSeparator: '.',
+ DecimalSeparator: ',',
+ PercentFormat: "%s %%",
+ DateFormat: "2/1/06",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "de",
+ Eurozone: true,
+ Name: gotext.GetC("Deutsch", "Language Name"),
+ GroupSeparator: '.',
+ DecimalSeparator: ',',
+ PercentFormat: "%s %%",
+ DateFormat: "02.01.06",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "el",
+ Eurozone: true,
+ Name: gotext.GetC("Ελληνικά", "Language Name"),
+ GroupSeparator: '.',
+ DecimalSeparator: ',',
+ PercentFormat: "%s%%",
+ DateFormat: "2/1/06",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "en",
+ Eurozone: true,
+ Enabled: true,
+ Name: gotext.GetC("English", "Language Name"),
+ GroupSeparator: ',',
+ DecimalSeparator: '.',
+ PercentFormat: "%s%%",
+ DateFormat: "02/01/2006",
+ MonetaryPre: [2]string{"€", "-€"},
+ },
+ {
+ Bcp: "es",
+ Eurozone: true,
+ Name: gotext.GetC("Español", "Language Name"),
+ GroupSeparator: '.',
+ DecimalSeparator: ',',
+ PercentFormat: "%s %%",
+ DateFormat: "2/1/06",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "et",
+ Eurozone: true,
+ Name: gotext.GetC("Eesti", "Language Name"),
+ GroupSeparator: ' ',
+ DecimalSeparator: ',',
+ PercentFormat: "%s%%",
+ DateFormat: "02.01.06",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "fi",
+ Eurozone: true,
+ Name: gotext.GetC("Suomi", "Language Name"),
+ GroupSeparator: ' ',
+ DecimalSeparator: ',',
+ PercentFormat: "%s %%",
+ DateFormat: "2.1.2006",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "fr",
+ Eurozone: true,
+ Name: gotext.GetC("Français", "Language Name"),
+ GroupSeparator: ' ',
+ DecimalSeparator: ',',
+ PercentFormat: "%s %%",
+ DateFormat: "02/01/2006",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "ga",
+ Eurozone: true,
+ Name: gotext.GetC("Gaeilge", "Language Name"),
+ GroupSeparator: ',',
+ DecimalSeparator: '.',
+ PercentFormat: "%s%%",
+ DateFormat: "02/01/2006",
+ MonetaryPre: [2]string{"€", "-€"},
+ },
+ {
+ Bcp: "hr",
+ Eurozone: true,
+ Name: gotext.GetC("Hrvatski", "Language Name"),
+ GroupSeparator: '.',
+ DecimalSeparator: ',',
+ PercentFormat: "%s %%",
+ DateFormat: "02. 01. 2006.",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "it",
+ Eurozone: true,
+ Name: gotext.GetC("Italiano", "Language Name"),
+ GroupSeparator: '.',
+ DecimalSeparator: ',',
+ PercentFormat: "%s%%",
+ DateFormat: "02/01/06",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "lb",
+ Eurozone: true,
+ Name: gotext.GetC("Lëtzebuergesch", "Language Name"),
+ GroupSeparator: '.',
+ DecimalSeparator: ',',
+ PercentFormat: "%s %%",
+ DateFormat: "02.01.06",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "lt",
+ Eurozone: true,
+ Name: gotext.GetC("Lietuvių", "Language Name"),
+ GroupSeparator: ' ',
+ DecimalSeparator: ',',
+ PercentFormat: "%s %%",
+ DateFormat: "2006-01-02",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "lv",
+ Eurozone: true,
+ Name: gotext.GetC("Latviešu", "Language Name"),
+ GroupSeparator: ' ',
+ DecimalSeparator: ',',
+ PercentFormat: "%s%%",
+ DateFormat: "02.01.06",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "mt",
+ Eurozone: true,
+ Name: gotext.GetC("Malti", "Language Name"),
+ GroupSeparator: ',',
+ DecimalSeparator: '.',
+ PercentFormat: "%s%%",
+ DateFormat: "02/01/2006",
+ MonetaryPre: [2]string{"€", "-€"},
+ },
+ {
+ Bcp: "nl",
+ Eurozone: true,
+ Enabled: true,
+ Name: gotext.GetC("Nederlands", "Language Name"),
+ GroupSeparator: '.',
+ DecimalSeparator: ',',
+ PercentFormat: "%s%%",
+ DateFormat: "02-01-2006",
+ MonetaryPre: [2]string{"€ ", "€ -"},
+ },
+ {
+ Bcp: "pt",
+ Eurozone: true,
+ Name: gotext.GetC("Português", "Language Name"),
+ GroupSeparator: ' ',
+ DecimalSeparator: ',',
+ PercentFormat: "%s%%",
+ DateFormat: "02/01/06",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "sk",
+ Eurozone: true,
+ Name: gotext.GetC("Slovenčina", "Language Name"),
+ GroupSeparator: ' ',
+ DecimalSeparator: ',',
+ PercentFormat: "%s %%",
+ DateFormat: "2. 1. 2006",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "sl",
+ Eurozone: true,
+ Name: gotext.GetC("Slovenščina", "Language Name"),
+ GroupSeparator: '.',
+ DecimalSeparator: ',',
+ PercentFormat: "%s %%",
+ DateFormat: "2. 1. 06",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "sv",
+ Eurozone: true,
+ Enabled: true,
+ Name: gotext.GetC("Svenska", "Language Name"),
+ GroupSeparator: ' ',
+ DecimalSeparator: ',',
+ PercentFormat: "%s %%",
+ DateFormat: "2006-01-02",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "tr",
+ Eurozone: true,
+ Name: gotext.GetC("Türkçe", "Language Name"),
+ GroupSeparator: '.',
+ DecimalSeparator: ',',
+ PercentFormat: "%%%s",
+ DateFormat: "2.01.2006",
+ MonetaryPre: [2]string{"€", "-€"},
+ },
+ {
+ Bcp: "bg",
+ Name: gotext.GetC("Български", "Language Name"),
+ GroupSeparator: ' ',
+ DecimalSeparator: ',',
+ PercentFormat: "%s%%",
+ DateFormat: "2.01.06 г.",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "ro",
+ Name: gotext.GetC("Română", "Language Name"),
+ GroupSeparator: '.',
+ DecimalSeparator: ',',
+ PercentFormat: "%s %%",
+ DateFormat: "02.01.2006",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+ {
+ Bcp: "uk",
+ Name: gotext.GetC("Українська", "Language Name"),
+ GroupSeparator: ' ',
+ DecimalSeparator: ',',
+ PercentFormat: "%s%%",
+ DateFormat: "02.01.06",
+ MonetaryPre: [2]string{"", "-"},
+ MonetarySuf: " €",
+ },
+}