diff --git a/syncplay/client.py b/syncplay/client.py index bd84a42..f7618dd 100644 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -6,7 +6,7 @@ from twisted.internet.protocol import ClientFactory from twisted.internet import reactor, task from syncplay.protocols import SyncClientProtocol from syncplay import utils, constants -from syncplay.messages import getMessage +from syncplay.messages import getMessage, getMissingStrings import threading from syncplay.constants import PRIVACY_SENDHASHED_MODE, PRIVACY_DONTSEND_MODE, \ PRIVACY_HIDDENFILENAME, FILENAME_STRIP_REGEX @@ -102,6 +102,11 @@ class SyncplayClient(object): if constants.LIST_RELATIVE_CONFIGS and self._config.has_key('loadedRelativePaths') and self._config['loadedRelativePaths']: self.ui.showMessage(getMessage("relative-config-notification").format("; ".join(self._config['loadedRelativePaths'])), noPlayer=True, noTimestamp=True) + if constants.DEBUG_MODE and constants.WARN_ABOUT_MISSING_STRINGS: + missingStrings = getMissingStrings() + if missingStrings is not None and missingStrings is not "": + self.ui.showDebugMessage("MISSING STRINGS DETECTED:\n{}".format(missingStrings)) + def initProtocol(self, protocol): self._protocol = protocol diff --git a/syncplay/constants.py b/syncplay/constants.py index 4cd8f3d..59a5adb 100644 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -14,6 +14,7 @@ LIST_RELATIVE_CONFIGS = True # Print list of relative configs loaded SHOW_CONTACT_INFO = True # Displays dev contact details below list in GUI SHOW_BUTTON_LABELS = True # If disabled, only shows icons for main GUI buttons SHOW_TOOLTIPS = True +WARN_ABOUT_MISSING_STRINGS = False # (If debug mode is enabled) #Overriden by config SHOW_OSD = True # Sends Syncplay messages to media player OSD diff --git a/syncplay/messages.py b/syncplay/messages.py index a190893..09e310c 100755 --- a/syncplay/messages.py +++ b/syncplay/messages.py @@ -783,6 +783,15 @@ messages = { def setLanguage(lang): messages["current"] = lang +def getMissingStrings(): + missingStrings = "" + for lang in messages: + if lang != "en" and lang != "current": + for message in messages["en"]: + if not messages[lang].has_key(message): + missingStrings = missingStrings + "({}) Missing: {}\n".format(lang, message) + return missingStrings + def getMessage(type_, locale=None): if constants.SHOW_BUTTON_LABELS == False: if "-guibuttonlabel" in type_: