diff options
author | Raphael Langella <raphael.langella@gmail.com> | 2014-04-08 13:45:18 +0200 |
---|---|---|
committer | Raphael Langella <raphael.langella@gmail.com> | 2014-04-08 13:45:18 +0200 |
commit | 44e1c6938d5d30f6096d246d37bdcfba49682c76 (patch) | |
tree | be774b03594dcedf4b700724ca9e4474f82ffe1b /crawl-ref/source/util | |
parent | ca1e12dba1402130c2eb4d08280e96f1e0afe990 (diff) | |
download | crawl-ref-44e1c6938d5d30f6096d246d37bdcfba49682c76.tar.gz crawl-ref-44e1c6938d5d30f6096d246d37bdcfba49682c76.zip |
[txc] don't crash when merging a new language.
Also, simplify by removing a useless check.
Diffstat (limited to 'crawl-ref/source/util')
-rwxr-xr-x | crawl-ref/source/util/txc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crawl-ref/source/util/txc b/crawl-ref/source/util/txc index 6b1dcdba09..3996d9b519 100755 --- a/crawl-ref/source/util/txc +++ b/crawl-ref/source/util/txc @@ -355,6 +355,8 @@ class ResourceIndex(): self.default_resources.append(basename) elif os.path.isdir(f) and lang_re.match(f): self.default_languages.append(f) + if not os.path.exists(f[:2]): + os.makedirs(f[:2]) if options.source: self.languages = ['en'] @@ -707,7 +709,7 @@ class TxtFile(ResourceFile): if lang: self.entries = dict() self.source_res = txt_files[('', res)] - self.lang_dir = 'en' if lang == 'en' else lang[:2] + self.lang_dir = lang[:2] else: self.entries = OrderedDict() self.source_res = self |