diff --git a/internal/backends/backends_test.go b/internal/backends/backends_test.go index 4d758eb..b6a6968 100644 --- a/internal/backends/backends_test.go +++ b/internal/backends/backends_test.go @@ -35,6 +35,7 @@ import ( "go.uploadedlobster.com/scotty/internal/backends/spotify" "go.uploadedlobster.com/scotty/internal/backends/subsonic" "go.uploadedlobster.com/scotty/internal/config" + "go.uploadedlobster.com/scotty/internal/i18n" "go.uploadedlobster.com/scotty/internal/models" ) @@ -52,7 +53,7 @@ func TestResolveBackendUnknown(t *testing.T) { c.Set("backend", "foo") service := config.NewServiceConfig("test", c) _, err := backends.ResolveBackend[models.ListensImport](service) - assert.EqualError(t, err, "unknown backend \"foo\"") + assert.EqualError(t, err, i18n.Tr("unknown backend \"%s\"", "foo")) } func TestResolveBackendInvalidInterface(t *testing.T) { @@ -60,7 +61,7 @@ func TestResolveBackendInvalidInterface(t *testing.T) { c.Set("backend", "dump") service := config.NewServiceConfig("test", c) _, err := backends.ResolveBackend[models.ListensExport](service) - assert.EqualError(t, err, "backend dump does not implement ListensExport") + assert.EqualError(t, err, i18n.Tr("backend %s does not implement %s", "dump", "ListensExport")) } func TestGetBackends(t *testing.T) { diff --git a/internal/translations/catalog.go b/internal/translations/catalog.go index 3ceb6df..e91524f 100644 --- a/internal/translations/catalog.go +++ b/internal/translations/catalog.go @@ -39,117 +39,137 @@ func init() { } var messageKeyToIndex = map[string]int{ - "\tbackend: %v": 18, - "\texport: %s": 7, - "\timport: %s\n": 8, - "Aborted": 15, - "Access token": 26, - "Access token received, you can use %v now.\n": 35, - "Append to file": 28, - "Backend": 40, - "Client ID": 22, - "Client secret": 23, - "Delete the service configuration \"%v\"?": 14, - "Disable auto correction of submitted listens": 31, - "During the import the following errors occurred:": 5, - "Error: %v\n": 6, - "Error: OAuth state mismatch": 34, - "Failed reading config: %v": 9, - "File path": 27, - "From timestamp: %v (%v)": 41, - "Import failed, last reported timestamp was %v (%s)": 42, - "Imported %v of %v %s into %v.": 4, - "Include skipped listens": 32, + "\tbackend: %v": 11, + "\texport: %s": 0, + "\timport: %s\n": 1, + "Aborted": 8, + "Access token": 19, + "Access token received, you can use %v now.\n": 28, + "Append to file": 21, + "Backend": 36, + "Client ID": 15, + "Client secret": 16, + "Delete the service configuration \"%v\"?": 7, + "Disable auto correction of submitted listens": 24, + "During the import the following errors occurred:": 41, + "Error: %v\n": 42, + "Error: OAuth state mismatch": 27, + "Failed reading config: %v": 2, + "File path": 20, + "From timestamp: %v (%v)": 38, + "Import failed, last reported timestamp was %v (%s)": 39, + "Imported %v of %v %s into %v.": 40, + "Include skipped listens": 25, "Latest timestamp: %v (%v)": 43, - "No": 37, - "Playlist title": 29, - "Saved service %v using backend %v": 12, - "Server URL": 24, - "Service": 39, - "Service \"%v\" deleted\n": 16, - "Service name": 10, - "The backend %v requires authentication. Authenticate now?": 13, - "Token received, you can close this window now.": 19, - "Transferring %s from %s to %s...": 3, - "Unique playlist identifier": 30, - "Updated service %v using backend %v\n": 17, - "User name": 25, - "Visit the URL for authorization: %v": 33, - "Yes": 36, - "a service with this name already exists": 11, - "backend %s does not implement %s": 20, - "done": 2, - "exporting": 0, - "importing": 1, + "No": 33, + "Playlist title": 22, + "Saved service %v using backend %v": 5, + "Server URL": 17, + "Service": 35, + "Service \"%v\" deleted\n": 9, + "Service name": 3, + "The backend %v requires authentication. Authenticate now?": 6, + "Token received, you can close this window now.": 12, + "Transferring %s from %s to %s...": 37, + "Unique playlist identifier": 23, + "Updated service %v using backend %v\n": 10, + "User name": 18, + "Visit the URL for authorization: %v": 26, + "Yes": 32, + "a service with this name already exists": 4, + "backend %s does not implement %s": 13, + "done": 31, + "exporting": 29, + "importing": 30, "key must only consist of A-Za-z0-9_-": 45, "no configuration file defined, cannot write config": 44, - "no existing service configurations": 38, + "no existing service configurations": 34, "no service configuration \"%v\"": 46, - "unknown backend \"%s\"": 21, + "unknown backend \"%s\"": 14, } var deIndex = []uint32{ // 48 elements // Entry 0 - 1F - 0x00000000, 0x0000000b, 0x00000016, 0x0000001d, - 0x00000046, 0x00000071, 0x000000a8, 0x000000bb, - 0x000000bb, 0x000000bb, 0x000000bb, 0x000000bb, - 0x000000bb, 0x000000bb, 0x000000bb, 0x000000bb, - 0x000000bb, 0x000000bb, 0x000000bb, 0x000000bb, - 0x000000bb, 0x000000bb, 0x000000bb, 0x000000bb, - 0x000000bb, 0x000000bb, 0x000000bb, 0x000000bb, - 0x000000bb, 0x000000bb, 0x000000bb, 0x000000bb, + 0x00000000, 0x00000013, 0x00000027, 0x00000052, + 0x0000005e, 0x0000008d, 0x000000bd, 0x00000104, + 0x00000133, 0x0000013f, 0x00000162, 0x00000198, + 0x000001ac, 0x000001e7, 0x00000213, 0x00000233, + 0x0000023d, 0x0000024b, 0x00000256, 0x00000263, + 0x00000271, 0x0000027b, 0x0000028e, 0x000002a1, + 0x000002b8, 0x000002ec, 0x0000030d, 0x00000333, + 0x0000035d, 0x0000039d, 0x000003a8, 0x000003b3, // Entry 20 - 3F - 0x000000bb, 0x000000bb, 0x000000bb, 0x000000bb, - 0x000000bb, 0x000000bb, 0x000000bb, 0x000000bb, - 0x000000bb, 0x000000bb, 0x000000bb, 0x000000bb, - 0x000000bb, 0x000000bb, 0x000000bb, 0x000000bb, + 0x000003ba, 0x000003bd, 0x000003c2, 0x000003eb, + 0x000003f3, 0x000003fb, 0x00000424, 0x00000442, + 0x0000047f, 0x000004aa, 0x000004e1, 0x000004f4, + 0x00000517, 0x00000568, 0x0000059f, 0x000005c6, } // Size: 216 bytes -const deData string = "" + // Size: 187 bytes - "\x02exportiere\x02importiere\x02fertig\x02Übertrage %[1]s von %[2]s nach" + - " %[3]s...\x02%[1]v von %[2]v %[3]s in %[4]v importiert.\x02Während des I" + - "mports sind folgende Fehler aufgetreten:\x04\x00\x01\x0a\x0e\x02Fehler: " + - "%[1]v" +const deData string = "" + // Size: 1478 bytes + "\x04\x01\x09\x00\x0e\x02Export: %[1]s\x04\x01\x09\x01\x0a\x0e\x02Import:" + + " %[1]s\x02Fehler beim Lesen der Konfiguration: %[1]v\x02Servicename\x02e" + + "in Service mit diesem Namen existiert bereits\x02Service %[1]v mit dem B" + + "ackend %[2]v gespeichert\x02Das Backend %[1]v erfordert Authentifizierun" + + "g. Jetzt authentifizieren?\x02Die Servicekonfiguration „%[1]v“ löschen?" + + "\x02Abgebrochen\x04\x00\x01\x0a\x1e\x02Service „%[1]v“ gelöscht\x04\x00" + + "\x01\x0a1\x02Service %[1]v mit dem Backend %[2]v aktualisiert\x04\x01" + + "\x09\x00\x0f\x02Backend: %[1]v\x02Token erhalten, das Fenster kann jetzt" + + " geschlossen werden.\x02das backend %[1]s implementiert %[2]s nicht\x02u" + + "nbekanntes Backend „%[1]s“\x02Client-ID\x02Client-Secret\x02Server-URL" + + "\x02Benutzername\x02Zugriffstoken\x02Dateipfad\x02An Datei anhängen\x02T" + + "itel der Playlist\x02Eindeutige Playlist-ID\x02Autokorrektur für übermit" + + "telte Titel deaktivieren\x02Übersprungene Titel einbeziehen\x02URL für A" + + "utorisierung öffnen: %[1]v\x02Fehler: OAuth-State stimmt nicht überein" + + "\x04\x00\x01\x0a;\x02Zugriffstoken erhalten, %[1]v kann jetzt verwendet " + + "werden.\x02exportiere\x02importiere\x02fertig\x02Ja\x02Nein\x02keine bes" + + "tehenden Servicekonfigurationen\x02Service\x02Backend\x02Übertrage %[1]s" + + " von %[2]s nach %[3]s...\x02Ab Zeitstempel: %[1]v (%[2]v)\x02Import fehl" + + "geschlagen, letzter Zeitstempel war %[1]v (%[2]s)\x02%[1]v von %[2]v %[3" + + "]s in %[4]v importiert.\x02Während des Imports sind folgende Fehler aufg" + + "etreten:\x04\x00\x01\x0a\x0e\x02Fehler: %[1]v\x02Letzter Zeitstempel: %[" + + "1]v (%[2]v)\x02keine Konfigurationsdatei definiert, Konfiguration kann n" + + "icht geschrieben werden\x02Schlüssel darf nur die Zeichen A-Za-z0-9_- be" + + "inhalten\x02keine Servicekonfiguration „%[1]v“" var enIndex = []uint32{ // 48 elements // Entry 0 - 1F - 0x00000000, 0x0000000a, 0x00000014, 0x00000019, - 0x00000043, 0x0000006d, 0x0000009e, 0x000000b0, - 0x000000c3, 0x000000d7, 0x000000f4, 0x00000101, - 0x00000129, 0x00000151, 0x0000018e, 0x000001b8, - 0x000001c0, 0x000001dd, 0x0000020c, 0x00000220, - 0x0000024f, 0x00000276, 0x0000028e, 0x00000298, - 0x000002a6, 0x000002b1, 0x000002bb, 0x000002c8, - 0x000002d2, 0x000002e1, 0x000002f0, 0x0000030b, + 0x00000000, 0x00000013, 0x00000027, 0x00000044, + 0x00000051, 0x00000079, 0x000000a1, 0x000000de, + 0x00000108, 0x00000110, 0x0000012d, 0x0000015c, + 0x00000170, 0x0000019f, 0x000001c6, 0x000001de, + 0x000001e8, 0x000001f6, 0x00000201, 0x0000020b, + 0x00000218, 0x00000222, 0x00000231, 0x00000240, + 0x0000025b, 0x00000288, 0x000002a0, 0x000002c7, + 0x000002e3, 0x00000316, 0x00000320, 0x0000032a, // Entry 20 - 3F - 0x00000338, 0x00000350, 0x00000377, 0x00000393, - 0x000003c6, 0x000003ca, 0x000003cd, 0x000003f0, - 0x000003f8, 0x00000400, 0x0000041e, 0x00000457, + 0x0000032f, 0x00000333, 0x00000336, 0x00000359, + 0x00000361, 0x00000369, 0x00000393, 0x000003b1, + 0x000003ea, 0x00000414, 0x00000445, 0x00000457, 0x00000477, 0x000004aa, 0x000004cf, 0x000004f0, } // Size: 216 bytes const enData string = "" + // Size: 1264 bytes - "\x02exporting\x02importing\x02done\x02Transferring %[1]s from %[2]s to %" + - "[3]s...\x02Imported %[1]v of %[2]v %[3]s into %[4]v.\x02During the impor" + - "t the following errors occurred:\x04\x00\x01\x0a\x0d\x02Error: %[1]v\x04" + - "\x01\x09\x00\x0e\x02export: %[1]s\x04\x01\x09\x01\x0a\x0e\x02import: %[1" + - "]s\x02Failed reading config: %[1]v\x02Service name\x02a service with thi" + - "s name already exists\x02Saved service %[1]v using backend %[2]v\x02The " + - "backend %[1]v requires authentication. Authenticate now?\x02Delete the s" + - "ervice configuration \x22%[1]v\x22?\x02Aborted\x04\x00\x01\x0a\x18\x02Se" + - "rvice \x22%[1]v\x22 deleted\x04\x00\x01\x0a*\x02Updated service %[1]v us" + - "ing backend %[2]v\x04\x01\x09\x00\x0f\x02backend: %[1]v\x02Token receive" + - "d, you can close this window now.\x02backend %[1]s does not implement %[" + - "2]s\x02unknown backend \x22%[1]s\x22\x02Client ID\x02Client secret\x02Se" + - "rver URL\x02User name\x02Access token\x02File path\x02Append to file\x02" + - "Playlist title\x02Unique playlist identifier\x02Disable auto correction " + - "of submitted listens\x02Include skipped listens\x02Visit the URL for aut" + - "horization: %[1]v\x02Error: OAuth state mismatch\x04\x00\x01\x0a.\x02Acc" + - "ess token received, you can use %[1]v now.\x02Yes\x02No\x02no existing s" + - "ervice configurations\x02Service\x02Backend\x02From timestamp: %[1]v (%[" + - "2]v)\x02Import failed, last reported timestamp was %[1]v (%[2]s)\x02Late" + - "st timestamp: %[1]v (%[2]v)\x02no configuration file defined, cannot wri" + - "te config\x02key must only consist of A-Za-z0-9_-\x02no service configur" + - "ation \x22%[1]v\x22" + "\x04\x01\x09\x00\x0e\x02export: %[1]s\x04\x01\x09\x01\x0a\x0e\x02import:" + + " %[1]s\x02Failed reading config: %[1]v\x02Service name\x02a service with" + + " this name already exists\x02Saved service %[1]v using backend %[2]v\x02" + + "The backend %[1]v requires authentication. Authenticate now?\x02Delete t" + + "he service configuration \x22%[1]v\x22?\x02Aborted\x04\x00\x01\x0a\x18" + + "\x02Service \x22%[1]v\x22 deleted\x04\x00\x01\x0a*\x02Updated service %[" + + "1]v using backend %[2]v\x04\x01\x09\x00\x0f\x02backend: %[1]v\x02Token r" + + "eceived, you can close this window now.\x02backend %[1]s does not implem" + + "ent %[2]s\x02unknown backend \x22%[1]s\x22\x02Client ID\x02Client secret" + + "\x02Server URL\x02User name\x02Access token\x02File path\x02Append to fi" + + "le\x02Playlist title\x02Unique playlist identifier\x02Disable auto corre" + + "ction of submitted listens\x02Include skipped listens\x02Visit the URL f" + + "or authorization: %[1]v\x02Error: OAuth state mismatch\x04\x00\x01\x0a." + + "\x02Access token received, you can use %[1]v now.\x02exporting\x02import" + + "ing\x02done\x02Yes\x02No\x02no existing service configurations\x02Servic" + + "e\x02Backend\x02Transferring %[1]s from %[2]s to %[3]s...\x02From timest" + + "amp: %[1]v (%[2]v)\x02Import failed, last reported timestamp was %[1]v (" + + "%[2]s)\x02Imported %[1]v of %[2]v %[3]s into %[4]v.\x02During the import" + + " the following errors occurred:\x04\x00\x01\x0a\x0d\x02Error: %[1]v\x02L" + + "atest timestamp: %[1]v (%[2]v)\x02no configuration file defined, cannot " + + "write config\x02key must only consist of A-Za-z0-9_-\x02no service confi" + + "guration \x22%[1]v\x22" - // Total table size 1883 bytes (1KiB); checksum: 4C56F9E5 + // Total table size 3174 bytes (3KiB); checksum: 18BB58D4 diff --git a/internal/translations/locales/de/out.gotext.json b/internal/translations/locales/de/out.gotext.json index a6059b7..94494ee 100644 --- a/internal/translations/locales/de/out.gotext.json +++ b/internal/translations/locales/de/out.gotext.json @@ -4,7 +4,7 @@ { "id": "export: {ExportCapabilities__}", "message": "export: {ExportCapabilities__}", - "translation": "", + "translation": "Export: {ExportCapabilities__}", "placeholders": [ { "id": "ExportCapabilities__", @@ -19,7 +19,7 @@ { "id": "import: {ImportCapabilities__}", "message": "import: {ImportCapabilities__}", - "translation": "", + "translation": "Import: {ImportCapabilities__}", "placeholders": [ { "id": "ImportCapabilities__", @@ -34,7 +34,7 @@ { "id": "Failed reading config: {Err}", "message": "Failed reading config: {Err}", - "translation": "", + "translation": "Fehler beim Lesen der Konfiguration: {Err}", "placeholders": [ { "id": "Err", @@ -49,17 +49,17 @@ { "id": "Service name", "message": "Service name", - "translation": "" + "translation": "Servicename" }, { "id": "a service with this name already exists", "message": "a service with this name already exists", - "translation": "" + "translation": "ein Service mit diesem Namen existiert bereits" }, { "id": "Saved service {Name} using backend {Backend}", "message": "Saved service {Name} using backend {Backend}", - "translation": "", + "translation": "Service {Name} mit dem Backend {Backend} gespeichert", "placeholders": [ { "id": "Name", @@ -82,7 +82,7 @@ { "id": "The backend {Backend} requires authentication. Authenticate now?", "message": "The backend {Backend} requires authentication. Authenticate now?", - "translation": "", + "translation": "Das Backend {Backend} erfordert Authentifizierung. Jetzt authentifizieren?", "placeholders": [ { "id": "Backend", @@ -97,7 +97,7 @@ { "id": "Delete the service configuration \"{Service}\"?", "message": "Delete the service configuration \"{Service}\"?", - "translation": "", + "translation": "Die Servicekonfiguration „{Service}“ löschen?", "placeholders": [ { "id": "Service", @@ -112,12 +112,12 @@ { "id": "Aborted", "message": "Aborted", - "translation": "" + "translation": "Abgebrochen" }, { "id": "Service \"{Name}\" deleted", "message": "Service \"{Name}\" deleted", - "translation": "", + "translation": "Service „{Name}“ gelöscht", "placeholders": [ { "id": "Name", @@ -132,7 +132,7 @@ { "id": "Updated service {Name} using backend {Backend}", "message": "Updated service {Name} using backend {Backend}", - "translation": "", + "translation": "Service {Name} mit dem Backend {Backend} aktualisiert", "placeholders": [ { "id": "Name", @@ -155,7 +155,7 @@ { "id": "backend: {Backend}", "message": "backend: {Backend}", - "translation": "", + "translation": "Backend: {Backend}", "placeholders": [ { "id": "Backend", @@ -170,12 +170,12 @@ { "id": "Token received, you can close this window now.", "message": "Token received, you can close this window now.", - "translation": "" + "translation": "Token erhalten, das Fenster kann jetzt geschlossen werden." }, { "id": "backend {Backend} does not implement {InterfaceName}", "message": "backend {Backend} does not implement {InterfaceName}", - "translation": "", + "translation": "das backend {Backend} implementiert {InterfaceName} nicht", "placeholders": [ { "id": "Backend", @@ -198,7 +198,7 @@ { "id": "unknown backend \"{BackendName}\"", "message": "unknown backend \"{BackendName}\"", - "translation": "", + "translation": "unbekanntes Backend „{BackendName}“", "placeholders": [ { "id": "BackendName", @@ -213,62 +213,62 @@ { "id": "Client ID", "message": "Client ID", - "translation": "" + "translation": "Client-ID" }, { "id": "Client secret", "message": "Client secret", - "translation": "" + "translation": "Client-Secret" }, { "id": "Server URL", "message": "Server URL", - "translation": "" + "translation": "Server-URL" }, { "id": "User name", "message": "User name", - "translation": "" + "translation": "Benutzername" }, { "id": "Access token", "message": "Access token", - "translation": "" + "translation": "Zugriffstoken" }, { "id": "File path", "message": "File path", - "translation": "" + "translation": "Dateipfad" }, { "id": "Append to file", "message": "Append to file", - "translation": "" + "translation": "An Datei anhängen" }, { "id": "Playlist title", "message": "Playlist title", - "translation": "" + "translation": "Titel der Playlist" }, { "id": "Unique playlist identifier", "message": "Unique playlist identifier", - "translation": "" + "translation": "Eindeutige Playlist-ID" }, { "id": "Disable auto correction of submitted listens", "message": "Disable auto correction of submitted listens", - "translation": "" + "translation": "Autokorrektur für übermittelte Titel deaktivieren" }, { "id": "Include skipped listens", "message": "Include skipped listens", - "translation": "" + "translation": "Übersprungene Titel einbeziehen" }, { "id": "Visit the URL for authorization: {Url}", "message": "Visit the URL for authorization: {Url}", - "translation": "", + "translation": "URL für Autorisierung öffnen: {Url}", "placeholders": [ { "id": "Url", @@ -283,12 +283,12 @@ { "id": "Error: OAuth state mismatch", "message": "Error: OAuth state mismatch", - "translation": "" + "translation": "Fehler: OAuth-State stimmt nicht überein" }, { "id": "Access token received, you can use {Name} now.", "message": "Access token received, you can use {Name} now.", - "translation": "", + "translation": "Zugriffstoken erhalten, {Name} kann jetzt verwendet werden.", "placeholders": [ { "id": "Name", @@ -324,27 +324,27 @@ { "id": "Yes", "message": "Yes", - "translation": "" + "translation": "Ja" }, { "id": "No", "message": "No", - "translation": "" + "translation": "Nein" }, { "id": "no existing service configurations", "message": "no existing service configurations", - "translation": "" + "translation": "keine bestehenden Servicekonfigurationen" }, { "id": "Service", "message": "Service", - "translation": "" + "translation": "Service" }, { "id": "Backend", "message": "Backend", - "translation": "" + "translation": "Backend" }, { "id": "Transferring {Entity} from {SourceName} to {TargetName}...", @@ -380,7 +380,7 @@ { "id": "From timestamp: {Arg_1} ({Arg_2})", "message": "From timestamp: {Arg_1} ({Arg_2})", - "translation": "", + "translation": "Ab Zeitstempel: {Arg_1} ({Arg_2})", "placeholders": [ { "id": "Arg_1", @@ -401,7 +401,7 @@ { "id": "Import failed, last reported timestamp was {Arg_1} ({Arg_2})", "message": "Import failed, last reported timestamp was {Arg_1} ({Arg_2})", - "translation": "", + "translation": "Import fehlgeschlagen, letzter Zeitstempel war {Arg_1} ({Arg_2})", "placeholders": [ { "id": "Arg_1", @@ -481,7 +481,7 @@ { "id": "Latest timestamp: {Arg_1} ({Arg_2})", "message": "Latest timestamp: {Arg_1} ({Arg_2})", - "translation": "", + "translation": "Letzter Zeitstempel: {Arg_1} ({Arg_2})", "placeholders": [ { "id": "Arg_1", @@ -502,17 +502,17 @@ { "id": "no configuration file defined, cannot write config", "message": "no configuration file defined, cannot write config", - "translation": "" + "translation": "keine Konfigurationsdatei definiert, Konfiguration kann nicht geschrieben werden" }, { "id": "key must only consist of A-Za-z0-9_-", "message": "key must only consist of A-Za-z0-9_-", - "translation": "" + "translation": "Schlüssel darf nur die Zeichen A-Za-z0-9_- beinhalten" }, { "id": "no service configuration \"{Name}\"", "message": "no service configuration \"{Name}\"", - "translation": "", + "translation": "keine Servicekonfiguration „{Name}“", "placeholders": [ { "id": "Name",