at 16.09-beta 98 lines 3.8 kB view raw
1diff -Nurp anki-2.0.33.orig/anki/lang.py anki-2.0.33/anki/lang.py 2--- anki-2.0.33.orig/anki/lang.py 2015-12-27 11:23:02.334908723 +0100 3+++ anki-2.0.33/anki/lang.py 2015-12-27 14:06:00.688003103 +0100 4@@ -71,13 +71,7 @@ def ngettext(single, plural, n): 5 return localTranslation().ungettext(single, plural, n) 6 7 def langDir(): 8- dir = os.path.join(os.path.dirname( 9- os.path.abspath(__file__)), "locale") 10- if not os.path.isdir(dir): 11- dir = os.path.join(os.path.dirname(sys.argv[0]), "locale") 12- if not os.path.isdir(dir): 13- dir = "/usr/share/anki/locale" 14- return dir 15+ return "@anki@/share/locale" 16 17 def setLang(lang, local=True): 18 trans = gettext.translation( 19diff -Nurp anki-2.0.33.orig/anki/sound.py anki-2.0.33/anki/sound.py 20--- anki-2.0.33.orig/anki/sound.py 2015-12-27 11:23:02.334908723 +0100 21+++ anki-2.0.33/anki/sound.py 2015-12-27 11:34:11.863147265 +0100 22@@ -29,8 +29,9 @@ processingDst = u"rec.mp3" 23 processingChain = [] 24 recFiles = [] 25 26+lameCmd = "@lame@/bin/lame" 27 processingChain = [ 28- ["lame", "rec.wav", processingDst, "--noreplaygain", "--quiet"], 29+ [lameCmd, "rec.wav", processingDst, "--noreplaygain", "--quiet"], 30 ] 31 32 # don't show box on windows 33@@ -44,13 +45,6 @@ if isWin: 34 else: 35 si = None 36 37-if isMac: 38- # make sure lame, which is installed in /usr/local/bin, is in the path 39- os.environ['PATH'] += ":" + "/usr/local/bin" 40- dir = os.path.dirname(os.path.abspath(__file__)) 41- dir = os.path.abspath(dir + "/../../../..") 42- os.environ['PATH'] += ":" + dir + "/audio" 43- 44 def retryWait(proc): 45 # osx throws interrupted system call errors frequently 46 while 1: 47@@ -62,13 +56,7 @@ def retryWait(proc): 48 # Mplayer settings 49 ########################################################################## 50 51-if isWin: 52- mplayerCmd = ["mplayer.exe", "-ao", "win32"] 53- dir = os.path.dirname(os.path.abspath(sys.argv[0])) 54- os.environ['PATH'] += ";" + dir 55- os.environ['PATH'] += ";" + dir + "\\..\\win\\top" # for testing 56-else: 57- mplayerCmd = ["mplayer"] 58+mplayerCmd = ["@mplayer@/bin/mplayer"] 59 mplayerCmd += ["-really-quiet", "-noautosub"] 60 61 # Mplayer in slave mode 62@@ -220,7 +208,7 @@ class _Recorder(object): 63 self.encode = encode 64 for c in processingChain: 65 #print c 66- if not self.encode and c[0] == 'lame': 67+ if not self.encode and c[0] == lameCmd: 68 continue 69 try: 70 ret = retryWait(subprocess.Popen(c, startupinfo=si)) 71diff -Nurp anki-2.0.33.orig/aqt/__init__.py anki-2.0.33/aqt/__init__.py 72--- anki-2.0.33.orig/aqt/__init__.py 2015-12-27 11:23:02.338908782 +0100 73+++ anki-2.0.33/aqt/__init__.py 2015-12-27 12:35:03.405565214 +0100 74@@ -107,7 +107,7 @@ def setupLang(pm, app, force=None): 75 app.setLayoutDirection(Qt.LeftToRight) 76 # qt 77 _qtrans = QTranslator() 78- if _qtrans.load("qt_" + lang, dir): 79+ if _qtrans.load("qt_" + lang, "@qt4@/share/@qt4name@/translations"): 80 app.installTranslator(_qtrans) 81 82 # App initialisation 83diff -Nurp anki-2.0.33.orig/oldanki/lang.py anki-2.0.33/oldanki/lang.py 84--- anki-2.0.33.orig/oldanki/lang.py 2015-12-27 11:23:02.390909551 +0100 85+++ anki-2.0.33/oldanki/lang.py 2015-12-27 14:05:51.663920453 +0100 86@@ -32,11 +32,7 @@ def ngettext(single, plural, n): 87 return localTranslation().ungettext(single, plural, n) 88 89 def setLang(lang, local=True): 90- base = os.path.dirname(os.path.abspath(__file__)) 91- localeDir = os.path.join(base, "locale") 92- if not os.path.exists(localeDir): 93- localeDir = os.path.join( 94- os.path.dirname(sys.argv[0]), "locale") 95+ localeDir = "@anki@/share/locale" 96 trans = gettext.translation('libanki', localeDir, 97 languages=[lang], 98 fallback=True)