1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-20 12:58:07 +01:00

Debian patch: xx-get_translations.patch

This commit is contained in:
Adam Blackburn
2010-05-29 17:32:40 +08:00
parent dbe4bcf395
commit 4871474859

View File

@@ -436,7 +436,10 @@ class get_translations(Command):
import urllib, shutil
if os.path.exists('translations'):
shutil.rmtree('translations/')
if os.path.exists('po'):
shutil.rmtree('po/')
os.makedirs('translations')
os.makedirs('po')
filename, headers = urllib.urlretrieve('http://wicd.sourceforge.net/translator/idlist/')
id_file = open(filename, 'r')
lines = id_file.readlines()
@@ -452,11 +455,10 @@ class get_translations(Command):
except:
print >> sys.stderr, 'error downloading language %s' % id
else:
shutil.move(pofile, lang_identifier+'.po')
shutil.move(pofile, 'po/'+lang_identifier+'.po')
os.makedirs('translations/'+lang_identifier+'/LC_MESSAGES')
os.system('msgfmt --output-file=translations/' + lang_identifier +
'/LC_MESSAGES/wicd.mo ' + lang_identifier + '.po')
os.remove(lang_identifier+'.po')
'/LC_MESSAGES/wicd.mo po/' + lang_identifier + '.po')
class uninstall(Command):