Use gettext for backend translations too
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
parent
0a4dc155e6
commit
c0f10e2288
57 changed files with 1321 additions and 859 deletions
|
@ -1,4 +1,4 @@
|
|||
FROM photoprism/development:20200625
|
||||
FROM photoprism/development:20200714
|
||||
|
||||
# Set up project directory
|
||||
WORKDIR "/go/src/github.com/photoprism/photoprism"
|
||||
|
|
BIN
assets/locales/de/default.mo
Normal file
BIN
assets/locales/de/default.mo
Normal file
Binary file not shown.
266
assets/locales/de/default.po
Normal file
266
assets/locales/de/default.po
Normal file
|
@ -0,0 +1,266 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-14 19:44+0000\n"
|
||||
"PO-Revision-Date: 2020-07-14 22:16+0200\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: de\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.3.1\n"
|
||||
"X-Poedit-Basepath: .\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: messages.go:69
|
||||
msgid "Unexpected error, please try again"
|
||||
msgstr "Unerwarteter Fehler, bitte erneut versuchen"
|
||||
|
||||
#: messages.go:70
|
||||
msgid "Invalid request"
|
||||
msgstr "Ungültige Anfrage"
|
||||
|
||||
#: messages.go:71
|
||||
msgid "Changes could not be saved"
|
||||
msgstr "Fehler beim Speichern der Daten"
|
||||
|
||||
#: messages.go:72
|
||||
msgid "Could not be deleted"
|
||||
msgstr "Konnte nicht gelöscht werden"
|
||||
|
||||
#: messages.go:73
|
||||
#, c-format
|
||||
msgid "%s already exists"
|
||||
msgstr "%s existiert bereits"
|
||||
|
||||
#: messages.go:74 messages.go:77
|
||||
msgid "Not found on server, deleted?"
|
||||
msgstr "Nicht auf Server gefunden, gelöscht?"
|
||||
|
||||
#: messages.go:75
|
||||
msgid "File not found"
|
||||
msgstr "Datei konnte nicht gefunden werden"
|
||||
|
||||
#: messages.go:76
|
||||
msgid "Selection not found"
|
||||
msgstr "Auswahl nicht gefunden"
|
||||
|
||||
#: messages.go:78
|
||||
msgid "Account not found"
|
||||
msgstr "Unbekannter Account"
|
||||
|
||||
#: messages.go:79
|
||||
msgid "User not found"
|
||||
msgstr "Nutzer nicht gefunden"
|
||||
|
||||
#: messages.go:80
|
||||
msgid "Label not found"
|
||||
msgstr "Kategorie nicht gefunden"
|
||||
|
||||
#: messages.go:81
|
||||
msgid "Album not found"
|
||||
msgstr "Album nicht gefunden - gelöscht?"
|
||||
|
||||
#: messages.go:82
|
||||
msgid "Not available in public mode"
|
||||
msgstr "Im öffentlichen Modus nicht verfügbar"
|
||||
|
||||
#: messages.go:83
|
||||
msgid "not available in read-only mode"
|
||||
msgstr "Funktion im ‘read-only’ Modus nicht verfügbar"
|
||||
|
||||
#: messages.go:84
|
||||
msgid "Please log in and try again"
|
||||
msgstr "Anmeldung erforderlich"
|
||||
|
||||
#: messages.go:85
|
||||
msgid "Upload might be offensive"
|
||||
msgstr "Inhalt könnte anstößig sein und wurde abgelehnt"
|
||||
|
||||
#: messages.go:86
|
||||
msgid "No items selected"
|
||||
msgstr "Nichts ausgewählt"
|
||||
|
||||
#: messages.go:87
|
||||
msgid "Failed creating file, please check permissions"
|
||||
msgstr "Datei konnte nicht angelegt werden"
|
||||
|
||||
#: messages.go:88
|
||||
msgid "Failed creating folder, please check permissions"
|
||||
msgstr "Verzeichnis konnte nicht angelegt werden"
|
||||
|
||||
#: messages.go:89
|
||||
msgid "Could not connect, please try again"
|
||||
msgstr "Verbindung fehlgeschlagen"
|
||||
|
||||
#: messages.go:90
|
||||
msgid "Invalid password, please try again"
|
||||
msgstr "Ungültiges Passwort"
|
||||
|
||||
#: messages.go:91
|
||||
msgid "Feature disabled"
|
||||
msgstr "Funktion deaktiviert"
|
||||
|
||||
#: messages.go:92
|
||||
msgid "No labels selected"
|
||||
msgstr "Keine Kategorien ausgewählt"
|
||||
|
||||
#: messages.go:93
|
||||
msgid "No albums selected"
|
||||
msgstr "Keine Alben ausgewählt"
|
||||
|
||||
#: messages.go:94
|
||||
msgid "No files available for download"
|
||||
msgstr "Nicht zum Download verfügbar"
|
||||
|
||||
#: messages.go:95
|
||||
msgid "Failed to create zip file"
|
||||
msgstr "Zip-Datei konnte nicht erstellt werden"
|
||||
|
||||
#: messages.go:98
|
||||
msgid "Changes successfully saved"
|
||||
msgstr "Änderungen erfolgreich gespeichert"
|
||||
|
||||
#: messages.go:99
|
||||
msgid "Album created"
|
||||
msgstr "Album erstellt"
|
||||
|
||||
#: messages.go:100
|
||||
msgid "Album saved"
|
||||
msgstr "Album gespeichert"
|
||||
|
||||
#: messages.go:101
|
||||
#, c-format
|
||||
msgid "Album %s deleted"
|
||||
msgstr "Album %s gelöscht"
|
||||
|
||||
#: messages.go:102
|
||||
msgid "Album contents cloned"
|
||||
msgstr "Album-Einträge kopiert"
|
||||
|
||||
#: messages.go:103
|
||||
msgid "File removed from stack"
|
||||
msgstr "Datei aus Stapel entfernt"
|
||||
|
||||
#: messages.go:104
|
||||
#, c-format
|
||||
msgid "Selection added to %s"
|
||||
msgstr "Auswahl zu %s hinzugefügt"
|
||||
|
||||
#: messages.go:105
|
||||
#, c-format
|
||||
msgid "One entry added to %s"
|
||||
msgstr "Ein Eintrag zu %s hinzugefügt"
|
||||
|
||||
#: messages.go:106
|
||||
#, c-format
|
||||
msgid "%d entries added to %s"
|
||||
msgstr "%d Einträge zu %s hinzugefügt"
|
||||
|
||||
#: messages.go:107
|
||||
#, c-format
|
||||
msgid "One entry removed from %s"
|
||||
msgstr "Ein Eintrag aus %s entfernt"
|
||||
|
||||
#: messages.go:108
|
||||
#, c-format
|
||||
msgid "%d entries removed from %s"
|
||||
msgstr "%d Einträge aus %s entfernt"
|
||||
|
||||
#: messages.go:109
|
||||
msgid "Account created"
|
||||
msgstr "Server-Konfiguration angelegt"
|
||||
|
||||
#: messages.go:110
|
||||
msgid "Account saved"
|
||||
msgstr "Server-Konfiguration gespeichert"
|
||||
|
||||
#: messages.go:111
|
||||
msgid "Account deleted"
|
||||
msgstr "Server-Konfiguration gelöscht"
|
||||
|
||||
#: messages.go:112
|
||||
msgid "Settings saved"
|
||||
msgstr "Einstellungen gespeichert"
|
||||
|
||||
#: messages.go:113
|
||||
msgid "Password changed"
|
||||
msgstr "Passwort geändert"
|
||||
|
||||
#: messages.go:114
|
||||
#, c-format
|
||||
msgid "Import completed in %d s"
|
||||
msgstr "Import in %d s abgeschlossen"
|
||||
|
||||
#: messages.go:115
|
||||
msgid "Import canceled"
|
||||
msgstr "Import abgebrochen"
|
||||
|
||||
#: messages.go:116
|
||||
#, c-format
|
||||
msgid "Indexing completed in %d s"
|
||||
msgstr "Indizierung in %d s abgeschlossen"
|
||||
|
||||
#: messages.go:117
|
||||
msgid "Indexing originals..."
|
||||
msgstr "Indiziere Dateien…"
|
||||
|
||||
#: messages.go:118
|
||||
#, c-format
|
||||
msgid "Indexing files in %s"
|
||||
msgstr "Indiziere Dateien in %s"
|
||||
|
||||
#: messages.go:119
|
||||
msgid "Indexing canceled"
|
||||
msgstr "Indizierung abgebrochen"
|
||||
|
||||
#: messages.go:120
|
||||
#, c-format
|
||||
msgid "Removed %d files and %d photos"
|
||||
msgstr "%d Dateien und %d Fotos wurden entfernt"
|
||||
|
||||
#: messages.go:121
|
||||
#, c-format
|
||||
msgid "Moving files from %s"
|
||||
msgstr "Verschiebe Dateien von %s"
|
||||
|
||||
#: messages.go:122
|
||||
#, c-format
|
||||
msgid "Copying files from %s"
|
||||
msgstr "Kopiere Dateien von %s"
|
||||
|
||||
#: messages.go:123
|
||||
msgid "Labels deleted"
|
||||
msgstr "Kategorien gelöscht”"
|
||||
|
||||
#: messages.go:124
|
||||
msgid "Label saved"
|
||||
msgstr "Kategorie gespeichert"
|
||||
|
||||
#: messages.go:125
|
||||
#, c-format
|
||||
msgid "%d files uploaded in %d s"
|
||||
msgstr "%d Dateien hochgeladen in %d s"
|
||||
|
||||
#: messages.go:126
|
||||
msgid "Selection archived"
|
||||
msgstr "Auswahl archiviert"
|
||||
|
||||
#: messages.go:127
|
||||
msgid "Selection restored"
|
||||
msgstr "Auswahl wiederhergestellt"
|
||||
|
||||
#: messages.go:128
|
||||
msgid "Selection marked as private"
|
||||
msgstr "Auswahl als privat markiert"
|
||||
|
||||
#: messages.go:129
|
||||
msgid "Albums deleted"
|
||||
msgstr "Alben gelöscht"
|
||||
|
||||
#: messages.go:130
|
||||
#, c-format
|
||||
msgid "Zip created in %d s"
|
||||
msgstr "Zip-Datei erstellt in %d s"
|
BIN
assets/locales/en/default.mo
Normal file
BIN
assets/locales/en/default.mo
Normal file
Binary file not shown.
270
assets/locales/en/default.po
Normal file
270
assets/locales/en/default.po
Normal file
|
@ -0,0 +1,270 @@
|
|||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-14 19:44+0000\n"
|
||||
"PO-Revision-Date: 2020-07-14 22:03+0200\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.3.1\n"
|
||||
"Last-Translator: \n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"Language: en\n"
|
||||
|
||||
#: messages.go:69
|
||||
msgid "Unexpected error, please try again"
|
||||
msgstr "Unexpected error, please try again"
|
||||
|
||||
#: messages.go:70
|
||||
msgid "Invalid request"
|
||||
msgstr "Invalid request"
|
||||
|
||||
#: messages.go:71
|
||||
msgid "Changes could not be saved"
|
||||
msgstr "Changes could not be saved"
|
||||
|
||||
#: messages.go:72
|
||||
msgid "Could not be deleted"
|
||||
msgstr "Could not be deleted"
|
||||
|
||||
#: messages.go:73
|
||||
#, c-format
|
||||
msgid "%s already exists"
|
||||
msgstr "%s already exists"
|
||||
|
||||
#: messages.go:74 messages.go:77
|
||||
msgid "Not found on server, deleted?"
|
||||
msgstr "Not found on server, deleted?"
|
||||
|
||||
#: messages.go:75
|
||||
msgid "File not found"
|
||||
msgstr "File not found"
|
||||
|
||||
#: messages.go:76
|
||||
msgid "Selection not found"
|
||||
msgstr "Selection not found"
|
||||
|
||||
#: messages.go:78
|
||||
msgid "Account not found"
|
||||
msgstr "Account not found"
|
||||
|
||||
#: messages.go:79
|
||||
msgid "User not found"
|
||||
msgstr "User not found"
|
||||
|
||||
#: messages.go:80
|
||||
msgid "Label not found"
|
||||
msgstr "Label not found"
|
||||
|
||||
#: messages.go:81
|
||||
msgid "Album not found"
|
||||
msgstr "Album not found"
|
||||
|
||||
#: messages.go:82
|
||||
msgid "Not available in public mode"
|
||||
msgstr "Not available in public mode"
|
||||
|
||||
#: messages.go:83
|
||||
msgid "not available in read-only mode"
|
||||
msgstr "not available in read-only mode"
|
||||
|
||||
#: messages.go:84
|
||||
msgid "Please log in and try again"
|
||||
msgstr "Please log in and try again"
|
||||
|
||||
#: messages.go:85
|
||||
msgid "Upload might be offensive"
|
||||
msgstr "Upload might be offensive"
|
||||
|
||||
#: messages.go:86
|
||||
msgid "No items selected"
|
||||
msgstr "No items selected"
|
||||
|
||||
#: messages.go:87
|
||||
msgid "Failed creating file, please check permissions"
|
||||
msgstr "Failed creating file, please check permissions"
|
||||
|
||||
#: messages.go:88
|
||||
msgid "Failed creating folder, please check permissions"
|
||||
msgstr "Failed creating folder, please check permissions"
|
||||
|
||||
#: messages.go:89
|
||||
msgid "Could not connect, please try again"
|
||||
msgstr "Could not connect, please try again"
|
||||
|
||||
#: messages.go:90
|
||||
msgid "Invalid password, please try again"
|
||||
msgstr "Invalid password, please try again"
|
||||
|
||||
#: messages.go:91
|
||||
msgid "Feature disabled"
|
||||
msgstr "Feature disabled"
|
||||
|
||||
#: messages.go:92
|
||||
msgid "No labels selected"
|
||||
msgstr "No labels selected"
|
||||
|
||||
#: messages.go:93
|
||||
msgid "No albums selected"
|
||||
msgstr "No albums selected"
|
||||
|
||||
#: messages.go:94
|
||||
msgid "No files available for download"
|
||||
msgstr "No files available for download"
|
||||
|
||||
#: messages.go:95
|
||||
msgid "Failed to create zip file"
|
||||
msgstr "Failed to create zip file"
|
||||
|
||||
#: messages.go:98
|
||||
msgid "Changes successfully saved"
|
||||
msgstr "Changes successfully saved"
|
||||
|
||||
#: messages.go:99
|
||||
msgid "Album created"
|
||||
msgstr "Album created"
|
||||
|
||||
#: messages.go:100
|
||||
msgid "Album saved"
|
||||
msgstr "Album saved"
|
||||
|
||||
#: messages.go:101
|
||||
#, c-format
|
||||
msgid "Album %s deleted"
|
||||
msgstr "Album %s deleted"
|
||||
|
||||
#: messages.go:102
|
||||
msgid "Album contents cloned"
|
||||
msgstr "Album contents cloned"
|
||||
|
||||
#: messages.go:103
|
||||
msgid "File removed from stack"
|
||||
msgstr "File removed from stack"
|
||||
|
||||
#: messages.go:104
|
||||
#, c-format
|
||||
msgid "Selection added to %s"
|
||||
msgstr "Selection added to %s"
|
||||
|
||||
#: messages.go:105
|
||||
#, c-format
|
||||
msgid "One entry added to %s"
|
||||
msgstr "One entry added to %s"
|
||||
|
||||
#: messages.go:106
|
||||
#, c-format
|
||||
msgid "%d entries added to %s"
|
||||
msgstr "%d entries added to %s"
|
||||
|
||||
#: messages.go:107
|
||||
#, c-format
|
||||
msgid "One entry removed from %s"
|
||||
msgstr "One entry removed from %s"
|
||||
|
||||
#: messages.go:108
|
||||
#, c-format
|
||||
msgid "%d entries removed from %s"
|
||||
msgstr "%d entries removed from %s"
|
||||
|
||||
#: messages.go:109
|
||||
msgid "Account created"
|
||||
msgstr "Account created"
|
||||
|
||||
#: messages.go:110
|
||||
msgid "Account saved"
|
||||
msgstr "Account saved"
|
||||
|
||||
#: messages.go:111
|
||||
msgid "Account deleted"
|
||||
msgstr "Account deleted"
|
||||
|
||||
#: messages.go:112
|
||||
msgid "Settings saved"
|
||||
msgstr "Settings saved"
|
||||
|
||||
#: messages.go:113
|
||||
msgid "Password changed"
|
||||
msgstr "Password changed"
|
||||
|
||||
#: messages.go:114
|
||||
#, c-format
|
||||
msgid "Import completed in %d s"
|
||||
msgstr "Import completed in %d s"
|
||||
|
||||
#: messages.go:115
|
||||
msgid "Import canceled"
|
||||
msgstr "Import canceled"
|
||||
|
||||
#: messages.go:116
|
||||
#, c-format
|
||||
msgid "Indexing completed in %d s"
|
||||
msgstr "Indexing completed in %d s"
|
||||
|
||||
#: messages.go:117
|
||||
msgid "Indexing originals..."
|
||||
msgstr "Indexing originals..."
|
||||
|
||||
#: messages.go:118
|
||||
#, c-format
|
||||
msgid "Indexing files in %s"
|
||||
msgstr "Indexing files in %s"
|
||||
|
||||
#: messages.go:119
|
||||
msgid "Indexing canceled"
|
||||
msgstr "Indexing canceled"
|
||||
|
||||
#: messages.go:120
|
||||
#, c-format
|
||||
msgid "Removed %d files and %d photos"
|
||||
msgstr "Removed %d files and %d photos"
|
||||
|
||||
#: messages.go:121
|
||||
#, c-format
|
||||
msgid "Moving files from %s"
|
||||
msgstr "Moving files from %s"
|
||||
|
||||
#: messages.go:122
|
||||
#, c-format
|
||||
msgid "Copying files from %s"
|
||||
msgstr "Copying files from %s"
|
||||
|
||||
#: messages.go:123
|
||||
msgid "Labels deleted"
|
||||
msgstr "Labels deleted"
|
||||
|
||||
#: messages.go:124
|
||||
msgid "Label saved"
|
||||
msgstr "Label saved"
|
||||
|
||||
#: messages.go:125
|
||||
#, c-format
|
||||
msgid "%d files uploaded in %d s"
|
||||
msgstr "%d files uploaded in %d s"
|
||||
|
||||
#: messages.go:126
|
||||
msgid "Selection archived"
|
||||
msgstr "Selection archived"
|
||||
|
||||
#: messages.go:127
|
||||
msgid "Selection restored"
|
||||
msgstr "Selection restored"
|
||||
|
||||
#: messages.go:128
|
||||
msgid "Selection marked as private"
|
||||
msgstr "Selection marked as private"
|
||||
|
||||
#: messages.go:129
|
||||
msgid "Albums deleted"
|
||||
msgstr "Albums deleted"
|
||||
|
||||
#: messages.go:130
|
||||
#, c-format
|
||||
msgid "Zip created in %d s"
|
||||
msgstr "Zip created in %d s"
|
269
assets/locales/messages.pot
Normal file
269
assets/locales/messages.pot
Normal file
|
@ -0,0 +1,269 @@
|
|||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-14 23:13+0000\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: messages.go:69
|
||||
msgid "Unexpected error, please try again"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:70
|
||||
msgid "Invalid request"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:71
|
||||
msgid "Changes could not be saved"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:72
|
||||
msgid "Could not be deleted"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:73
|
||||
#, c-format
|
||||
msgid "%s already exists"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:74 messages.go:77
|
||||
msgid "Not found on server, deleted?"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:75
|
||||
msgid "File not found"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:76
|
||||
msgid "Selection not found"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:78
|
||||
msgid "Account not found"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:79
|
||||
msgid "User not found"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:80
|
||||
msgid "Label not found"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:81
|
||||
msgid "Album not found"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:82
|
||||
msgid "Not available in public mode"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:83
|
||||
msgid "not available in read-only mode"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:84
|
||||
msgid "Please log in and try again"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:85
|
||||
msgid "Upload might be offensive"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:86
|
||||
msgid "No items selected"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:87
|
||||
msgid "Failed creating file, please check permissions"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:88
|
||||
msgid "Failed creating folder, please check permissions"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:89
|
||||
msgid "Could not connect, please try again"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:90
|
||||
msgid "Invalid password, please try again"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:91
|
||||
msgid "Feature disabled"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:92
|
||||
msgid "No labels selected"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:93
|
||||
msgid "No albums selected"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:94
|
||||
msgid "No files available for download"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:95
|
||||
msgid "Failed to create zip file"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:98
|
||||
msgid "Changes successfully saved"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:99
|
||||
msgid "Album created"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:100
|
||||
msgid "Album saved"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:101
|
||||
#, c-format
|
||||
msgid "Album %s deleted"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:102
|
||||
msgid "Album contents cloned"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:103
|
||||
msgid "File removed from stack"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:104
|
||||
#, c-format
|
||||
msgid "Selection added to %s"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:105
|
||||
#, c-format
|
||||
msgid "One entry added to %s"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:106
|
||||
#, c-format
|
||||
msgid "%d entries added to %s"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:107
|
||||
#, c-format
|
||||
msgid "One entry removed from %s"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:108
|
||||
#, c-format
|
||||
msgid "%d entries removed from %s"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:109
|
||||
msgid "Account created"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:110
|
||||
msgid "Account saved"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:111
|
||||
msgid "Account deleted"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:112
|
||||
msgid "Settings saved"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:113
|
||||
msgid "Password changed"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:114
|
||||
#, c-format
|
||||
msgid "Import completed in %d s"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:115
|
||||
msgid "Import canceled"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:116
|
||||
#, c-format
|
||||
msgid "Indexing completed in %d s"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:117
|
||||
msgid "Indexing originals..."
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:118
|
||||
#, c-format
|
||||
msgid "Indexing files in %s"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:119
|
||||
msgid "Indexing canceled"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:120
|
||||
#, c-format
|
||||
msgid "Removed %d files and %d photos"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:121
|
||||
#, c-format
|
||||
msgid "Moving files from %s"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:122
|
||||
#, c-format
|
||||
msgid "Copying files from %s"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:123
|
||||
msgid "Labels deleted"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:124
|
||||
msgid "Label saved"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:125
|
||||
#, c-format
|
||||
msgid "%d files uploaded in %d s"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:126
|
||||
msgid "Selection archived"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:127
|
||||
msgid "Selection restored"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:128
|
||||
msgid "Selection marked as private"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:129
|
||||
msgid "Albums deleted"
|
||||
msgstr ""
|
||||
|
||||
#: messages.go:130
|
||||
#, c-format
|
||||
msgid "Zip created in %d s"
|
||||
msgstr ""
|
BIN
assets/locales/pl/default.mo
Normal file
BIN
assets/locales/pl/default.mo
Normal file
Binary file not shown.
270
assets/locales/pl/default.po
Normal file
270
assets/locales/pl/default.po
Normal file
|
@ -0,0 +1,270 @@
|
|||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-07-14 19:44+0000\n"
|
||||
"PO-Revision-Date: 2020-07-15 00:22+0200\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.3.1\n"
|
||||
"Last-Translator: \n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
|
||||
"Language: pl\n"
|
||||
|
||||
#: messages.go:69
|
||||
msgid "Unexpected error, please try again"
|
||||
msgstr "Nieoczekiwany błąd, spróbuj ponownie"
|
||||
|
||||
#: messages.go:70
|
||||
msgid "Invalid request"
|
||||
msgstr "Nieprawidłowe żądanie"
|
||||
|
||||
#: messages.go:71
|
||||
msgid "Changes could not be saved"
|
||||
msgstr "Nie można zapisać zmian"
|
||||
|
||||
#: messages.go:72
|
||||
msgid "Could not be deleted"
|
||||
msgstr "Nie można usunąć"
|
||||
|
||||
#: messages.go:73
|
||||
#, c-format
|
||||
msgid "%s already exists"
|
||||
msgstr "%s już istnieje"
|
||||
|
||||
#: messages.go:74 messages.go:77
|
||||
msgid "Not found on server, deleted?"
|
||||
msgstr "Nie znaleziono na serwerze, usunięte?"
|
||||
|
||||
#: messages.go:75
|
||||
msgid "File not found"
|
||||
msgstr "Nie znaleziono pliku"
|
||||
|
||||
#: messages.go:76
|
||||
msgid "Selection not found"
|
||||
msgstr "Nie znaleziono wyboru"
|
||||
|
||||
#: messages.go:78
|
||||
msgid "Account not found"
|
||||
msgstr "Konto nie znalezione"
|
||||
|
||||
#: messages.go:79
|
||||
msgid "User not found"
|
||||
msgstr "Użytkownik nie znaleziony"
|
||||
|
||||
#: messages.go:80
|
||||
msgid "Label not found"
|
||||
msgstr "Nie znaleziono etykiety"
|
||||
|
||||
#: messages.go:81
|
||||
msgid "Album not found"
|
||||
msgstr "Album nie został znaleziony"
|
||||
|
||||
#: messages.go:82
|
||||
msgid "Not available in public mode"
|
||||
msgstr "Niedostępne w trybie publicznym"
|
||||
|
||||
#: messages.go:83
|
||||
msgid "not available in read-only mode"
|
||||
msgstr "niedostępne w trybie tylko do odczytu"
|
||||
|
||||
#: messages.go:84
|
||||
msgid "Please log in and try again"
|
||||
msgstr "Zaloguj się i spróbuj ponownie"
|
||||
|
||||
#: messages.go:85
|
||||
msgid "Upload might be offensive"
|
||||
msgstr "Przesyłanie może być obraźliwe"
|
||||
|
||||
#: messages.go:86
|
||||
msgid "No items selected"
|
||||
msgstr "Nie wybrano żadnych elementów"
|
||||
|
||||
#: messages.go:87
|
||||
msgid "Failed creating file, please check permissions"
|
||||
msgstr "Nie udało się utworzyć pliku, sprawdź uprawnienia"
|
||||
|
||||
#: messages.go:88
|
||||
msgid "Failed creating folder, please check permissions"
|
||||
msgstr "Nie udało się utworzyć folderu, sprawdź uprawnienia"
|
||||
|
||||
#: messages.go:89
|
||||
msgid "Could not connect, please try again"
|
||||
msgstr "Nie można się połączyć, spróbuj ponownie"
|
||||
|
||||
#: messages.go:90
|
||||
msgid "Invalid password, please try again"
|
||||
msgstr "Hasło nieprawidłowe, spróbuj ponownie"
|
||||
|
||||
#: messages.go:91
|
||||
msgid "Feature disabled"
|
||||
msgstr "Funkcja wyłączona"
|
||||
|
||||
#: messages.go:92
|
||||
msgid "No labels selected"
|
||||
msgstr "Nie wybrano żadnych etykiet"
|
||||
|
||||
#: messages.go:93
|
||||
msgid "No albums selected"
|
||||
msgstr "Nie wybrano albumów"
|
||||
|
||||
#: messages.go:94
|
||||
msgid "No files available for download"
|
||||
msgstr "Brak plików do pobrania"
|
||||
|
||||
#: messages.go:95
|
||||
msgid "Failed to create zip file"
|
||||
msgstr "Nie udało się utworzyć pliku zip"
|
||||
|
||||
#: messages.go:98
|
||||
msgid "Changes successfully saved"
|
||||
msgstr "Zmiany zostały pomyślnie zapisane"
|
||||
|
||||
#: messages.go:99
|
||||
msgid "Album created"
|
||||
msgstr "Album został utworzony"
|
||||
|
||||
#: messages.go:100
|
||||
msgid "Album saved"
|
||||
msgstr "Album został zapisany"
|
||||
|
||||
#: messages.go:101
|
||||
#, c-format
|
||||
msgid "Album %s deleted"
|
||||
msgstr "Album %s usunięto"
|
||||
|
||||
#: messages.go:102
|
||||
msgid "Album contents cloned"
|
||||
msgstr "Sklonowano zawartość albumu"
|
||||
|
||||
#: messages.go:103
|
||||
msgid "File removed from stack"
|
||||
msgstr "Plik został rozgrupowany"
|
||||
|
||||
#: messages.go:104
|
||||
#, c-format
|
||||
msgid "Selection added to %s"
|
||||
msgstr "Wybór dodany do %s"
|
||||
|
||||
#: messages.go:105
|
||||
#, c-format
|
||||
msgid "One entry added to %s"
|
||||
msgstr "Dodano jeden wpis do %s"
|
||||
|
||||
#: messages.go:106
|
||||
#, c-format
|
||||
msgid "%d entries added to %s"
|
||||
msgstr "%d wpisy dodane do %s"
|
||||
|
||||
#: messages.go:107
|
||||
#, c-format
|
||||
msgid "One entry removed from %s"
|
||||
msgstr "Usunięto jeden wpis z %s"
|
||||
|
||||
#: messages.go:108
|
||||
#, c-format
|
||||
msgid "%d entries removed from %s"
|
||||
msgstr "%d wpisy usunięte z %s"
|
||||
|
||||
#: messages.go:109
|
||||
msgid "Account created"
|
||||
msgstr "Konto utworzone"
|
||||
|
||||
#: messages.go:110
|
||||
msgid "Account saved"
|
||||
msgstr "Konto zapisane"
|
||||
|
||||
#: messages.go:111
|
||||
msgid "Account deleted"
|
||||
msgstr "Konto usunięte"
|
||||
|
||||
#: messages.go:112
|
||||
msgid "Settings saved"
|
||||
msgstr "Ustawienia zapisane"
|
||||
|
||||
#: messages.go:113
|
||||
msgid "Password changed"
|
||||
msgstr "Hasło zostało zmienione"
|
||||
|
||||
#: messages.go:114
|
||||
#, c-format
|
||||
msgid "Import completed in %d s"
|
||||
msgstr "Import zakończony w %d s"
|
||||
|
||||
#: messages.go:115
|
||||
msgid "Import canceled"
|
||||
msgstr "Import został anulowany"
|
||||
|
||||
#: messages.go:116
|
||||
#, c-format
|
||||
msgid "Indexing completed in %d s"
|
||||
msgstr "Indeksowanie zakończone w %d s"
|
||||
|
||||
#: messages.go:117
|
||||
msgid "Indexing originals..."
|
||||
msgstr "Indeksowanie oryginałów…"
|
||||
|
||||
#: messages.go:118
|
||||
#, c-format
|
||||
msgid "Indexing files in %s"
|
||||
msgstr "Indeksowanie plików w %s"
|
||||
|
||||
#: messages.go:119
|
||||
msgid "Indexing canceled"
|
||||
msgstr "Indeksowanie anulowane"
|
||||
|
||||
#: messages.go:120
|
||||
#, c-format
|
||||
msgid "Removed %d files and %d photos"
|
||||
msgstr "Usunięto %d plików i %d zdjęć"
|
||||
|
||||
#: messages.go:121
|
||||
#, c-format
|
||||
msgid "Moving files from %s"
|
||||
msgstr "Przenoszenie plików z %s"
|
||||
|
||||
#: messages.go:122
|
||||
#, c-format
|
||||
msgid "Copying files from %s"
|
||||
msgstr "Kopiowanie plików z %s"
|
||||
|
||||
#: messages.go:123
|
||||
msgid "Labels deleted"
|
||||
msgstr "Usunięto etykiety"
|
||||
|
||||
#: messages.go:124
|
||||
msgid "Label saved"
|
||||
msgstr "Etykieta zapisana"
|
||||
|
||||
#: messages.go:125
|
||||
#, c-format
|
||||
msgid "%d files uploaded in %d s"
|
||||
msgstr "%d files uploaded in %d s"
|
||||
|
||||
#: messages.go:126
|
||||
msgid "Selection archived"
|
||||
msgstr "Wybór zarchiwizowany"
|
||||
|
||||
#: messages.go:127
|
||||
msgid "Selection restored"
|
||||
msgstr "Wybór został przywrócony"
|
||||
|
||||
#: messages.go:128
|
||||
msgid "Selection marked as private"
|
||||
msgstr "Wybór oznaczony jako prywatny"
|
||||
|
||||
#: messages.go:129
|
||||
msgid "Albums deleted"
|
||||
msgstr "Albumy zostały usunięte"
|
||||
|
||||
#: messages.go:130
|
||||
#, c-format
|
||||
msgid "Zip created in %d s"
|
||||
msgstr "Zip utworzony w %d s"
|
|
@ -42,6 +42,7 @@ RUN apt-get update && apt-get upgrade && \
|
|||
nano \
|
||||
wget \
|
||||
git \
|
||||
gettext \
|
||||
mysql-client \
|
||||
tzdata \
|
||||
gconf-service \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
FROM photoprism/development:20200625 as build
|
||||
FROM photoprism/development:20200714 as build
|
||||
|
||||
# Set up project directory
|
||||
WORKDIR "/go/src/github.com/photoprism/photoprism"
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
"acceptance": "testcafe \"chromium:headless --disable-dev-shm-usage\" --skip-js-errors --selector-timeout 5000 -S -s tests/screenshots tests/acceptance",
|
||||
"acceptance-firefox": "testcafe firefox:headless --skip-js-errors --selector-timeout 5000 -S -s tests/screenshots tests/acceptance",
|
||||
"acceptance-local": "testcafe chrome --selector-timeout 5000 -S -s tests/screenshots tests/acceptance",
|
||||
"gettext-extract": "gettext-extract --output src/resources/translations.pot $(find src -type f \\( -iname \\*.vue -o -iname \\*.js \\))",
|
||||
"gettext-compile": "gettext-compile --output src/resources/translations.json src/resources/*.po"
|
||||
"gettext-extract": "gettext-extract --output src/locales/translations.pot $(find src -type f \\( -iname \\*.vue -o -iname \\*.js \\))",
|
||||
"gettext-compile": "gettext-compile --output src/locales/translations.json src/locales/*.po"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/cli": "^7.10.4",
|
||||
|
|
|
@ -29,8 +29,8 @@ https://docs.photoprism.org/developer-guide/
|
|||
*/
|
||||
|
||||
import Event from "pubsub-js";
|
||||
import themes from "../resources/themes.json";
|
||||
import translations from "../resources/translations.json";
|
||||
import themes from "options/themes.json";
|
||||
import translations from "locales/translations.json";
|
||||
import Api from "./api";
|
||||
|
||||
export default class Config {
|
||||
|
|
|
@ -152,7 +152,7 @@
|
|||
</template>
|
||||
<script>
|
||||
import Event from "pubsub-js";
|
||||
import * as options from "resources/options";
|
||||
import * as options from "options/options";
|
||||
|
||||
export default {
|
||||
name: 'p-photo-toolbar',
|
||||
|
|
|
@ -268,7 +268,7 @@
|
|||
</v-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import * as options from "resources/options";
|
||||
import * as options from "options/options";
|
||||
|
||||
export default {
|
||||
name: 'p-account-edit-dialog',
|
||||
|
|
|
@ -413,9 +413,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import countries from "resources/countries.json";
|
||||
import countries from "options/countries.json";
|
||||
import Thumb from "model/thumb";
|
||||
import * as options from "resources/options";
|
||||
import * as options from "options/options";
|
||||
|
||||
export default {
|
||||
name: 'p-tab-photo-details',
|
||||
|
|
|
@ -220,7 +220,7 @@
|
|||
<script>
|
||||
import Thumb from "model/thumb";
|
||||
import {DateTime, Info} from "luxon";
|
||||
import * as options from "resources/options";
|
||||
import * as options from "options/options";
|
||||
|
||||
export default {
|
||||
name: 'p-tab-photo-advanced',
|
||||
|
|
|
@ -34,7 +34,7 @@ import Api from "common/api";
|
|||
import {DateTime} from "luxon";
|
||||
import Util from "common/util";
|
||||
import {config} from "../session";
|
||||
import countries from "resources/countries.json";
|
||||
import countries from "options/countries.json";
|
||||
import {$gettext} from "common/vm";
|
||||
|
||||
export const SrcManual = "manual";
|
||||
|
|
|
@ -348,7 +348,7 @@
|
|||
|
||||
<script>
|
||||
import Settings from "model/settings";
|
||||
import * as options from "resources/options";
|
||||
import * as options from "options/options";
|
||||
|
||||
export default {
|
||||
name: 'p-settings-general',
|
||||
|
|
1
go.mod
1
go.mod
|
@ -24,6 +24,7 @@ require (
|
|||
github.com/karrick/godirwalk v1.15.6
|
||||
github.com/kr/pretty v0.1.0 // indirect
|
||||
github.com/leandro-lugaresi/hub v1.1.0
|
||||
github.com/leonelquinteros/gotext v1.4.0
|
||||
github.com/lib/pq v1.3.0 // indirect
|
||||
github.com/lucasb-eyer/go-colorful v1.0.3
|
||||
github.com/mattn/go-sqlite3 v2.0.1+incompatible // indirect
|
||||
|
|
2
go.sum
2
go.sum
|
@ -130,6 +130,8 @@ github.com/leandro-lugaresi/hub v1.1.0 h1:yHYA0WsMYaJd+I6J24nYlCP2CFD4RTnhaHCRmK
|
|||
github.com/leandro-lugaresi/hub v1.1.0/go.mod h1:IVKrfZTYfU1SbWCGQMHNGYdW4j1Pl7Cg8gr6sSeT/84=
|
||||
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
|
||||
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
|
||||
github.com/leonelquinteros/gotext v1.4.0 h1:2NHPCto5IoMXbrT0bldPrxj0qM5asOCwtb1aUQZ1tys=
|
||||
github.com/leonelquinteros/gotext v1.4.0/go.mod h1:yZGXREmoGTtBvZHNcc+Yfug49G/2spuF/i/Qlsvz1Us=
|
||||
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU=
|
||||
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
|
|
|
@ -278,6 +278,11 @@ func (c *Config) AssetsPath() string {
|
|||
return fs.Abs(c.params.AssetsPath)
|
||||
}
|
||||
|
||||
// LocalesPath returns the translation locales path.
|
||||
func (c *Config) LocalesPath() string {
|
||||
return filepath.Join(c.AssetsPath(), "locales")
|
||||
}
|
||||
|
||||
// ExamplesPath returns the example files path.
|
||||
func (c *Config) ExamplesPath() string {
|
||||
return filepath.Join(c.AssetsPath(), "examples")
|
||||
|
|
|
@ -108,7 +108,7 @@ func NewSettings() *Settings {
|
|||
|
||||
// Propagate updates settings in other packages as needed.
|
||||
func (s Settings) Propagate() {
|
||||
i18n.SetLang(s.Language)
|
||||
i18n.SetLocale(s.Language)
|
||||
}
|
||||
|
||||
// Load uses a yaml config file to initiate the configuration entity.
|
||||
|
@ -160,6 +160,8 @@ func (c *Config) initSettings() {
|
|||
log.Info(err)
|
||||
}
|
||||
|
||||
i18n.SetDir(c.LocalesPath())
|
||||
|
||||
c.settings.Propagate()
|
||||
}
|
||||
|
||||
|
|
|
@ -35,31 +35,21 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/leonelquinteros/gotext"
|
||||
)
|
||||
|
||||
//go:generate xgettext --no-wrap --language=c --from-code=UTF-8 --output=../../assets/locales/messages.pot messages.go
|
||||
|
||||
type Message int
|
||||
type MessageMap map[Message]string
|
||||
|
||||
func Msg(id Message, params ...interface{}) string {
|
||||
return LangMsg(id, Lang, params...)
|
||||
func gettext(s string) string {
|
||||
return gotext.Get(s)
|
||||
}
|
||||
|
||||
func LangMsg(id Message, lang Language, params ...interface{}) string {
|
||||
msgs, ok := Languages[lang]
|
||||
|
||||
if !ok && lang != Default {
|
||||
msgs, ok = Languages[Default]
|
||||
}
|
||||
|
||||
msg, ok := msgs[id]
|
||||
|
||||
if !ok {
|
||||
msg, ok = Languages[Default][id]
|
||||
}
|
||||
|
||||
if !ok {
|
||||
return fmt.Sprintf("i18n: unknown message id %d", id)
|
||||
}
|
||||
func Msg(id Message, params ...interface{}) string {
|
||||
msg := gotext.Get(Messages[id])
|
||||
|
||||
if strings.Contains(msg, "%") {
|
||||
msg = fmt.Sprintf(msg, params...)
|
||||
|
@ -68,30 +58,6 @@ func LangMsg(id Message, lang Language, params ...interface{}) string {
|
|||
return msg
|
||||
}
|
||||
|
||||
func DefaultMsg(id Message, params ...interface{}) string {
|
||||
return LangMsg(id, Default, params...)
|
||||
}
|
||||
|
||||
func Error(id Message, params ...interface{}) error {
|
||||
return errors.New(Msg(id, params...))
|
||||
}
|
||||
|
||||
func LangError(id Message, lang Language, params ...interface{}) error {
|
||||
return errors.New(LangMsg(id, lang, params...))
|
||||
}
|
||||
|
||||
func DefaultError(id Message, params ...interface{}) error {
|
||||
return LangError(id, Default, params...)
|
||||
}
|
||||
|
||||
/*
|
||||
func JsonBadRequest(id Message) gin.H {
|
||||
return JsonError(http.StatusBadRequest, msg)
|
||||
}
|
||||
|
||||
func JsonForbidden(id Message) gin.H {
|
||||
return JsonError(http.StatusForbidden, msg)
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
|
|
@ -1,11 +1,21 @@
|
|||
package i18n
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/leonelquinteros/gotext"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
gotext.Configure(localeDir, string(locale), "default")
|
||||
|
||||
code := m.Run()
|
||||
|
||||
os.Exit(code)
|
||||
}
|
||||
|
||||
func TestMsg(t *testing.T) {
|
||||
t.Run("already exists", func(t *testing.T) {
|
||||
msg := Msg(ErrAlreadyExists, "A cat")
|
||||
|
@ -18,50 +28,21 @@ func TestMsg(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("already exists german", func(t *testing.T) {
|
||||
SetLang("de")
|
||||
msgGerman := Msg(ErrAlreadyExists, "Eine Katze")
|
||||
assert.Equal(t, "Eine Katze existiert bereits", msgGerman)
|
||||
SetLang("")
|
||||
SetLocale("de")
|
||||
msgDE := Msg(ErrAlreadyExists, "Eine Katze")
|
||||
assert.Equal(t, "Eine Katze existiert bereits", msgDE)
|
||||
SetLocale("")
|
||||
msgDefault := Msg(ErrAlreadyExists, "A cat")
|
||||
assert.Equal(t, "A cat already exists", msgDefault)
|
||||
})
|
||||
}
|
||||
|
||||
func TestLangMsg(t *testing.T) {
|
||||
t.Run("already exists", func(t *testing.T) {
|
||||
msgDefault := LangMsg(ErrAlreadyExists, Default, "A cat")
|
||||
t.Run("already exists polish", func(t *testing.T) {
|
||||
SetLocale("pl")
|
||||
msgPL := Msg(ErrAlreadyExists, "Kot")
|
||||
assert.Equal(t, "Kot już istnieje", msgPL)
|
||||
SetLocale("")
|
||||
msgDefault := Msg(ErrAlreadyExists, "A cat")
|
||||
assert.Equal(t, "A cat already exists", msgDefault)
|
||||
msgEnglish := LangMsg(ErrAlreadyExists, English, "A cat")
|
||||
assert.Equal(t, msgEnglish, msgDefault)
|
||||
})
|
||||
|
||||
t.Run("unexpected error", func(t *testing.T) {
|
||||
msgDefault := LangMsg(ErrUnexpected, Default, "A cat")
|
||||
assert.Equal(t, "Unexpected error, please try again", msgDefault)
|
||||
msgEnglish := LangMsg(ErrUnexpected, English, "A cat")
|
||||
assert.Equal(t, msgEnglish, msgDefault)
|
||||
})
|
||||
|
||||
t.Run("already exists german", func(t *testing.T) {
|
||||
msg := LangMsg(ErrAlreadyExists, German, "Eine Katze")
|
||||
assert.Equal(t, "Eine Katze existiert bereits", msg)
|
||||
})
|
||||
|
||||
t.Run("unexpected error german", func(t *testing.T) {
|
||||
msg := LangMsg(ErrUnexpected, German, "Eine Katze")
|
||||
assert.Equal(t, "Unerwarteter Fehler, bitte erneut versuchen", msg)
|
||||
})
|
||||
}
|
||||
|
||||
func TestDefaultMsg(t *testing.T) {
|
||||
t.Run("already exists", func(t *testing.T) {
|
||||
msg := DefaultMsg(ErrAlreadyExists, "A cat")
|
||||
assert.Equal(t, "A cat already exists", msg)
|
||||
})
|
||||
|
||||
t.Run("unexpected error", func(t *testing.T) {
|
||||
msg := DefaultMsg(ErrUnexpected, "A cat")
|
||||
assert.Equal(t, "Unexpected error, please try again", msg)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -77,45 +58,11 @@ func TestError(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("already exists german", func(t *testing.T) {
|
||||
SetLang("de")
|
||||
SetLocale("de")
|
||||
errGerman := Error(ErrAlreadyExists, "Eine Katze")
|
||||
assert.EqualError(t, errGerman, "Eine Katze existiert bereits")
|
||||
SetLang("")
|
||||
SetLocale("")
|
||||
errDefault := Error(ErrAlreadyExists, "A cat")
|
||||
assert.EqualError(t, errDefault, "A cat already exists")
|
||||
})
|
||||
}
|
||||
|
||||
func TestLangError(t *testing.T) {
|
||||
t.Run("already exists", func(t *testing.T) {
|
||||
err := LangError(ErrAlreadyExists, English, "A cat")
|
||||
assert.EqualError(t, err, "A cat already exists")
|
||||
})
|
||||
|
||||
t.Run("unexpected error", func(t *testing.T) {
|
||||
err := LangError(ErrUnexpected, English, "A cat")
|
||||
assert.EqualError(t, err, "Unexpected error, please try again")
|
||||
})
|
||||
|
||||
t.Run("already exists german", func(t *testing.T) {
|
||||
err := LangError(ErrAlreadyExists, German, "Eine Katze")
|
||||
assert.EqualError(t, err, "Eine Katze existiert bereits")
|
||||
})
|
||||
|
||||
t.Run("unexpected error german", func(t *testing.T) {
|
||||
err := LangError(ErrUnexpected, German, "Eine Katze")
|
||||
assert.EqualError(t, err, "Unerwarteter Fehler, bitte erneut versuchen")
|
||||
})
|
||||
}
|
||||
|
||||
func TestDefaultError(t *testing.T) {
|
||||
t.Run("already exists", func(t *testing.T) {
|
||||
err := DefaultError(ErrAlreadyExists, "A cat")
|
||||
assert.EqualError(t, err, "A cat already exists")
|
||||
})
|
||||
|
||||
t.Run("unexpected error", func(t *testing.T) {
|
||||
err := DefaultError(ErrUnexpected, "A cat")
|
||||
assert.EqualError(t, err, "Unexpected error, please try again")
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
package i18n
|
||||
|
||||
var MsgGerman = MessageMap{
|
||||
// Error messages:
|
||||
ErrUnexpected: "Unerwarteter Fehler, bitte erneut versuchen",
|
||||
ErrSaveFailed: "Fehler beim Speichern der Daten",
|
||||
ErrBadRequest: "Ungültige Anfrage",
|
||||
ErrAlreadyExists: "%s existiert bereits",
|
||||
ErrEntityNotFound: "Nicht auf Server gefunden, gelöscht?",
|
||||
ErrAccountNotFound: "Unbekannter Account",
|
||||
ErrAlbumNotFound: "Album nicht gefunden - gelöscht?",
|
||||
ErrReadOnly: "Funktion im 'read-only' Modus nicht verfügbar",
|
||||
ErrUnauthorized: "Anmeldung erforderlich",
|
||||
ErrOffensiveUpload: "Inhalt könnte anstößig sein und wurde abgelehnt",
|
||||
ErrNoItemsSelected: "Auswahl ist leer, bitte erneut versuchen",
|
||||
ErrCreateFile: "Datei konnte nicht angelegt werden",
|
||||
ErrCreateFolder: "Verzeichnis konnte nicht angelegt werden",
|
||||
ErrConnectionFailed: "Verbindung fehlgeschlagen",
|
||||
ErrDeleteFailed: "Konnte nicht gelöscht werden",
|
||||
ErrNotFound: "Nicht auf Server gefunden, gelöscht?",
|
||||
ErrFileNotFound: "Datei konnte nicht gefunden werden",
|
||||
ErrSelectionNotFound: "Nicht auf Server gefunden, gelöscht?",
|
||||
ErrUserNotFound: "Nutzer nicht gefunden",
|
||||
ErrLabelNotFound: "Kategorie nicht gefunden",
|
||||
ErrPublic: "Im öffentlichen Modus nicht verfügbar",
|
||||
ErrInvalidPassword: "Ungültiges Passwort",
|
||||
ErrFeatureDisabled: "Funktion deaktiviert",
|
||||
ErrNoLabelsSelected: "Keine Kategorien ausgewählt",
|
||||
ErrNoAlbumsSelected: "Keine Alben ausgewählt",
|
||||
ErrNoFilesForDownload: "Nicht zum Download verfügbar",
|
||||
ErrZipFailed: "Zip-Datei konnte nicht erstellt werden",
|
||||
|
||||
// Info and confirmation messages:
|
||||
MsgChangesSaved: "Änderungen erfolgreich gespeichert",
|
||||
MsgAlbumCreated: "Album erstellt",
|
||||
MsgAlbumSaved: "Album gespeichert",
|
||||
MsgAlbumDeleted: "Album %s gelöscht",
|
||||
MsgAlbumCloned: "Album-Einträge kopiert",
|
||||
MsgFileUnstacked: "Datei aus Stapel entfernt",
|
||||
MsgSelectionAddedTo: "Auswahl zu %s hinzugefügt",
|
||||
MsgEntryAddedTo: "Ein Eintrag zu %s hinzugefügt",
|
||||
MsgEntriesAddedTo: "%d Einträge zu %s hinzugefügt",
|
||||
MsgEntryRemovedFrom: "Ein Eintrag aus %s entfernt",
|
||||
MsgEntriesRemovedFrom: "%d Einträge aus %s entfernt",
|
||||
MsgAccountCreated: "Server-Konfiguration angelegt",
|
||||
MsgAccountSaved: "Server-Konfiguration gespeichert",
|
||||
MsgAccountDeleted: "Server-Konfiguration gelöscht",
|
||||
MsgSettingsSaved: "Einstellungen gespeichert",
|
||||
MsgPasswordChanged: "Passwort geändert",
|
||||
MsgImportCompletedIn: "Import in %d s abgeschlossen",
|
||||
MsgImportCanceled: "Import abgebrochen",
|
||||
MsgIndexingCompletedIn: "Indizierung in %d s abgeschlossen",
|
||||
MsgIndexingOriginals: "Indiziere Dateien...",
|
||||
MsgIndexingFiles: "Indiziere Dateien in %s",
|
||||
MsgIndexingCanceled: "Indizierung abgebrochen",
|
||||
MsgRemovedFilesAndPhotos: "%d Dateien und %d Fotos wurden entfernt",
|
||||
MsgMovingFilesFrom: "Verschiebe Dateien von %s",
|
||||
MsgCopyingFilesFrom: "Kopiere Dateien von %s",
|
||||
MsgLabelsDeleted: "Kategorien gelöscht",
|
||||
MsgLabelSaved: "Kategorie gespeichert",
|
||||
MsgFilesUploadedIn: "%d Dateien hochgeladen in %d s",
|
||||
MsgSelectionArchived: "Auswahl archiviert",
|
||||
MsgSelectionRestored: "Auswahl wiederhergestellt",
|
||||
MsgSelectionProtected: "Auswahl als privat markiert",
|
||||
MsgAlbumsDeleted: "Alben gelöscht",
|
||||
MsgZipCreatedIn: "Zip-Datei erstellt in %d s",
|
||||
}
|
|
@ -1,131 +0,0 @@
|
|||
package i18n
|
||||
|
||||
const (
|
||||
ErrUnexpected Message = iota + 1
|
||||
ErrBadRequest
|
||||
ErrSaveFailed
|
||||
ErrDeleteFailed
|
||||
ErrAlreadyExists
|
||||
ErrNotFound
|
||||
ErrFileNotFound
|
||||
ErrSelectionNotFound
|
||||
ErrEntityNotFound
|
||||
ErrAccountNotFound
|
||||
ErrUserNotFound
|
||||
ErrLabelNotFound
|
||||
ErrAlbumNotFound
|
||||
ErrPublic
|
||||
ErrReadOnly
|
||||
ErrUnauthorized
|
||||
ErrOffensiveUpload
|
||||
ErrNoItemsSelected
|
||||
ErrCreateFile
|
||||
ErrCreateFolder
|
||||
ErrConnectionFailed
|
||||
ErrInvalidPassword
|
||||
ErrFeatureDisabled
|
||||
ErrNoLabelsSelected
|
||||
ErrNoAlbumsSelected
|
||||
ErrNoFilesForDownload
|
||||
ErrZipFailed
|
||||
|
||||
MsgChangesSaved
|
||||
MsgAlbumCreated
|
||||
MsgAlbumSaved
|
||||
MsgAlbumDeleted
|
||||
MsgAlbumCloned
|
||||
MsgFileUnstacked
|
||||
MsgSelectionAddedTo
|
||||
MsgEntryAddedTo
|
||||
MsgEntriesAddedTo
|
||||
MsgEntryRemovedFrom
|
||||
MsgEntriesRemovedFrom
|
||||
MsgAccountCreated
|
||||
MsgAccountSaved
|
||||
MsgAccountDeleted
|
||||
MsgSettingsSaved
|
||||
MsgPasswordChanged
|
||||
MsgImportCompletedIn
|
||||
MsgImportCanceled
|
||||
MsgIndexingCompletedIn
|
||||
MsgIndexingOriginals
|
||||
MsgIndexingFiles
|
||||
MsgIndexingCanceled
|
||||
MsgRemovedFilesAndPhotos
|
||||
MsgMovingFilesFrom
|
||||
MsgCopyingFilesFrom
|
||||
MsgLabelsDeleted
|
||||
MsgLabelSaved
|
||||
MsgFilesUploadedIn
|
||||
MsgSelectionArchived
|
||||
MsgSelectionRestored
|
||||
MsgSelectionProtected
|
||||
MsgAlbumsDeleted
|
||||
MsgZipCreatedIn
|
||||
)
|
||||
|
||||
var MsgEnglish = MessageMap{
|
||||
// Error messages:
|
||||
ErrUnexpected: "Unexpected error, please try again",
|
||||
ErrBadRequest: "Invalid request",
|
||||
ErrSaveFailed: "Changes could not be saved",
|
||||
ErrDeleteFailed: "Could not be deleted",
|
||||
ErrAlreadyExists: "%s already exists",
|
||||
ErrNotFound: "Not found on server, deleted?",
|
||||
ErrFileNotFound: "File not found",
|
||||
ErrSelectionNotFound: "Selection not found",
|
||||
ErrEntityNotFound: "Not found on server, deleted?",
|
||||
ErrAccountNotFound: "Account not found",
|
||||
ErrUserNotFound: "User not found",
|
||||
ErrLabelNotFound: "Label not found",
|
||||
ErrAlbumNotFound: "Album not found",
|
||||
ErrPublic: "Not available in public mode",
|
||||
ErrReadOnly: "not available in read-only mode",
|
||||
ErrUnauthorized: "Please log in and try again",
|
||||
ErrOffensiveUpload: "Upload might be offensive",
|
||||
ErrNoItemsSelected: "No items selected",
|
||||
ErrCreateFile: "Failed creating file, please check permissions",
|
||||
ErrCreateFolder: "Failed creating folder, please check permissions",
|
||||
ErrConnectionFailed: "Could not connect, please try again",
|
||||
ErrInvalidPassword: "Invalid password, please try again",
|
||||
ErrFeatureDisabled: "Feature disabled",
|
||||
ErrNoLabelsSelected: "No labels selected",
|
||||
ErrNoAlbumsSelected: "No albums selected",
|
||||
ErrNoFilesForDownload: "No files available for download",
|
||||
ErrZipFailed: "Failed to create zip file",
|
||||
|
||||
// Info and confirmation messages:
|
||||
MsgChangesSaved: "Changes successfully saved",
|
||||
MsgAlbumCreated: "Album created",
|
||||
MsgAlbumSaved: "Album saved",
|
||||
MsgAlbumDeleted: "Album %s deleted",
|
||||
MsgAlbumCloned: "Album contents cloned",
|
||||
MsgFileUnstacked: "File removed from stack",
|
||||
MsgSelectionAddedTo: "Selection added to %s",
|
||||
MsgEntryAddedTo: "One entry added to %s",
|
||||
MsgEntriesAddedTo: "%d entries added to %s",
|
||||
MsgEntryRemovedFrom: "One entry removed from %s",
|
||||
MsgEntriesRemovedFrom: "%d entries removed from %s",
|
||||
MsgAccountCreated: "Account created",
|
||||
MsgAccountSaved: "Account saved",
|
||||
MsgAccountDeleted: "Account deleted",
|
||||
MsgSettingsSaved: "Settings saved",
|
||||
MsgPasswordChanged: "Password changed",
|
||||
MsgImportCompletedIn: "Import completed in %d s",
|
||||
MsgImportCanceled: "Import canceled",
|
||||
MsgIndexingCompletedIn: "Indexing completed in %d s",
|
||||
MsgIndexingOriginals: "Indexing originals...",
|
||||
MsgIndexingFiles: "Indexing files in %s",
|
||||
MsgIndexingCanceled: "Indexing canceled",
|
||||
MsgRemovedFilesAndPhotos: "Removed %d files and %d photos",
|
||||
MsgMovingFilesFrom: "Moving files from %s",
|
||||
MsgCopyingFilesFrom: "Copying files from %s",
|
||||
MsgLabelsDeleted: "Labels deleted",
|
||||
MsgLabelSaved: "Label saved",
|
||||
MsgFilesUploadedIn: "%d files uploaded in %d s",
|
||||
MsgSelectionArchived: "Selection archived",
|
||||
MsgSelectionRestored: "Selection restored",
|
||||
MsgSelectionProtected: "Selection marked as private",
|
||||
MsgAlbumsDeleted: "Albums deleted",
|
||||
MsgZipCreatedIn: "Zip created in %d s",
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
package i18n
|
||||
|
||||
var MsgSpanish = MessageMap{
|
||||
// Error messages:
|
||||
ErrUnexpected: "Unexpected error, please try again",
|
||||
ErrBadRequest: "Invalid request",
|
||||
ErrSaveFailed: "Changes could not be saved",
|
||||
ErrDeleteFailed: "Could not be deleted",
|
||||
ErrAlreadyExists: "%s already exists",
|
||||
ErrNotFound: "Not found on server, deleted?",
|
||||
ErrFileNotFound: "File not found",
|
||||
ErrSelectionNotFound: "Selection not found",
|
||||
ErrEntityNotFound: "Not found on server, deleted?",
|
||||
ErrAccountNotFound: "Account not found",
|
||||
ErrUserNotFound: "User not found",
|
||||
ErrLabelNotFound: "Label not found",
|
||||
ErrAlbumNotFound: "Album not found",
|
||||
ErrPublic: "Not available in public mode",
|
||||
ErrReadOnly: "not available in read-only mode",
|
||||
ErrUnauthorized: "Please log in and try again",
|
||||
ErrOffensiveUpload: "Upload might be offensive",
|
||||
ErrNoItemsSelected: "No items selected",
|
||||
ErrCreateFile: "Failed creating file, please check permissions",
|
||||
ErrCreateFolder: "Failed creating folder, please check permissions",
|
||||
ErrConnectionFailed: "Could not connect, please try again",
|
||||
ErrInvalidPassword: "Invalid password, please try again",
|
||||
ErrFeatureDisabled: "Feature disabled",
|
||||
ErrNoLabelsSelected: "No labels selected",
|
||||
ErrNoAlbumsSelected: "No albums selected",
|
||||
ErrNoFilesForDownload: "No files available for download",
|
||||
ErrZipFailed: "Failed to create zip file",
|
||||
|
||||
// Info and confirmation messages:
|
||||
MsgChangesSaved: "Changes successfully saved",
|
||||
MsgAlbumCreated: "Album created",
|
||||
MsgAlbumSaved: "Album saved",
|
||||
MsgAlbumDeleted: "Album %s deleted",
|
||||
MsgAlbumCloned: "Album contents cloned",
|
||||
MsgFileUnstacked: "File removed from stack",
|
||||
MsgSelectionAddedTo: "Selection added to %s",
|
||||
MsgEntryAddedTo: "One entry added to %s",
|
||||
MsgEntriesAddedTo: "%d entries added to %s",
|
||||
MsgEntryRemovedFrom: "One entry removed from %s",
|
||||
MsgEntriesRemovedFrom: "%d entries removed from %s",
|
||||
MsgAccountCreated: "Account created",
|
||||
MsgAccountSaved: "Account saved",
|
||||
MsgAccountDeleted: "Account deleted",
|
||||
MsgSettingsSaved: "Settings saved",
|
||||
MsgPasswordChanged: "Password changed",
|
||||
MsgImportCompletedIn: "Import completed in %d s",
|
||||
MsgImportCanceled: "Import canceled",
|
||||
MsgIndexingCompletedIn: "Indexing completed in %d s",
|
||||
MsgIndexingOriginals: "Indexing originals...",
|
||||
MsgIndexingFiles: "Indexing files in %s",
|
||||
MsgIndexingCanceled: "Indexing canceled",
|
||||
MsgRemovedFilesAndPhotos: "Removed %d files and %d photos",
|
||||
MsgMovingFilesFrom: "Moving files from %s",
|
||||
MsgCopyingFilesFrom: "Copying files from %s",
|
||||
MsgLabelsDeleted: "Labels deleted",
|
||||
MsgLabelSaved: "Label saved",
|
||||
MsgFilesUploadedIn: "%d files uploaded in %d s",
|
||||
MsgSelectionArchived: "Selection archived",
|
||||
MsgSelectionRestored: "Selection restored",
|
||||
MsgSelectionProtected: "Selection marked as private",
|
||||
MsgAlbumsDeleted: "Albums deleted",
|
||||
MsgZipCreatedIn: "Zip created in %d s",
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
package i18n
|
||||
|
||||
var MsgFrench = MessageMap{
|
||||
// Error messages:
|
||||
ErrUnexpected: "Unexpected error, please try again",
|
||||
ErrBadRequest: "Invalid request",
|
||||
ErrSaveFailed: "Changes could not be saved",
|
||||
ErrDeleteFailed: "Could not be deleted",
|
||||
ErrAlreadyExists: "%s already exists",
|
||||
ErrNotFound: "Not found on server, deleted?",
|
||||
ErrFileNotFound: "File not found",
|
||||
ErrSelectionNotFound: "Selection not found",
|
||||
ErrEntityNotFound: "Not found on server, deleted?",
|
||||
ErrAccountNotFound: "Account not found",
|
||||
ErrUserNotFound: "User not found",
|
||||
ErrLabelNotFound: "Label not found",
|
||||
ErrAlbumNotFound: "Album not found",
|
||||
ErrPublic: "Not available in public mode",
|
||||
ErrReadOnly: "not available in read-only mode",
|
||||
ErrUnauthorized: "Please log in and try again",
|
||||
ErrOffensiveUpload: "Upload might be offensive",
|
||||
ErrNoItemsSelected: "No items selected",
|
||||
ErrCreateFile: "Failed creating file, please check permissions",
|
||||
ErrCreateFolder: "Failed creating folder, please check permissions",
|
||||
ErrConnectionFailed: "Could not connect, please try again",
|
||||
ErrInvalidPassword: "Invalid password, please try again",
|
||||
ErrFeatureDisabled: "Feature disabled",
|
||||
ErrNoLabelsSelected: "No labels selected",
|
||||
ErrNoAlbumsSelected: "No albums selected",
|
||||
ErrNoFilesForDownload: "No files available for download",
|
||||
ErrZipFailed: "Failed to create zip file",
|
||||
|
||||
// Info and confirmation messages:
|
||||
MsgChangesSaved: "Changes successfully saved",
|
||||
MsgAlbumCreated: "Album created",
|
||||
MsgAlbumSaved: "Album saved",
|
||||
MsgAlbumDeleted: "Album %s deleted",
|
||||
MsgAlbumCloned: "Album contents cloned",
|
||||
MsgFileUnstacked: "File removed from stack",
|
||||
MsgSelectionAddedTo: "Selection added to %s",
|
||||
MsgEntryAddedTo: "One entry added to %s",
|
||||
MsgEntriesAddedTo: "%d entries added to %s",
|
||||
MsgEntryRemovedFrom: "One entry removed from %s",
|
||||
MsgEntriesRemovedFrom: "%d entries removed from %s",
|
||||
MsgAccountCreated: "Account created",
|
||||
MsgAccountSaved: "Account saved",
|
||||
MsgAccountDeleted: "Account deleted",
|
||||
MsgSettingsSaved: "Settings saved",
|
||||
MsgPasswordChanged: "Password changed",
|
||||
MsgImportCompletedIn: "Import completed in %d s",
|
||||
MsgImportCanceled: "Import canceled",
|
||||
MsgIndexingCompletedIn: "Indexing completed in %d s",
|
||||
MsgIndexingOriginals: "Indexing originals...",
|
||||
MsgIndexingFiles: "Indexing files in %s",
|
||||
MsgIndexingCanceled: "Indexing canceled",
|
||||
MsgRemovedFilesAndPhotos: "Removed %d files and %d photos",
|
||||
MsgMovingFilesFrom: "Moving files from %s",
|
||||
MsgCopyingFilesFrom: "Copying files from %s",
|
||||
MsgLabelsDeleted: "Labels deleted",
|
||||
MsgLabelSaved: "Label saved",
|
||||
MsgFilesUploadedIn: "%d files uploaded in %d s",
|
||||
MsgSelectionArchived: "Selection archived",
|
||||
MsgSelectionRestored: "Selection restored",
|
||||
MsgSelectionProtected: "Selection marked as private",
|
||||
MsgAlbumsDeleted: "Albums deleted",
|
||||
MsgZipCreatedIn: "Zip created in %d s",
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
package i18n
|
||||
|
||||
var MsgDutch = MessageMap{
|
||||
// Error messages:
|
||||
ErrUnexpected: "Unexpected error, please try again",
|
||||
ErrBadRequest: "Invalid request",
|
||||
ErrSaveFailed: "Changes could not be saved",
|
||||
ErrDeleteFailed: "Could not be deleted",
|
||||
ErrAlreadyExists: "%s already exists",
|
||||
ErrNotFound: "Not found on server, deleted?",
|
||||
ErrFileNotFound: "File not found",
|
||||
ErrSelectionNotFound: "Selection not found",
|
||||
ErrEntityNotFound: "Not found on server, deleted?",
|
||||
ErrAccountNotFound: "Account not found",
|
||||
ErrUserNotFound: "User not found",
|
||||
ErrLabelNotFound: "Label not found",
|
||||
ErrAlbumNotFound: "Album not found",
|
||||
ErrPublic: "Not available in public mode",
|
||||
ErrReadOnly: "not available in read-only mode",
|
||||
ErrUnauthorized: "Please log in and try again",
|
||||
ErrOffensiveUpload: "Upload might be offensive",
|
||||
ErrNoItemsSelected: "No items selected",
|
||||
ErrCreateFile: "Failed creating file, please check permissions",
|
||||
ErrCreateFolder: "Failed creating folder, please check permissions",
|
||||
ErrConnectionFailed: "Could not connect, please try again",
|
||||
ErrInvalidPassword: "Invalid password, please try again",
|
||||
ErrFeatureDisabled: "Feature disabled",
|
||||
ErrNoLabelsSelected: "No labels selected",
|
||||
ErrNoAlbumsSelected: "No albums selected",
|
||||
ErrNoFilesForDownload: "No files available for download",
|
||||
ErrZipFailed: "Failed to create zip file",
|
||||
|
||||
// Info and confirmation messages:
|
||||
MsgChangesSaved: "Changes successfully saved",
|
||||
MsgAlbumCreated: "Album created",
|
||||
MsgAlbumSaved: "Album saved",
|
||||
MsgAlbumDeleted: "Album %s deleted",
|
||||
MsgAlbumCloned: "Album contents cloned",
|
||||
MsgFileUnstacked: "File removed from stack",
|
||||
MsgSelectionAddedTo: "Selection added to %s",
|
||||
MsgEntryAddedTo: "One entry added to %s",
|
||||
MsgEntriesAddedTo: "%d entries added to %s",
|
||||
MsgEntryRemovedFrom: "One entry removed from %s",
|
||||
MsgEntriesRemovedFrom: "%d entries removed from %s",
|
||||
MsgAccountCreated: "Account created",
|
||||
MsgAccountSaved: "Account saved",
|
||||
MsgAccountDeleted: "Account deleted",
|
||||
MsgSettingsSaved: "Settings saved",
|
||||
MsgPasswordChanged: "Password changed",
|
||||
MsgImportCompletedIn: "Import completed in %d s",
|
||||
MsgImportCanceled: "Import canceled",
|
||||
MsgIndexingCompletedIn: "Indexing completed in %d s",
|
||||
MsgIndexingOriginals: "Indexing originals...",
|
||||
MsgIndexingFiles: "Indexing files in %s",
|
||||
MsgIndexingCanceled: "Indexing canceled",
|
||||
MsgRemovedFilesAndPhotos: "Removed %d files and %d photos",
|
||||
MsgMovingFilesFrom: "Moving files from %s",
|
||||
MsgCopyingFilesFrom: "Copying files from %s",
|
||||
MsgLabelsDeleted: "Labels deleted",
|
||||
MsgLabelSaved: "Label saved",
|
||||
MsgFilesUploadedIn: "%d files uploaded in %d s",
|
||||
MsgSelectionArchived: "Selection archived",
|
||||
MsgSelectionRestored: "Selection restored",
|
||||
MsgSelectionProtected: "Selection marked as private",
|
||||
MsgAlbumsDeleted: "Albums deleted",
|
||||
MsgZipCreatedIn: "Zip created in %d s",
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
package i18n
|
||||
|
||||
var MsgPolish = MessageMap{
|
||||
// Error messages:
|
||||
ErrUnexpected: "Nieoczekiwany błąd, spróbuj ponownie",
|
||||
ErrBadRequest: "Nieprawidłowe żądanie",
|
||||
ErrSaveFailed: "Nie można zapisać zmian",
|
||||
ErrDeleteFailed: "Nie można usunąć",
|
||||
ErrAlreadyExists: "%s już istnieje",
|
||||
ErrNotFound: "Nie znaleziono na serwerze, usunięte?",
|
||||
ErrFileNotFound: "Nie znaleziono pliku",
|
||||
ErrSelectionNotFound: "Nie znaleziono wyboru",
|
||||
ErrEntityNotFound: "Nie znaleziono na serwerze, usunięte?",
|
||||
ErrAccountNotFound: "Konto nie znalezione",
|
||||
ErrUserNotFound: "Użytkownik nie znaleziony",
|
||||
ErrLabelNotFound: "Nie znaleziono etykiety",
|
||||
ErrAlbumNotFound: "Album nie został znaleziony",
|
||||
ErrPublic: "Niedostępne w trybie publicznym",
|
||||
ErrReadOnly: "niedostępne w trybie tylko do odczytu",
|
||||
ErrUnauthorized: "Zaloguj się i spróbuj ponownie",
|
||||
ErrOffensiveUpload: "Przesyłanie może być obraźliwe",
|
||||
ErrNoItemsSelected: "Nie wybrano żadnych elementów",
|
||||
ErrCreateFile: "Nie udało się utworzyć pliku, sprawdź uprawnienia",
|
||||
ErrCreateFolder: "Nie udało się utworzyć folderu, sprawdź uprawnienia",
|
||||
ErrConnectionFailed: "Nie można się połączyć, spróbuj ponownie",
|
||||
ErrInvalidPassword: "Hasło nieprawidłowe, spróbuj ponownie",
|
||||
ErrFeatureDisabled: "Funkcja wyłączona",
|
||||
ErrNoLabelsSelected: "Nie wybrano żadnych etykiet",
|
||||
ErrNoAlbumsSelected: "Nie wybrano albumów",
|
||||
ErrNoFilesForDownload: "Brak plików do pobrania",
|
||||
ErrZipFailed: "Nie udało się utworzyć pliku zip",
|
||||
|
||||
// Info and confirmation messages:
|
||||
MsgChangesSaved: "Zmiany zostały pomyślnie zapisane",
|
||||
MsgAlbumCreated: "Album został utworzony",
|
||||
MsgAlbumSaved: "Album został zapisany",
|
||||
MsgAlbumDeleted: "Album %s usunięto",
|
||||
MsgAlbumCloned: "Sklonowano zawartość albumu",
|
||||
MsgFileUnstacked: "Plik został rozgrupowany",
|
||||
MsgSelectionAddedTo: "Wybór dodany do %s",
|
||||
MsgEntryAddedTo: "Dodano jeden wpis do %s",
|
||||
MsgEntriesAddedTo: "%d wpisy dodane do %s",
|
||||
MsgEntryRemovedFrom: "Usunięto jeden wpis z %s",
|
||||
MsgEntriesRemovedFrom: "%d wpisy usunięte z %s",
|
||||
MsgAccountCreated: "Konto utworzone",
|
||||
MsgAccountSaved: "Konto zapisane",
|
||||
MsgAccountDeleted: "Konto usunięte",
|
||||
MsgSettingsSaved: "Ustawienia zapisane",
|
||||
MsgPasswordChanged: "Hasło zostało zmienione",
|
||||
MsgImportCompletedIn: "Import zakończony w %d s",
|
||||
MsgImportCanceled: "Import został anulowany",
|
||||
MsgIndexingCompletedIn: "Indeksowanie zakończone w %d s",
|
||||
MsgIndexingOriginals: "Indeksowanie oryginałów...",
|
||||
MsgIndexingFiles: "Indeksowanie plików w %s",
|
||||
MsgIndexingCanceled: "Indeksowanie anulowane",
|
||||
MsgRemovedFilesAndPhotos: "Usunięto %d plików i %d zdjęć",
|
||||
MsgMovingFilesFrom: "Przenoszenie plików z %s",
|
||||
MsgCopyingFilesFrom: "Kopiowanie plików z %s",
|
||||
MsgLabelsDeleted: "Usunięto etykiety",
|
||||
MsgLabelSaved: "Etykieta zapisana",
|
||||
MsgFilesUploadedIn: "%d files uploaded in %d s",
|
||||
MsgSelectionArchived: "Wybór zarchiwizowany",
|
||||
MsgSelectionRestored: "Wybór został przywrócony",
|
||||
MsgSelectionProtected: "Wybór oznaczony jako prywatny",
|
||||
MsgAlbumsDeleted: "Albumy zostały usunięte",
|
||||
MsgZipCreatedIn: "Zip utworzony w %d s",
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
package i18n
|
||||
|
||||
var MsgPortuguese = MessageMap{
|
||||
// Error messages:
|
||||
ErrUnexpected: "Unexpected error, please try again",
|
||||
ErrBadRequest: "Invalid request",
|
||||
ErrSaveFailed: "Changes could not be saved",
|
||||
ErrDeleteFailed: "Could not be deleted",
|
||||
ErrAlreadyExists: "%s already exists",
|
||||
ErrNotFound: "Not found on server, deleted?",
|
||||
ErrFileNotFound: "File not found",
|
||||
ErrSelectionNotFound: "Selection not found",
|
||||
ErrEntityNotFound: "Not found on server, deleted?",
|
||||
ErrAccountNotFound: "Account not found",
|
||||
ErrUserNotFound: "User not found",
|
||||
ErrLabelNotFound: "Label not found",
|
||||
ErrAlbumNotFound: "Album not found",
|
||||
ErrPublic: "Not available in public mode",
|
||||
ErrReadOnly: "not available in read-only mode",
|
||||
ErrUnauthorized: "Please log in and try again",
|
||||
ErrOffensiveUpload: "Upload might be offensive",
|
||||
ErrNoItemsSelected: "No items selected",
|
||||
ErrCreateFile: "Failed creating file, please check permissions",
|
||||
ErrCreateFolder: "Failed creating folder, please check permissions",
|
||||
ErrConnectionFailed: "Could not connect, please try again",
|
||||
ErrInvalidPassword: "Invalid password, please try again",
|
||||
ErrFeatureDisabled: "Feature disabled",
|
||||
ErrNoLabelsSelected: "No labels selected",
|
||||
ErrNoAlbumsSelected: "No albums selected",
|
||||
ErrNoFilesForDownload: "No files available for download",
|
||||
ErrZipFailed: "Failed to create zip file",
|
||||
|
||||
// Info and confirmation messages:
|
||||
MsgChangesSaved: "Changes successfully saved",
|
||||
MsgAlbumCreated: "Album created",
|
||||
MsgAlbumSaved: "Album saved",
|
||||
MsgAlbumDeleted: "Album %s deleted",
|
||||
MsgAlbumCloned: "Album contents cloned",
|
||||
MsgFileUnstacked: "File removed from stack",
|
||||
MsgSelectionAddedTo: "Selection added to %s",
|
||||
MsgEntryAddedTo: "One entry added to %s",
|
||||
MsgEntriesAddedTo: "%d entries added to %s",
|
||||
MsgEntryRemovedFrom: "One entry removed from %s",
|
||||
MsgEntriesRemovedFrom: "%d entries removed from %s",
|
||||
MsgAccountCreated: "Account created",
|
||||
MsgAccountSaved: "Account saved",
|
||||
MsgAccountDeleted: "Account deleted",
|
||||
MsgSettingsSaved: "Settings saved",
|
||||
MsgPasswordChanged: "Password changed",
|
||||
MsgImportCompletedIn: "Import completed in %d s",
|
||||
MsgImportCanceled: "Import canceled",
|
||||
MsgIndexingCompletedIn: "Indexing completed in %d s",
|
||||
MsgIndexingOriginals: "Indexing originals...",
|
||||
MsgIndexingFiles: "Indexing files in %s",
|
||||
MsgIndexingCanceled: "Indexing canceled",
|
||||
MsgRemovedFilesAndPhotos: "Removed %d files and %d photos",
|
||||
MsgMovingFilesFrom: "Moving files from %s",
|
||||
MsgCopyingFilesFrom: "Copying files from %s",
|
||||
MsgLabelsDeleted: "Labels deleted",
|
||||
MsgLabelSaved: "Label saved",
|
||||
MsgFilesUploadedIn: "%d files uploaded in %d s",
|
||||
MsgSelectionArchived: "Selection archived",
|
||||
MsgSelectionRestored: "Selection restored",
|
||||
MsgSelectionProtected: "Selection marked as private",
|
||||
MsgAlbumsDeleted: "Albums deleted",
|
||||
MsgZipCreatedIn: "Zip created in %d s",
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
package i18n
|
||||
|
||||
var MsgRussian = MessageMap{
|
||||
// Error messages:
|
||||
ErrUnexpected: "Unexpected error, please try again",
|
||||
ErrBadRequest: "Invalid request",
|
||||
ErrSaveFailed: "Changes could not be saved",
|
||||
ErrDeleteFailed: "Could not be deleted",
|
||||
ErrAlreadyExists: "%s already exists",
|
||||
ErrNotFound: "Not found on server, deleted?",
|
||||
ErrFileNotFound: "File not found",
|
||||
ErrSelectionNotFound: "Selection not found",
|
||||
ErrEntityNotFound: "Not found on server, deleted?",
|
||||
ErrAccountNotFound: "Account not found",
|
||||
ErrUserNotFound: "User not found",
|
||||
ErrLabelNotFound: "Label not found",
|
||||
ErrAlbumNotFound: "Album not found",
|
||||
ErrPublic: "Not available in public mode",
|
||||
ErrReadOnly: "not available in read-only mode",
|
||||
ErrUnauthorized: "Please log in and try again",
|
||||
ErrOffensiveUpload: "Upload might be offensive",
|
||||
ErrNoItemsSelected: "No items selected",
|
||||
ErrCreateFile: "Failed creating file, please check permissions",
|
||||
ErrCreateFolder: "Failed creating folder, please check permissions",
|
||||
ErrConnectionFailed: "Could not connect, please try again",
|
||||
ErrInvalidPassword: "Invalid password, please try again",
|
||||
ErrFeatureDisabled: "Feature disabled",
|
||||
ErrNoLabelsSelected: "No labels selected",
|
||||
ErrNoAlbumsSelected: "No albums selected",
|
||||
ErrNoFilesForDownload: "No files available for download",
|
||||
ErrZipFailed: "Failed to create zip file",
|
||||
|
||||
// Info and confirmation messages:
|
||||
MsgChangesSaved: "Changes successfully saved",
|
||||
MsgAlbumCreated: "Album created",
|
||||
MsgAlbumSaved: "Album saved",
|
||||
MsgAlbumDeleted: "Album %s deleted",
|
||||
MsgAlbumCloned: "Album contents cloned",
|
||||
MsgFileUnstacked: "File removed from stack",
|
||||
MsgSelectionAddedTo: "Selection added to %s",
|
||||
MsgEntryAddedTo: "One entry added to %s",
|
||||
MsgEntriesAddedTo: "%d entries added to %s",
|
||||
MsgEntryRemovedFrom: "One entry removed from %s",
|
||||
MsgEntriesRemovedFrom: "%d entries removed from %s",
|
||||
MsgAccountCreated: "Account created",
|
||||
MsgAccountSaved: "Account saved",
|
||||
MsgAccountDeleted: "Account deleted",
|
||||
MsgSettingsSaved: "Settings saved",
|
||||
MsgPasswordChanged: "Password changed",
|
||||
MsgImportCompletedIn: "Import completed in %d s",
|
||||
MsgImportCanceled: "Import canceled",
|
||||
MsgIndexingCompletedIn: "Indexing completed in %d s",
|
||||
MsgIndexingOriginals: "Indexing originals...",
|
||||
MsgIndexingFiles: "Indexing files in %s",
|
||||
MsgIndexingCanceled: "Indexing canceled",
|
||||
MsgRemovedFilesAndPhotos: "Removed %d files and %d photos",
|
||||
MsgMovingFilesFrom: "Moving files from %s",
|
||||
MsgCopyingFilesFrom: "Copying files from %s",
|
||||
MsgLabelsDeleted: "Labels deleted",
|
||||
MsgLabelSaved: "Label saved",
|
||||
MsgFilesUploadedIn: "%d files uploaded in %d s",
|
||||
MsgSelectionArchived: "Selection archived",
|
||||
MsgSelectionRestored: "Selection restored",
|
||||
MsgSelectionProtected: "Selection marked as private",
|
||||
MsgAlbumsDeleted: "Albums deleted",
|
||||
MsgZipCreatedIn: "Zip created in %d s",
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
package i18n
|
||||
|
||||
var MsgChinese = MessageMap{
|
||||
// Error messages:
|
||||
ErrUnexpected: "Unexpected error, please try again",
|
||||
ErrBadRequest: "Invalid request",
|
||||
ErrSaveFailed: "Changes could not be saved",
|
||||
ErrDeleteFailed: "Could not be deleted",
|
||||
ErrAlreadyExists: "%s already exists",
|
||||
ErrNotFound: "Not found on server, deleted?",
|
||||
ErrFileNotFound: "File not found",
|
||||
ErrSelectionNotFound: "Selection not found",
|
||||
ErrEntityNotFound: "Not found on server, deleted?",
|
||||
ErrAccountNotFound: "Account not found",
|
||||
ErrUserNotFound: "User not found",
|
||||
ErrLabelNotFound: "Label not found",
|
||||
ErrAlbumNotFound: "Album not found",
|
||||
ErrPublic: "Not available in public mode",
|
||||
ErrReadOnly: "not available in read-only mode",
|
||||
ErrUnauthorized: "Please log in and try again",
|
||||
ErrOffensiveUpload: "Upload might be offensive",
|
||||
ErrNoItemsSelected: "No items selected",
|
||||
ErrCreateFile: "Failed creating file, please check permissions",
|
||||
ErrCreateFolder: "Failed creating folder, please check permissions",
|
||||
ErrConnectionFailed: "Could not connect, please try again",
|
||||
ErrInvalidPassword: "Invalid password, please try again",
|
||||
ErrFeatureDisabled: "Feature disabled",
|
||||
ErrNoLabelsSelected: "No labels selected",
|
||||
ErrNoAlbumsSelected: "No albums selected",
|
||||
ErrNoFilesForDownload: "No files available for download",
|
||||
ErrZipFailed: "Failed to create zip file",
|
||||
|
||||
// Info and confirmation messages:
|
||||
MsgChangesSaved: "Changes successfully saved",
|
||||
MsgAlbumCreated: "Album created",
|
||||
MsgAlbumSaved: "Album saved",
|
||||
MsgAlbumDeleted: "Album %s deleted",
|
||||
MsgAlbumCloned: "Album contents cloned",
|
||||
MsgFileUnstacked: "File removed from stack",
|
||||
MsgSelectionAddedTo: "Selection added to %s",
|
||||
MsgEntryAddedTo: "One entry added to %s",
|
||||
MsgEntriesAddedTo: "%d entries added to %s",
|
||||
MsgEntryRemovedFrom: "One entry removed from %s",
|
||||
MsgEntriesRemovedFrom: "%d entries removed from %s",
|
||||
MsgAccountCreated: "Account created",
|
||||
MsgAccountSaved: "Account saved",
|
||||
MsgAccountDeleted: "Account deleted",
|
||||
MsgSettingsSaved: "Settings saved",
|
||||
MsgPasswordChanged: "Password changed",
|
||||
MsgImportCompletedIn: "Import completed in %d s",
|
||||
MsgImportCanceled: "Import canceled",
|
||||
MsgIndexingCompletedIn: "Indexing completed in %d s",
|
||||
MsgIndexingOriginals: "Indexing originals...",
|
||||
MsgIndexingFiles: "Indexing files in %s",
|
||||
MsgIndexingCanceled: "Indexing canceled",
|
||||
MsgRemovedFilesAndPhotos: "Removed %d files and %d photos",
|
||||
MsgMovingFilesFrom: "Moving files from %s",
|
||||
MsgCopyingFilesFrom: "Copying files from %s",
|
||||
MsgLabelsDeleted: "Labels deleted",
|
||||
MsgLabelSaved: "Label saved",
|
||||
MsgFilesUploadedIn: "%d files uploaded in %d s",
|
||||
MsgSelectionArchived: "Selection archived",
|
||||
MsgSelectionRestored: "Selection restored",
|
||||
MsgSelectionProtected: "Selection marked as private",
|
||||
MsgAlbumsDeleted: "Albums deleted",
|
||||
MsgZipCreatedIn: "Zip created in %d s",
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
package i18n
|
||||
|
||||
import "strings"
|
||||
|
||||
type Language string
|
||||
|
||||
type LanguageMap map[Language]MessageMap
|
||||
|
||||
const (
|
||||
German Language = "de"
|
||||
English Language = "en"
|
||||
Spanish Language = "es"
|
||||
French Language = "fr"
|
||||
Dutch Language = "nl"
|
||||
Polish Language = "pl"
|
||||
Portuguese Language = "pt"
|
||||
Russian Language = "ru"
|
||||
Chinese Language = "zh"
|
||||
Default = English
|
||||
)
|
||||
|
||||
var Languages = LanguageMap{
|
||||
German: MsgGerman,
|
||||
English: MsgEnglish,
|
||||
Spanish: MsgSpanish,
|
||||
French: MsgFrench,
|
||||
Dutch: MsgDutch,
|
||||
Polish: MsgPolish,
|
||||
Portuguese: MsgPortuguese,
|
||||
Russian: MsgRussian,
|
||||
Chinese: MsgChinese,
|
||||
}
|
||||
|
||||
var Lang = Default
|
||||
|
||||
func SetLang(s string) {
|
||||
if len(s) != 2 {
|
||||
Lang = Default
|
||||
} else {
|
||||
s = strings.ToLower(s)
|
||||
Lang = Language(s)
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package i18n
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestSetLang(t *testing.T) {
|
||||
assert.Equal(t, English, Lang)
|
||||
SetLang("D")
|
||||
assert.Equal(t, English, Lang)
|
||||
SetLang("De")
|
||||
assert.Equal(t, German, Lang)
|
||||
SetLang("")
|
||||
assert.Equal(t, English, Lang)
|
||||
assert.Equal(t, Default, Lang)
|
||||
}
|
40
internal/i18n/locales.go
Normal file
40
internal/i18n/locales.go
Normal file
|
@ -0,0 +1,40 @@
|
|||
package i18n
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/leonelquinteros/gotext"
|
||||
)
|
||||
|
||||
type Locale string
|
||||
|
||||
const (
|
||||
German Locale = "de"
|
||||
English Locale = "en"
|
||||
Spanish Locale = "es"
|
||||
French Locale = "fr"
|
||||
Dutch Locale = "nl"
|
||||
Polish Locale = "pl"
|
||||
Portuguese Locale = "pt"
|
||||
Russian Locale = "ru"
|
||||
Chinese Locale = "zh"
|
||||
Default = English
|
||||
)
|
||||
|
||||
var localeDir = "../../assets/locales"
|
||||
var locale = Default
|
||||
|
||||
func SetDir(dir string) {
|
||||
localeDir = dir
|
||||
}
|
||||
|
||||
func SetLocale(loc string) {
|
||||
if len(loc) != 2 {
|
||||
locale = Default
|
||||
} else {
|
||||
loc = strings.ToLower(loc)
|
||||
locale = Locale(loc)
|
||||
}
|
||||
|
||||
gotext.Configure(localeDir, string(locale), "default")
|
||||
}
|
20
internal/i18n/locales_test.go
Normal file
20
internal/i18n/locales_test.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package i18n
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestSetLocale(t *testing.T) {
|
||||
assert.Equal(t, English, locale)
|
||||
SetLocale("D")
|
||||
assert.Equal(t, English, locale)
|
||||
SetLocale("De")
|
||||
assert.Equal(t, German, locale)
|
||||
SetLocale("PL")
|
||||
assert.Equal(t, Polish, locale)
|
||||
SetLocale("")
|
||||
assert.Equal(t, English, locale)
|
||||
assert.Equal(t, Default, locale)
|
||||
}
|
131
internal/i18n/messages.go
Normal file
131
internal/i18n/messages.go
Normal file
|
@ -0,0 +1,131 @@
|
|||
package i18n
|
||||
|
||||
const (
|
||||
ErrUnexpected Message = iota + 1
|
||||
ErrBadRequest
|
||||
ErrSaveFailed
|
||||
ErrDeleteFailed
|
||||
ErrAlreadyExists
|
||||
ErrNotFound
|
||||
ErrFileNotFound
|
||||
ErrSelectionNotFound
|
||||
ErrEntityNotFound
|
||||
ErrAccountNotFound
|
||||
ErrUserNotFound
|
||||
ErrLabelNotFound
|
||||
ErrAlbumNotFound
|
||||
ErrPublic
|
||||
ErrReadOnly
|
||||
ErrUnauthorized
|
||||
ErrOffensiveUpload
|
||||
ErrNoItemsSelected
|
||||
ErrCreateFile
|
||||
ErrCreateFolder
|
||||
ErrConnectionFailed
|
||||
ErrInvalidPassword
|
||||
ErrFeatureDisabled
|
||||
ErrNoLabelsSelected
|
||||
ErrNoAlbumsSelected
|
||||
ErrNoFilesForDownload
|
||||
ErrZipFailed
|
||||
|
||||
MsgChangesSaved
|
||||
MsgAlbumCreated
|
||||
MsgAlbumSaved
|
||||
MsgAlbumDeleted
|
||||
MsgAlbumCloned
|
||||
MsgFileUnstacked
|
||||
MsgSelectionAddedTo
|
||||
MsgEntryAddedTo
|
||||
MsgEntriesAddedTo
|
||||
MsgEntryRemovedFrom
|
||||
MsgEntriesRemovedFrom
|
||||
MsgAccountCreated
|
||||
MsgAccountSaved
|
||||
MsgAccountDeleted
|
||||
MsgSettingsSaved
|
||||
MsgPasswordChanged
|
||||
MsgImportCompletedIn
|
||||
MsgImportCanceled
|
||||
MsgIndexingCompletedIn
|
||||
MsgIndexingOriginals
|
||||
MsgIndexingFiles
|
||||
MsgIndexingCanceled
|
||||
MsgRemovedFilesAndPhotos
|
||||
MsgMovingFilesFrom
|
||||
MsgCopyingFilesFrom
|
||||
MsgLabelsDeleted
|
||||
MsgLabelSaved
|
||||
MsgFilesUploadedIn
|
||||
MsgSelectionArchived
|
||||
MsgSelectionRestored
|
||||
MsgSelectionProtected
|
||||
MsgAlbumsDeleted
|
||||
MsgZipCreatedIn
|
||||
)
|
||||
|
||||
var Messages = MessageMap{
|
||||
// Error messages:
|
||||
ErrUnexpected: gettext("Unexpected error, please try again"),
|
||||
ErrBadRequest: gettext("Invalid request"),
|
||||
ErrSaveFailed: gettext("Changes could not be saved"),
|
||||
ErrDeleteFailed: gettext("Could not be deleted"),
|
||||
ErrAlreadyExists: gettext("%s already exists"),
|
||||
ErrNotFound: gettext("Not found on server, deleted?"),
|
||||
ErrFileNotFound: gettext("File not found"),
|
||||
ErrSelectionNotFound: gettext("Selection not found"),
|
||||
ErrEntityNotFound: gettext("Not found on server, deleted?"),
|
||||
ErrAccountNotFound: gettext("Account not found"),
|
||||
ErrUserNotFound: gettext("User not found"),
|
||||
ErrLabelNotFound: gettext("Label not found"),
|
||||
ErrAlbumNotFound: gettext("Album not found"),
|
||||
ErrPublic: gettext("Not available in public mode"),
|
||||
ErrReadOnly: gettext("not available in read-only mode"),
|
||||
ErrUnauthorized: gettext("Please log in and try again"),
|
||||
ErrOffensiveUpload: gettext("Upload might be offensive"),
|
||||
ErrNoItemsSelected: gettext("No items selected"),
|
||||
ErrCreateFile: gettext("Failed creating file, please check permissions"),
|
||||
ErrCreateFolder: gettext("Failed creating folder, please check permissions"),
|
||||
ErrConnectionFailed: gettext("Could not connect, please try again"),
|
||||
ErrInvalidPassword: gettext("Invalid password, please try again"),
|
||||
ErrFeatureDisabled: gettext("Feature disabled"),
|
||||
ErrNoLabelsSelected: gettext("No labels selected"),
|
||||
ErrNoAlbumsSelected: gettext("No albums selected"),
|
||||
ErrNoFilesForDownload: gettext("No files available for download"),
|
||||
ErrZipFailed: gettext("Failed to create zip file"),
|
||||
|
||||
// Info and confirmation messages:
|
||||
MsgChangesSaved: gettext("Changes successfully saved"),
|
||||
MsgAlbumCreated: gettext("Album created"),
|
||||
MsgAlbumSaved: gettext("Album saved"),
|
||||
MsgAlbumDeleted: gettext("Album %s deleted"),
|
||||
MsgAlbumCloned: gettext("Album contents cloned"),
|
||||
MsgFileUnstacked: gettext("File removed from stack"),
|
||||
MsgSelectionAddedTo: gettext("Selection added to %s"),
|
||||
MsgEntryAddedTo: gettext("One entry added to %s"),
|
||||
MsgEntriesAddedTo: gettext("%d entries added to %s"),
|
||||
MsgEntryRemovedFrom: gettext("One entry removed from %s"),
|
||||
MsgEntriesRemovedFrom: gettext("%d entries removed from %s"),
|
||||
MsgAccountCreated: gettext("Account created"),
|
||||
MsgAccountSaved: gettext("Account saved"),
|
||||
MsgAccountDeleted: gettext("Account deleted"),
|
||||
MsgSettingsSaved: gettext("Settings saved"),
|
||||
MsgPasswordChanged: gettext("Password changed"),
|
||||
MsgImportCompletedIn: gettext("Import completed in %d s"),
|
||||
MsgImportCanceled: gettext("Import canceled"),
|
||||
MsgIndexingCompletedIn: gettext("Indexing completed in %d s"),
|
||||
MsgIndexingOriginals: gettext("Indexing originals..."),
|
||||
MsgIndexingFiles: gettext("Indexing files in %s"),
|
||||
MsgIndexingCanceled: gettext("Indexing canceled"),
|
||||
MsgRemovedFilesAndPhotos: gettext("Removed %d files and %d photos"),
|
||||
MsgMovingFilesFrom: gettext("Moving files from %s"),
|
||||
MsgCopyingFilesFrom: gettext("Copying files from %s"),
|
||||
MsgLabelsDeleted: gettext("Labels deleted"),
|
||||
MsgLabelSaved: gettext("Label saved"),
|
||||
MsgFilesUploadedIn: gettext("%d files uploaded in %d s"),
|
||||
MsgSelectionArchived: gettext("Selection archived"),
|
||||
MsgSelectionRestored: gettext("Selection restored"),
|
||||
MsgSelectionProtected: gettext("Selection marked as private"),
|
||||
MsgAlbumsDeleted: gettext("Albums deleted"),
|
||||
MsgZipCreatedIn: gettext("Zip created in %d s"),
|
||||
}
|
Loading…
Reference in a new issue