From 28d94949600ba846608ce541928235b34aeb1304 Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Fri, 5 Mar 2010 19:28:47 +0000 Subject: [PATCH] Web build: translation and pdf links. --- scripts/build/website_post.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/build/website_post.py b/scripts/build/website_post.py index 4475b467fc..1f573910d4 100644 --- a/scripts/build/website_post.py +++ b/scripts/build/website_post.py @@ -46,14 +46,15 @@ for file in html_files: langs = list(langs_set) langs.sort() -def makeFooter(currentLang): +def makeFooter(currentLang, currentPage): text = "

\n" text += lang_other_langs[currentLang] for i in range(len(langs)): l = langs[i] if (l == currentLang): continue - text += "" @@ -89,7 +90,8 @@ for file in html_files: # ick os.remove(file) - lang_footer = makeFooter(lang) + # ick + lang_footer = makeFooter(lang, out_filename.split('.')[0]) outfile = open( os.path.join(outdir, out_filename), 'w') for line in lines: @@ -103,6 +105,16 @@ for file in html_files: text += "." + lang text += ".html" line = line.replace(".html", text) + if ((line.find("href") >= 0) and + (line.find("http")==-1) and + (line.find("pdf") >= 0)): + text = "" + if (not (lang=="")): + text += "." + lang + text += ".pdf" + line = line.replace(".pdf", text) + + if (line.find("") >= 0): outfile.write( lang_footer ) outfile.write(line) -- 2.39.2