From d2b1710b1b156b6ae93e2b71cde4d407a9548f2f Mon Sep 17 00:00:00 2001 From: Alberto Sottile <7440277+albertosottile@users.noreply.github.com> Date: Mon, 19 Feb 2018 15:24:29 +0100 Subject: [PATCH] Merge pull request #176 from Nico769/master Added Italian translation --- buildPy2exe.py | 19 +++++++++++++++++++ syncplay/messages.py | 4 +++- syncplay/messages_de.py | 3 ++- syncplay/messages_en.py | 7 ++++--- syncplay/messages_ru.py | 3 ++- syncplay/ui/GuiConfiguration.py | 20 ++++++++++---------- 6 files changed, 40 insertions(+), 16 deletions(-) diff --git a/buildPy2exe.py b/buildPy2exe.py index 7126f39..13975f8 100755 --- a/buildPy2exe.py +++ b/buildPy2exe.py @@ -57,6 +57,7 @@ NSIS_SCRIPT_TEMPLATE = r""" LoadLanguageFile "$${NSISDIR}\Contrib\Language files\Polish.nlf" LoadLanguageFile "$${NSISDIR}\Contrib\Language files\Russian.nlf" LoadLanguageFile "$${NSISDIR}\Contrib\Language files\German.nlf" + LoadLanguageFile "$${NSISDIR}\Contrib\Language files\Italian.nlf" Unicode true @@ -83,6 +84,11 @@ NSIS_SCRIPT_TEMPLATE = r""" VIAddVersionKey /LANG=$${LANG_RUSSIAN} "FileVersion" "$version.0" VIAddVersionKey /LANG=$${LANG_RUSSIAN} "LegalCopyright" "Syncplay" VIAddVersionKey /LANG=$${LANG_RUSSIAN} "FileDescription" "Syncplay" + + VIAddVersionKey /LANG=$${LANG_ITALIAN} "ProductName" "Syncplay" + VIAddVersionKey /LANG=$${LANG_ITALIAN} "FileVersion" "$version.0" + VIAddVersionKey /LANG=$${LANG_ITALIAN} "LegalCopyright" "Syncplay" + VIAddVersionKey /LANG=$${LANG_ITALIAN} "FileDescription" "Syncplay" LangString ^SyncplayLanguage $${LANG_ENGLISH} "en" LangString ^Associate $${LANG_ENGLISH} "Associate Syncplay with multimedia files." @@ -126,6 +132,17 @@ NSIS_SCRIPT_TEMPLATE = r""" LangString ^QuickLaunchBar $${LANG_GERMAN} "Schnellstartleiste" LangString ^AutomaticUpdates $${LANG_GERMAN} "Automatisch nach Updates suchen"; LangString ^UninstConfig $${LANG_GERMAN} "Konfigurationsdatei löschen." + + LangString ^SyncplayLanguage $${LANG_ITALIAN} "it" + LangString ^Associate $${LANG_ITALIAN} "Associa Syncplay con i file multimediali." + LangString ^VLC $${LANG_ITALIAN} "Installa l'interfaccia di Syncplay per VLC 2+" + LangString ^BrowseVLCBtn $${LANG_ITALIAN} "Cartella di VLC" + LangString ^Shortcut $${LANG_ITALIAN} "Crea i collegamenti nei percorsi seguenti:" + LangString ^StartMenu $${LANG_ITALIAN} "Menu Start" + LangString ^Desktop $${LANG_ITALIAN} "Desktop" + LangString ^QuickLaunchBar $${LANG_ITALIAN} "Barra di avvio rapido" + LangString ^AutomaticUpdates $${LANG_ITALIAN} "Controllo automatico degli aggiornamenti" + LangString ^UninstConfig $${LANG_ITALIAN} "Cancella i file di configurazione." ; Remove text to save space LangString ^ClickInstall $${LANG_GERMAN} " " @@ -233,6 +250,8 @@ NSIS_SCRIPT_TEMPLATE = r""" Push Русский Push $${LANG_GERMAN} Push Deutsch + Push $${LANG_ITALIAN} + Push Italiano Push A ; A means auto count languages LangDLL::LangDialog "Language Selection" "Please select the language of Syncplay and the installer" Pop $$LANGUAGE diff --git a/syncplay/messages.py b/syncplay/messages.py index 4ef13b2..63c72a0 100755 --- a/syncplay/messages.py +++ b/syncplay/messages.py @@ -4,11 +4,13 @@ from syncplay import constants import messages_en import messages_ru import messages_de +import messages_it messages = { "en": messages_en.en, "ru": messages_ru.ru, "de": messages_de.de, + "it": messages_it.it, "CURRENT": None } @@ -68,4 +70,4 @@ def getMessage(type_, locale=None): else: print u"WARNING: Cannot find message '{}'!".format(type_) return "!{}".format(type_) # TODO: Remove - #raise KeyError(type_) \ No newline at end of file + #raise KeyError(type_) diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 768118b..f015834 100644 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -245,6 +245,7 @@ de = { "chat-top-option": u"Top", # TODO: Translate "chat-middle-option": u"Middle", # TODO: Translate "chat-bottom-option": u"Bottom", # TODO: Translate + "chatoutputheader-label" : u"Chat message output", # TODO: Translate "chatoutputfont-label": u"Chat output font", # TODO: Translate "chatoutputenabled-label": u"Enable chat output in media player (mpv only for now)", # TODO: Translate "chatoutputposition-label": u"Output mode", # TODO: Translate @@ -305,7 +306,7 @@ de = { "help-menu-label" : u"&Hilfe", "userguide-menu-label" : u"&Benutzerhandbuch öffnen", "update-menu-label" : u"auf &Aktualisierung prüfen", - + #About dialog - TODO: Translate "about-menu-label": u"&About Syncplay", "about-dialog-title": u"About Syncplay", diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index a29dc0c..4d04b04 100644 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -137,7 +137,7 @@ en = { "feature-chat" : u"chat", # used for not-supported-by-server-error "feature-readiness" : u"readiness", # used for not-supported-by-server-error "feature-managedRooms" : u"managed rooms", # used for not-supported-by-server-error - + "not-supported-by-server-error" : u"The {} feature is not supported by this server..", #feature "shared-playlists-not-supported-by-server-error" : "The shared playlists feature may not be supported by the server. To ensure that it works correctly requires a server running Syncplay {}+, but the server is running Syncplay {}.", #minVersion, serverVersion "shared-playlists-disabled-by-server-error" : "The shared playlist feature has been disabled in the server configuration. To use this feature you will need to connect to a different server.", @@ -239,7 +239,7 @@ en = { "unpause-ifminusersready-option" : u"Unpause if already ready or if all others ready and min users ready", "unpause-always" : u"Always unpause", "syncplay-trusteddomains-title": u"Trusted domains (for streaming services and hosted content)", - + "chat-title" : u"Chat message input", "chatinputenabled-label" : u"Enable chat input via mpv", "chatdirectinput-label" : u"Allow instant chat input (bypass having to press enter key to chat)", @@ -250,6 +250,7 @@ en = { "chat-top-option" : u"Top", "chat-middle-option" : u"Middle", "chat-bottom-option" : u"Bottom", + "chatoutputheader-label" : u"Chat message output", "chatoutputfont-label": u"Chat output font", "chatoutputenabled-label": u"Enable chat output in media player (mpv only for now)", "chatoutputposition-label": u"Output mode", @@ -310,7 +311,7 @@ en = { "help-menu-label" : "&Help", "userguide-menu-label" : "Open user &guide", "update-menu-label" : "Check for &update", - + #About dialog "about-menu-label": u"&About Syncplay", "about-dialog-title": u"About Syncplay", diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index 9bed670..0b47c07 100644 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -254,6 +254,7 @@ ru = { "chat-top-option": u"Top", # TODO: Translate "chat-middle-option": u"Middle", # TODO: Translate "chat-bottom-option": u"Bottom", # TODO: Translate + "chatoutputheader-label" : u"Chat message output", # TODO: Traslate "chatoutputfont-label": u"Chat output font", # TODO: Translate "chatoutputenabled-label": u"Enable chat output in media player (mpv only for now)", # TODO: Translate "chatoutputposition-label": u"Output mode", # TODO: Translate @@ -313,7 +314,7 @@ ru = { "help-menu-label" : u"&Помощь", "userguide-menu-label" : u"&Руководство пользователя", "update-menu-label" : u"Проверить &обновления", - + #About dialog - TODO: Translate "about-menu-label": u"&About Syncplay", "about-dialog-title": u"About Syncplay", diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index b5ef9d7..373715d 100755 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -257,7 +257,7 @@ class ConfigDialog(QtWidgets.QDialog): # executable. I would have used plistlib here, but since the version of this library in # py < 3.4 can't read from binary plist files it's pretty much useless. Therefore, let's # play a game of "Guess my executable!" - + # Step 1: get all the executable files. In a Mac OS X Application bundle, executables are stored # inside /Contents/MacOS. execPath = os.path.join(os.path.normpath(fileName), 'Contents', 'MacOS') @@ -266,7 +266,7 @@ class ConfigDialog(QtWidgets.QDialog): fn = os.path.join(execPath, fn) if os.path.isfile(fn) and os.access(fn, os.X_OK): execFiles.append(fn) - + # Step 2: figure out which file name looks like the application name baseAppName = os.path.basename(fileName).replace('.app', '').lower() foundExe = False @@ -276,14 +276,14 @@ class ConfigDialog(QtWidgets.QDialog): fileName = fn foundExe = True break - + # Step 3: use the first executable in the list if no executable was found try: if not foundExe: fileName = execFiles[0] except IndexError: # whoops, looks like this .app doesn't contain a executable file at all pass - + self.executablepathCombobox.setEditText(os.path.normpath(fileName)) def loadLastUpdateCheckDate(self): @@ -379,7 +379,7 @@ class ConfigDialog(QtWidgets.QDialog): elif os.path.isdir(QStandardPaths.standardLocations(QStandardPaths.HomeLocation)[0]): defaultdirectory = QStandardPaths.standardLocations(QStandardPaths.HomeLocation)[0] else: - defaultdirectory = "" + defaultdirectory = "" browserfilter = "All files (*)" fileName, filtr = QtWidgets.QFileDialog.getOpenFileName(self, "Browse for media files", defaultdirectory, browserfilter, "", options) @@ -387,10 +387,10 @@ class ConfigDialog(QtWidgets.QDialog): self.mediapathTextbox.setText(os.path.normpath(fileName)) self.mediadirectory = os.path.dirname(fileName) self.saveMediaBrowseSettings() - + def _runWithoutStoringConfig(self): self._saveDataAndLeave(False) - + def _saveDataAndLeave(self, storeConfiguration=True): self.config['noStore'] = not storeConfiguration if storeConfiguration: @@ -946,7 +946,7 @@ class ConfigDialog(QtWidgets.QDialog): self.chatInputFontButton.objectName(), self.chatFontLabel.objectName(), self.chatInputColourButton.objectName(), self.chatDirectInputCheckbox.objectName()] # Output - self.chatOutputGroup = QtWidgets.QGroupBox(u"Chat message output") + self.chatOutputGroup = QtWidgets.QGroupBox(getMessage("chatoutputheader-label")) self.chatOutputLayout = QtWidgets.QGridLayout() self.chatLayout.addWidget(self.chatOutputGroup) self.chatOutputGroup.setLayout(self.chatOutputLayout) @@ -1213,7 +1213,7 @@ class ConfigDialog(QtWidgets.QDialog): settings = QSettings("Syncplay", "MoreSettings") settings.clear() self.datacleared = True - + def populateEmptyServerList(self): if self.publicServers is None: if self.config["checkForUpdatesAutomatically"] == True: @@ -1241,7 +1241,7 @@ class ConfigDialog(QtWidgets.QDialog): self.serverpassTextbox.setEnabled(True) self.serverpassTextbox.setReadOnly(False) self.serverpassTextbox.setText(self.storedPassword) - + def __init__(self, config, playerpaths, error, defaultConfig): self.config = config self.defaultConfig = defaultConfig