Make poupdate work correctly without a i18n directory

This commit is contained in:
Petr Viktorin 2011-04-07 02:31:18 +03:00
parent 0ed5d65384
commit 9b7a3dc4c9

View file

@ -318,6 +318,11 @@ if __name__ == '__main__':
transl = translations.Translations.from_parsed_options(options)
gettext_directory = options.gettext_directory
if (options.pots or options.pos) and not os.path.exists(gettext_directory):
print "Error: Gettext directory doesn't exist. Skipping pot/po creation"
options.pots = options.pos = False
if options.pots:
if options.verbose:
print 'Creating pots in', gettext_directory
@ -337,6 +342,7 @@ if __name__ == '__main__':
for lang, stream in csv_streams.items():
streams[lang].append(stream)
if os.path.exists(gettext_directory):
# Merge in the PO files
if options.langs:
langs = options.langs.split(',')