mirror of
https://github.com/Syncplay/syncplay
synced 2025-02-20 21:16:49 +00:00
Merge pull request #179 from albertosottile/master
Fixing some unicode and Italian translation issues
This commit is contained in:
commit
e80a6aab89
@ -1929,6 +1929,10 @@ class FileSwitchManager(object):
|
||||
return False
|
||||
|
||||
def notifyUserIfFileNotInMediaDirectory(self, filenameToFind, path):
|
||||
try:
|
||||
path = path.decode('utf-8')
|
||||
except UnicodeEncodeError:
|
||||
pass
|
||||
directoryToFind = os.path.dirname(path)
|
||||
if directoryToFind in self.mediaDirectoriesNotFound:
|
||||
return
|
||||
|
@ -50,7 +50,7 @@ it = {
|
||||
|
||||
"file-different-notification" : u"Il file che stai riproducendo sembra essere diverso da quello di {}", # User
|
||||
"file-differences-notification" : u"Il tuo file mostra le seguenti differenze: {}", # Differences
|
||||
"room-file-differences" : u"Differenze: {} \n", # File differences (filename, size, and/or duration)
|
||||
"room-file-differences" : u"Differenze: {}", # File differences (filename, size, and/or duration)
|
||||
"file-difference-filename" : u"nome",
|
||||
"file-difference-filesize" : u"dimensione",
|
||||
"file-difference-duration" : u"durata",
|
||||
|
@ -91,6 +91,10 @@ class ConsoleUI(threading.Thread):
|
||||
|
||||
def showMessage(self, message, noTimestamp=False):
|
||||
message = message.encode(sys.stdout.encoding, 'replace')
|
||||
try:
|
||||
message = message.decode('utf-8')
|
||||
except UnicodeEncodeError:
|
||||
pass
|
||||
if noTimestamp:
|
||||
print(message)
|
||||
else:
|
||||
|
@ -19,6 +19,7 @@ from twisted.internet import task
|
||||
from syncplay.ui.consoleUI import ConsoleUI
|
||||
if isMacOS() and IsPySide:
|
||||
from Foundation import NSURL
|
||||
from Cocoa import NSString, NSUTF8StringEncoding
|
||||
lastCheckedForUpdates = None
|
||||
|
||||
class ConsoleInGUI(ConsoleUI):
|
||||
@ -222,7 +223,9 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
|
||||
for url in urls[::-1]:
|
||||
if isMacOS() and IsPySide:
|
||||
dropfilepath = os.path.abspath(NSURL.URLWithString_(str(url.toString())).filePathURL().path())
|
||||
macURL = NSString.alloc().initWithString_(unicode(url.toString()))
|
||||
pathString = macURL.stringByAddingPercentEscapesUsingEncoding_(NSUTF8StringEncoding)
|
||||
dropfilepath = os.path.abspath(NSURL.URLWithString_(pathString).filePathURL().path())
|
||||
else:
|
||||
dropfilepath = os.path.abspath(unicode(url.toLocalFile()))
|
||||
if os.path.isfile(dropfilepath):
|
||||
@ -327,7 +330,9 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
indexRow = window.playlist.count()
|
||||
for url in urls[::-1]:
|
||||
if isMacOS() and IsPySide:
|
||||
dropfilepath = os.path.abspath(NSURL.URLWithString_(str(url.toString())).filePathURL().path())
|
||||
macURL = NSString.alloc().initWithString_(unicode(url.toString()))
|
||||
pathString = macURL.stringByAddingPercentEscapesUsingEncoding_(NSUTF8StringEncoding)
|
||||
dropfilepath = os.path.abspath(NSURL.URLWithString_(pathString).filePathURL().path())
|
||||
else:
|
||||
dropfilepath = os.path.abspath(unicode(url.toLocalFile()))
|
||||
if os.path.isfile(dropfilepath):
|
||||
@ -1609,7 +1614,9 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
if urls and urls[0].scheme() == 'file':
|
||||
url = event.mimeData().urls()[0]
|
||||
if isMacOS() and IsPySide:
|
||||
dropfilepath = os.path.abspath(NSURL.URLWithString_(str(url.toString())).filePathURL().path())
|
||||
macURL = NSString.alloc().initWithString_(unicode(url.toString()))
|
||||
pathString = macURL.stringByAddingPercentEscapesUsingEncoding_(NSUTF8StringEncoding)
|
||||
dropfilepath = os.path.abspath(NSURL.URLWithString_(pathString).filePathURL().path())
|
||||
else:
|
||||
dropfilepath = os.path.abspath(unicode(url.toLocalFile()))
|
||||
if rewindFile == False:
|
||||
|
Loading…
Reference in New Issue
Block a user