summaryrefslogtreecommitdiff
path: root/catalog.go
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2018-02-21 12:06:58 +0100
committerRuben Pollan <meskio@sindominio.net>2018-02-21 15:46:21 +0100
commit868b796e77146e259c36789666282007cf80cc9b (patch)
treea6847eec043757fd4a386ec19002ca1fad1d7966 /catalog.go
parente843f609fcedc9d5bc15c762429bca9cc3c3f8b0 (diff)
[feat] add i18n support
Using golang.org/x/text, wich is still in early stages of development, but seems to work good enough for our needs. - Resolves: #2
Diffstat (limited to 'catalog.go')
-rw-r--r--catalog.go115
1 files changed, 115 insertions, 0 deletions
diff --git a/catalog.go b/catalog.go
new file mode 100644
index 0000000..80f55b3
--- /dev/null
+++ b/catalog.go
@@ -0,0 +1,115 @@
+// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
+
+package main
+
+import (
+ "golang.org/x/text/language"
+ "golang.org/x/text/message"
+ "golang.org/x/text/message/catalog"
+)
+
+type dictionary struct {
+ index []uint32
+ data string
+}
+
+func (d *dictionary) Lookup(key string) (data string, ok bool) {
+ p := messageKeyToIndex[key]
+ start, end := d.index[p], d.index[p+1]
+ if start == end {
+ return "", false
+ }
+ return d.data[start:end], true
+}
+
+func init() {
+ dict := map[string]catalog.Dictionary{
+ "en_US": &dictionary{index: en_USIndex, data: en_USData},
+ "es_ES": &dictionary{index: es_ESIndex, data: es_ESData},
+ }
+ fallback := language.MustParse("en-US")
+ cat, err := catalog.NewFromMap(dict, catalog.Fallback(fallback))
+ if err != nil {
+ panic(err)
+ }
+ message.DefaultCatalog = cat
+}
+
+var messageKeyToIndex = map[string]int{
+ "... I have donated": 15,
+ "About ...": 16,
+ "Can't contact bitmask": 2,
+ "Cancel": 11,
+ "Cancel connection to RiseupVPN": 12,
+ "Checking status...": 6,
+ "Could not find a polkit authentication agent. Please run one and try again.": 5,
+ "Donate ...": 14,
+ "Donate to RiseupVPN": 0,
+ "Help ...": 13,
+ "Is bitmaskd running? Start bitmask and try again.": 3,
+ "Missing authentication agent": 4,
+ "Quit": 17,
+ "Quit BitmaskVPN": 18,
+ "Retry": 21,
+ "RiseupVPN is %v": 23,
+ "Route traffic through": 19,
+ "The RiseupVPN service is expensive to run. Because we don't want to store personal information about you, there is no accounts or billing for this service. But if you want the service to continue, donate at least $5 each month at https://riseup.net/donate-vpn": 1,
+ "Turn RiseupVPN off": 10,
+ "Turn RiseupVPN on": 8,
+ "Turn off": 9,
+ "Turn on": 7,
+ "Use RiseupVPN %v gateway": 20,
+ "VPN is %v": 24,
+ "blocking internet": 22,
+}
+
+var en_USIndex = []uint32{ // 26 elements
+ 0x00000000, 0x00000014, 0x00000118, 0x0000012e,
+ 0x00000160, 0x0000017d, 0x000001c9, 0x000001dc,
+ 0x000001e4, 0x000001f6, 0x000001ff, 0x00000212,
+ 0x00000219, 0x00000238, 0x00000241, 0x00000250,
+ 0x00000263, 0x0000026d, 0x00000272, 0x00000282,
+ 0x00000298, 0x000002b4, 0x000002ba, 0x000002cc,
+ 0x000002df, 0x000002ec,
+} // Size: 128 bytes
+
+const en_USData string = "" + // Size: 748 bytes
+ "\x02Donate to RiseupVPN\x02The RiseupVPN service is expensive to run. Be" +
+ "cause we don't want to store personal information about you, there is no" +
+ " accounts or billing for this service. But if you want the service to co" +
+ "ntinue, donate at least $5 each month at https://riseup.net/donate-vpn" +
+ "\x02Can't contact bitmask\x02Is bitmaskd running? Start bitmask and try " +
+ "again.\x02Missing authentication agent\x02Could not find a polkit authen" +
+ "tication agent. Please run one and try again.\x02Checking status...\x02T" +
+ "urn on\x02Turn RiseupVPN on\x02Turn off\x02Turn RiseupVPN off\x02Cancel" +
+ "\x02Cancel connection to RiseupVPN\x02Help ...\x02Donate ...!!!!\x02... " +
+ "I have donated\x02About ...\x02Quit\x02Quit BitmaskVPN\x02Route traffic " +
+ "through\x02Use RiseupVPN %[1]v gateway\x02Retry\x02blocking internet\x02" +
+ "RiseupVPN is %[1]v\x02VPN is %[1]v"
+
+var es_ESIndex = []uint32{ // 26 elements
+ 0x00000000, 0x00000011, 0x00000107, 0x00000124,
+ 0x00000164, 0x00000186, 0x000001e9, 0x00000202,
+ 0x0000020b, 0x0000021e, 0x00000225, 0x00000235,
+ 0x0000023e, 0x0000025f, 0x00000269, 0x00000272,
+ 0x00000283, 0x00000291, 0x00000298, 0x000002aa,
+ 0x000002bc, 0x000002e0, 0x000002eb, 0x000002fe,
+ 0x00000313, 0x00000322,
+} // Size: 128 bytes
+
+const es_ESData string = "" + // Size: 802 bytes
+ "\x02Dona a RiseupVPN\x02El servicio RiseupVPN es caro de mantener. Como " +
+ "no queremos guardar ninguna información personal tuya, no hay cuentas ni" +
+ " servicio de facturación. Si quieres que este servicio continue, dona al" +
+ " menos $5 cada mes en https://riseup.net/donate-vpn\x02No puedo contacta" +
+ "r a bitmask\x02¿Esta bitmask en ejecucion? Arranca bitmask y prueba de n" +
+ "uevo.\x02Falta el agente de autenticación\x02No pude encontrar ningún ag" +
+ "ente de autenticacion polkit. Por favor ejecuta uno y prueba de nuevo." +
+ "\x02Comprobando el estado...\x02Encender\x02Enciende RiseupVPN\x02Apagar" +
+ "\x02Apaga RiseupVPN\x02Cancelar\x02Cancela la conexión a RiseupVPN\x02Ay" +
+ "uda ...\x02Dona ...\x02... ya he donado\x02Acerca de ...\x02Cerrar\x02Ci" +
+ "erra BitmaskVPN\x02Salir a traves de\x02Usa la salida de RiseupVPN en %[" +
+ "1]v\x02Reintentar\x02internet bloqueado\x02RiseupVPN esta %[1]v\x02VPN e" +
+ "sta %[1]v"
+
+ // Total table size 1806 bytes (1KiB); checksum: 85661B86