diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-08-08 14:09:59 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-08-08 16:50:51 +0200 |
commit | 356e577999453aa7406efd0a44263d40ac049889 (patch) | |
tree | 982189b997dc931190cf32ae9e402792cd7b8d43 /i18n | |
parent | 6b8f088e278ff803a78f7942842313da84108e76 (diff) |
Prefer simple BCP codes to complex ones (el-GR -> el)
Diffstat (limited to 'i18n')
-rw-r--r-- | i18n/catalog.go | 118 | ||||
-rw-r--r-- | i18n/locales/el/messages.gotext.json (renamed from i18n/locales/nl-NL/messages.gotext.json) | 2 | ||||
-rw-r--r-- | i18n/locales/en/messages.gotext.json (renamed from i18n/locales/en-GB/messages.gotext.json) | 2 | ||||
-rw-r--r-- | i18n/locales/nl/messages.gotext.json | 399 | ||||
-rw-r--r-- | i18n/printer.go | 65 |
5 files changed, 550 insertions, 36 deletions
diff --git a/i18n/catalog.go b/i18n/catalog.go index f0c2822..544260b 100644 --- a/i18n/catalog.go +++ b/i18n/catalog.go @@ -27,10 +27,13 @@ func (d *dictionary) Lookup(key string) (data string, ok bool) { func init() { dict := map[string]catalog.Dictionary{ + "el": &dictionary{index: elIndex, data: elData}, + "en": &dictionary{index: enIndex, data: enData}, "en_GB": &dictionary{index: en_GBIndex, data: en_GBData}, + "nl": &dictionary{index: nlIndex, data: nlData}, "nl_NL": &dictionary{index: nl_NLIndex, data: nl_NLData}, } - fallback := language.MustParse("en-GB") + fallback := language.MustParse("en") cat, err := catalog.NewFromMap(dict, catalog.Fallback(fallback)) if err != nil { panic(err) @@ -107,6 +110,92 @@ var messageKeyToIndex = map[string]int{ "diversity": 63, } +var elIndex = []uint32{ // 67 elements + // Entry 0 - 1F + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + // Entry 20 - 3F + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + // Entry 40 - 5F + 0x00000000, 0x00000000, 0x00000000, +} // Size: 292 bytes + +const elData string = "" + +var enIndex = []uint32{ // 67 elements + // Entry 0 - 1F + 0x00000000, 0x0000000f, 0x00000018, 0x00000024, + 0x00000189, 0x00000194, 0x00000385, 0x00000394, + 0x000003a0, 0x000003a9, 0x000003b6, 0x000003d2, + 0x000003dc, 0x000003e4, 0x000003ec, 0x000003f4, + 0x000003fb, 0x00000403, 0x0000040b, 0x00000411, + 0x00000419, 0x00000420, 0x00000427, 0x0000042f, + 0x00000437, 0x0000043d, 0x00000447, 0x00000452, + 0x00000459, 0x00000460, 0x00000466, 0x00000472, + // Entry 20 - 3F + 0x0000047b, 0x00000484, 0x0000048d, 0x00000498, + 0x000004a5, 0x000004b7, 0x00000599, 0x000005a4, + 0x0000065e, 0x00000666, 0x00000691, 0x0000069a, + 0x000006ca, 0x000006d4, 0x000006f7, 0x0000070c, + 0x0000073f, 0x00000752, 0x00000762, 0x00000767, + 0x0000076c, 0x0000077c, 0x00000782, 0x0000078c, + 0x00000793, 0x0000079b, 0x000007a1, 0x000007aa, + 0x000007e5, 0x000007fe, 0x00000817, 0x00000821, + // Entry 40 - 5F + 0x0000082b, 0x00000830, 0x00000948, +} // Size: 292 bytes + +const enData string = "" + // Size: 2376 bytes + "\x02Page not found\x02About Us\x02Open Source\x02This website is an open" + + " project, and a collaboration between developers, translators, and resea" + + "rchers. All source code, data, images, and more for the website are open" + + " source and can be found %[1]shere%[2]s. This site is licensed under the" + + " BSD 0-Clause license giving you the full freedom to do whatever you wou" + + "ld like with any of the content on this site.\x02Contact Us\x02While 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 hes" + + "itate 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 ar" + + "e more technically included, but if not you can always send an email to " + + "%[1]s or contact ‘@onetruemangoman’ on Discord.\x02Special Thanks\x02Dev" + + "elopment\x02Research\x02Translations\x02British- & American English\x02I" + + "celandic\x02Andorra\x02Austria\x02Belgium\x02Cyprus\x02Germany\x02Estoni" + + "a\x02Spain\x02Finland\x02France\x02Greece\x02Croatia\x02Ireland\x02Italy" + + "\x02Lithuania\x02Luxembourg\x02Latvia\x02Monaco\x02Malta\x02Netherlands" + + "\x02Portugal\x02Slovenia\x02Slovakia\x02San Marino\x02Vatican City\x02Eu" + + "ro Coin Designs\x02Here you’ll be able to view all the coin designs for " + + "each country in the Eurozone. This section of the site doesn’t include m" + + "inor varieties such as different mintmarks or errors; those are on the %" + + "[1]svarieties%[2]s page.\x02Euro Coins\x02On this section of the site yo" + + "u can find everything there is to know about the coins of the Eurozone. " + + "For the latest news on coin- and design releases, check out the %[1]snew" + + "s%[2]s tab!\x02Designs\x02View the 600+ different Euro-coin designs!\x02" + + "Mintages\x02View the mintage figures of all the Euro coins!\x02Varieties" + + "\x02View all the known Euro varieties!\x02Select Your Language\x02Select" + + " your preferred language to use on the site.\x02Eurozone Languages\x02Ot" + + "her Languages\x02Home\x02News\x02Coin Collecting\x02Coins\x02Banknotes" + + "\x02Jargon\x02Discord\x02About\x02Language\x02Found a mistake or want to" + + " contribute missing information?\x02Feel free to contact us!\x02The Euro" + + " Cash Compendium\x02United in\x02diversity\x02cash\x02Welcome to the Eur" + + "o Cash Compendium. This sites aims to be a resource for you to discover " + + "everything there is to know about the coins and banknotes of the Euro, a" + + " currency that spans 26 countries and 350 million people. We also have d" + + "edicated sections of the site for collectors." + var en_GBIndex = []uint32{ // 67 elements // Entry 0 - 1F 0x00000000, 0x0000000f, 0x00000018, 0x00000024, @@ -168,6 +257,31 @@ const en_GBData string = "" + // Size: 2376 bytes " currency that spans 26 countries and 350 million people. We also have d" + "edicated sections of the site for collectors." +var nlIndex = []uint32{ // 67 elements + // Entry 0 - 1F + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + // Entry 20 - 3F + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + // Entry 40 - 5F + 0x00000000, 0x00000000, 0x00000000, +} // Size: 292 bytes + +const nlData string = "" + var nl_NLIndex = []uint32{ // 67 elements // Entry 0 - 1F 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -193,4 +307,4 @@ var nl_NLIndex = []uint32{ // 67 elements const nl_NLData string = "" -// Total table size 2960 bytes (2KiB); checksum: DDBC1523 +// Total table size 6212 bytes (6KiB); checksum: 7D179823 diff --git a/i18n/locales/nl-NL/messages.gotext.json b/i18n/locales/el/messages.gotext.json index c3a6053..cae5b37 100644 --- a/i18n/locales/nl-NL/messages.gotext.json +++ b/i18n/locales/el/messages.gotext.json @@ -1,5 +1,5 @@ { - "language": "nl-NL", + "language": "el", "messages": [ { "id": "Page not found", diff --git a/i18n/locales/en-GB/messages.gotext.json b/i18n/locales/en/messages.gotext.json index 9c44cf1..6505619 100644 --- a/i18n/locales/en-GB/messages.gotext.json +++ b/i18n/locales/en/messages.gotext.json @@ -1,5 +1,5 @@ { - "language": "en-GB", + "language": "en", "messages": [ { "id": "Page not found", diff --git a/i18n/locales/nl/messages.gotext.json b/i18n/locales/nl/messages.gotext.json new file mode 100644 index 0000000..ed11410 --- /dev/null +++ b/i18n/locales/nl/messages.gotext.json @@ -0,0 +1,399 @@ +{ + "language": "nl", + "messages": [ + { + "id": "Page not found", + "message": "Page not found", + "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": "" + }, + { + "id": "Austria", + "message": "Austria", + "translation": "" + }, + { + "id": "Belgium", + "message": "Belgium", + "translation": "" + }, + { + "id": "Cyprus", + "message": "Cyprus", + "translation": "" + }, + { + "id": "Germany", + "message": "Germany", + "translation": "" + }, + { + "id": "Estonia", + "message": "Estonia", + "translation": "" + }, + { + "id": "Spain", + "message": "Spain", + "translation": "" + }, + { + "id": "Finland", + "message": "Finland", + "translation": "" + }, + { + "id": "France", + "message": "France", + "translation": "" + }, + { + "id": "Greece", + "message": "Greece", + "translation": "" + }, + { + "id": "Croatia", + "message": "Croatia", + "translation": "" + }, + { + "id": "Ireland", + "message": "Ireland", + "translation": "" + }, + { + "id": "Italy", + "message": "Italy", + "translation": "" + }, + { + "id": "Lithuania", + "message": "Lithuania", + "translation": "" + }, + { + "id": "Luxembourg", + "message": "Luxembourg", + "translation": "" + }, + { + "id": "Latvia", + "message": "Latvia", + "translation": "" + }, + { + "id": "Monaco", + "message": "Monaco", + "translation": "" + }, + { + "id": "Malta", + "message": "Malta", + "translation": "" + }, + { + "id": "Netherlands", + "message": "Netherlands", + "translation": "" + }, + { + "id": "Portugal", + "message": "Portugal", + "translation": "" + }, + { + "id": "Slovenia", + "message": "Slovenia", + "translation": "" + }, + { + "id": "Slovakia", + "message": "Slovakia", + "translation": "" + }, + { + "id": "San Marino", + "message": "San Marino", + "translation": "" + }, + { + "id": "Vatican City", + "message": "Vatican City", + "translation": "" + }, + { + "id": "Euro Coin Designs", + "message": "Euro Coin Designs", + "translation": "" + }, + { + "id": "Here you’ll be able to view all the coin designs for each country in the Eurozone. This section of the site doesn’t include minor varieties such as different mintmarks or errors; those are on the {VarietiesLinkStart}varieties{LinkEnd} page.", + "message": "Here you’ll be able to view all the coin designs for each country in the Eurozone. This section of the site doesn’t include minor varieties such as different mintmarks or errors; those are on the {VarietiesLinkStart}varieties{LinkEnd} page.", + "translation": "", + "placeholders": [ + { + "id": "VarietiesLinkStart", + "string": "%[1]s", + "type": "string", + "underlyingType": "string", + "argNum": 1, + "expr": "varietiesLinkStart" + }, + { + "id": "LinkEnd", + "string": "%[2]s", + "type": "string", + "underlyingType": "string", + "argNum": 2, + "expr": "linkEnd" + } + ] + }, + { + "id": "Euro Coins", + "message": "Euro Coins", + "translation": "" + }, + { + "id": "On this section of the site you can find everything there is to know about the coins of the Eurozone. For the latest news on coin- and design releases, check out the {NewsLinkStart}news{LinkEnd} tab!", + "message": "On this section of the site you can find everything there is to know about the coins of the Eurozone. For the latest news on coin- and design releases, check out the {NewsLinkStart}news{LinkEnd} tab!", + "translation": "", + "placeholders": [ + { + "id": "NewsLinkStart", + "string": "%[1]s", + "type": "string", + "underlyingType": "string", + "argNum": 1, + "expr": "newsLinkStart" + }, + { + "id": "LinkEnd", + "string": "%[2]s", + "type": "string", + "underlyingType": "string", + "argNum": 2, + "expr": "linkEnd" + } + ] + }, + { + "id": "Designs", + "message": "Designs", + "translation": "" + }, + { + "id": "View the 600+ different Euro-coin designs!", + "message": "View the 600+ different Euro-coin designs!", + "translation": "" + }, + { + "id": "Mintages", + "message": "Mintages", + "translation": "" + }, + { + "id": "View the mintage figures of all the Euro coins!", + "message": "View the mintage figures of all the Euro coins!", + "translation": "" + }, + { + "id": "Varieties", + "message": "Varieties", + "translation": "" + }, + { + "id": "View all the known Euro varieties!", + "message": "View all the known Euro varieties!", + "translation": "" + }, + { + "id": "Select Your Language", + "message": "Select Your Language", + "translation": "" + }, + { + "id": "Select your preferred language to use on the site.", + "message": "Select your preferred language to use on the site.", + "translation": "" + }, + { + "id": "Eurozone Languages", + "message": "Eurozone Languages", + "translation": "" + }, + { + "id": "Other Languages", + "message": "Other Languages", + "translation": "" + }, + { + "id": "Home", + "message": "Home", + "translation": "" + }, + { + "id": "News", + "message": "News", + "translation": "" + }, + { + "id": "Coin Collecting", + "message": "Coin Collecting", + "translation": "" + }, + { + "id": "Coins", + "message": "Coins", + "translation": "" + }, + { + "id": "Banknotes", + "message": "Banknotes", + "translation": "" + }, + { + "id": "Jargon", + "message": "Jargon", + "translation": "" + }, + { + "id": "Discord", + "message": "Discord", + "translation": "" + }, + { + "id": "About", + "message": "About", + "translation": "" + }, + { + "id": "Language", + "message": "Language", + "translation": "" + }, + { + "id": "Found a mistake or want to contribute missing information?", + "message": "Found a mistake or want to contribute missing information?", + "translation": "" + }, + { + "id": "Feel free to contact us!", + "message": "Feel free to contact us!", + "translation": "" + }, + { + "id": "The Euro Cash Compendium", + "message": "The Euro Cash Compendium", + "translation": "" + }, + { + "id": "United in", + "message": "United in", + "translation": "" + }, + { + "id": "diversity", + "message": "diversity", + "translation": "" + }, + { + "id": "cash", + "message": "cash", + "translation": "" + }, + { + "id": "Welcome to the Euro Cash Compendium. This sites aims to be a resource for you to discover everything there is to know about the coins and banknotes of the Euro, a currency that spans 26 countries and 350 million people. We also have dedicated sections of the site for collectors.", + "message": "Welcome to the Euro Cash Compendium. This sites aims to be a resource for you to discover everything there is to know about the coins and banknotes of the Euro, a currency that spans 26 countries and 350 million people. We also have dedicated sections of the site for collectors.", + "translation": "" + } + ] +}
\ No newline at end of file diff --git a/i18n/printer.go b/i18n/printer.go index fc198f5..83ef625 100644 --- a/i18n/printer.go +++ b/i18n/printer.go @@ -9,7 +9,7 @@ import ( "golang.org/x/text/message" ) -//go:generate gotext -srclang=en-GB update -out=catalog.go -lang=en-GB,nl-NL git.thomasvoss.com/euro-cash.eu +//go:generate gotext -srclang=en update -out=catalog.go -lang=el,en,nl git.thomasvoss.com/euro-cash.eu type Printer struct { Locale Locale @@ -17,7 +17,7 @@ type Printer struct { } type Locale struct { - Code string + Bcp string Name string dateFmt string moneyFmt string @@ -28,133 +28,133 @@ type Locale struct { var ( Locales = [...]Locale{ { - Code: "ca-AD", + Bcp: "ca", Name: "català", dateFmt: "2/1/2006", Eurozone: true, Enabled: false, }, { - Code: "de-DE", + Bcp: "de", Name: "Deutsch", dateFmt: "2.1.2006", Eurozone: true, Enabled: false, }, { - Code: "el-GR", + Bcp: "el", Name: "ελληνικά", dateFmt: "2/1/2006", Eurozone: true, Enabled: false, }, { - Code: "en-GB", + Bcp: "en", Name: "English", dateFmt: "02/01/2006", Eurozone: true, Enabled: true, }, { - Code: "es-ES", + Bcp: "es", Name: "español", dateFmt: "2/1/2006", Eurozone: true, Enabled: false, }, { - Code: "et-EE", + Bcp: "et", Name: "eesti", dateFmt: "2.1.2006", Eurozone: true, Enabled: false, }, { - Code: "fi-FI", + Bcp: "fi", Name: "suomi", dateFmt: "2.1.2006", Eurozone: true, Enabled: false, }, { - Code: "fr-FR", + Bcp: "fr", Name: "français", dateFmt: "02/01/2006", Eurozone: true, Enabled: false, }, { - Code: "ga-IE", + Bcp: "ga", Name: "Gaeilge", dateFmt: "02/01/2006", Eurozone: true, Enabled: false, }, { - Code: "hr-HR", + Bcp: "hr", Name: "hrvatski", dateFmt: "02. 01. 2006.", Eurozone: true, Enabled: false, }, { - Code: "it-IT", + Bcp: "it", Name: "italiano", dateFmt: "02/01/2006", Eurozone: true, Enabled: false, }, { - Code: "lb-LU", + Bcp: "lb", Name: "lëtzebuergesch", dateFmt: "2.1.2006", Eurozone: true, Enabled: false, }, { - Code: "lt-LT", + Bcp: "lt", Name: "lietuvių", dateFmt: "2006-01-02", Eurozone: true, Enabled: false, }, { - Code: "lv-LV", + Bcp: "lv", Name: "latviešu", dateFmt: "2.01.2006.", Eurozone: true, Enabled: false, }, { - Code: "mt-MT", + Bcp: "mt", Name: "Malti", dateFmt: "2/1/2006", Eurozone: true, Enabled: false, }, { - Code: "nl-NL", + Bcp: "nl", Name: "Nederlands", dateFmt: "2-1-2006", Eurozone: true, Enabled: true, }, { - Code: "pt-PT", + Bcp: "pt", Name: "português", dateFmt: "02/01/2006", Eurozone: true, Enabled: false, }, { - Code: "sk-SK", + Bcp: "sk", Name: "slovenčina", dateFmt: "2. 1. 2006", Eurozone: true, Enabled: false, }, { - Code: "sl-SI", + Bcp: "sl", Name: "slovenščina", dateFmt: "2. 1. 2006", Eurozone: true, @@ -163,28 +163,28 @@ var ( /* Non-Eurozone locales */ { - Code: "bg-BG", + Bcp: "bg", Name: "български", dateFmt: "2.01.2006 г.", Eurozone: false, Enabled: false, }, { - Code: "en-US", + Bcp: "en-US", Name: "English (US)", dateFmt: "1/2/2006", Eurozone: false, Enabled: false, }, { - Code: "ro-RO", + Bcp: "ro", Name: "română", dateFmt: "02.01.2006", Eurozone: false, Enabled: false, }, { - Code: "uk-UA", + Bcp: "uk", Name: "yкраїнська", dateFmt: "02.01.2006", Eurozone: false, @@ -201,14 +201,14 @@ var ( func InitPrinters() { for _, loc := range Locales { if loc.Enabled { - lang := language.MustParse(loc.Code) - Printers[strings.ToLower(loc.Code)] = Printer{ + lang := language.MustParse(loc.Bcp) + Printers[strings.ToLower(loc.Bcp)] = Printer{ Locale: loc, printer: message.NewPrinter(lang), } } } - DefaultPrinter = Printers["en-gb"] + DefaultPrinter = Printers["en"] } func (p Printer) T(fmt string, args ...any) string { @@ -235,16 +235,17 @@ func (p Printer) Money(val float64, round bool) string { /* All Eurozone languages place the eurosign after the value except for Dutch, English, Gaelic, and Maltese. Austrian German also uses Dutch-style formatting, but we do not support that dialect. */ - switch p.Locale.Code { - case "en-GB", "en-US", "ga-IE", "mt-MT": + switch p.Locale.Bcp { + case "en", "en-US", "ga", "mt": return fmt.Sprintf("€%s", valstr) - case "nl-NL": + case "nl": return fmt.Sprintf("€ %s", valstr) default: return fmt.Sprintf("%s €", valstr) } } +/* Transform ‘en-US’ to ‘en’ */ func (l Locale) Language() string { - return l.Code[:2] + return l.Bcp[:2] } |