mirror of
https://github.com/gryf/wicd.git
synced 2025-12-20 21:08:06 +01:00
Debian patch: xx-get_translations.patch
This commit is contained in:
8
setup.py
8
setup.py
@@ -436,7 +436,10 @@ class get_translations(Command):
|
|||||||
import urllib, shutil
|
import urllib, shutil
|
||||||
if os.path.exists('translations'):
|
if os.path.exists('translations'):
|
||||||
shutil.rmtree('translations/')
|
shutil.rmtree('translations/')
|
||||||
|
if os.path.exists('po'):
|
||||||
|
shutil.rmtree('po/')
|
||||||
os.makedirs('translations')
|
os.makedirs('translations')
|
||||||
|
os.makedirs('po')
|
||||||
filename, headers = urllib.urlretrieve('http://wicd.sourceforge.net/translator/idlist/')
|
filename, headers = urllib.urlretrieve('http://wicd.sourceforge.net/translator/idlist/')
|
||||||
id_file = open(filename, 'r')
|
id_file = open(filename, 'r')
|
||||||
lines = id_file.readlines()
|
lines = id_file.readlines()
|
||||||
@@ -452,11 +455,10 @@ class get_translations(Command):
|
|||||||
except:
|
except:
|
||||||
print >> sys.stderr, 'error downloading language %s' % id
|
print >> sys.stderr, 'error downloading language %s' % id
|
||||||
else:
|
else:
|
||||||
shutil.move(pofile, lang_identifier+'.po')
|
shutil.move(pofile, 'po/'+lang_identifier+'.po')
|
||||||
os.makedirs('translations/'+lang_identifier+'/LC_MESSAGES')
|
os.makedirs('translations/'+lang_identifier+'/LC_MESSAGES')
|
||||||
os.system('msgfmt --output-file=translations/' + lang_identifier +
|
os.system('msgfmt --output-file=translations/' + lang_identifier +
|
||||||
'/LC_MESSAGES/wicd.mo ' + lang_identifier + '.po')
|
'/LC_MESSAGES/wicd.mo po/' + lang_identifier + '.po')
|
||||||
os.remove(lang_identifier+'.po')
|
|
||||||
|
|
||||||
|
|
||||||
class uninstall(Command):
|
class uninstall(Command):
|
||||||
|
|||||||
Reference in New Issue
Block a user