[library-web] [mallard] do not add a language extension to .catalog files



commit 804dc43156421c32ebda4f7e17c467efb094c411
Author: Frédéric Péters <fpeters 0d be>
Date:   Sun May 22 19:13:59 2011 +0200

    [mallard] do not add a language extension to .catalog files

 src/modtypes/mallard.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/modtypes/mallard.py b/src/modtypes/mallard.py
index f38de9c..76b13f2 100644
--- a/src/modtypes/mallard.py
+++ b/src/modtypes/mallard.py
@@ -348,7 +348,12 @@ class MallardModule(DocModule):
                         src = os.path.join(ext_dirname, self.dirname, 'C', doc_figure)
                         if not os.path.exists(src):
                             continue
-                    dst = os.path.join(web_output_dir, doc_figure + '.%s' % lang)
+                    if os.path.splitext(src)[-1] in ('.catalog',):
+                        # the .catalog file should be unique for all
+                        # translations
+                        dst = os.path.join(web_output_dir, doc_figure)
+                    else:
+                        dst = os.path.join(web_output_dir, doc_figure + '.%s' % lang)
                     if not os.path.exists(os.path.split(dst)[0]):
                         os.makedirs(os.path.split(dst)[0])
                     open(dst, 'w').write(open(src, 'r').read())



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]