diff --git a/Makefile b/Makefile index a197cc0ba7f77349091b291d2c00d638a344584a..c398e0c8889b78359f06cda81769eca88e0ad84b 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ check: bjcp-2015-styleguide-orig.xml bjcp-2015-styleguide-de.xml install: bjcp-2015-styleguide-de-edit.html ssh z "if [ ! -d /var/www/bjcp-styleguide ] ; then sudo mkdir /var/www/bjcp-styleguide ; sudo chown frank.www-data /var/www/bjcp-styleguide ; sudo chmod u+rwx,g+rwxs /var/www/bjcp-styleguide ; touch /var/www/bjcp-styleguide/logfile ; mkdir /var/www/bjcp-styleguide/snippets; fi" scp bjcp-2015-styleguide-de-edit.html web/bjcp-styleguide.css web/edit.css web/edit.js web/pell.css web/pell.js web/save.cgi z:/var/www/bjcp-styleguide/ - ssh z "cd /var/www/bjcp-styleguide ; rm -rf bjcp-2015-styleguide ; git clone https://github.com/frsteinb/bjcp-2015-styleguide.git ; cd bjcp-2015-styleguide ; make" + ssh z "cd /var/www/bjcp-styleguide ; rm -rf bjcp-2015-styleguide ; git clone https://github.com/frsteinb/bjcp-2015-styleguide.git ; cd bjcp-2015-styleguide ; make bjcp-2015-styleguide-orig.xml" clean: @rm -rf orig diff --git a/web/edit.js b/web/edit.js index d81ee69bc99aee5539026b29ad92bead10842d9a..35a0e60ea8809cc347a1db8405ec95bc1260de3a 100644 --- a/web/edit.js +++ b/web/edit.js @@ -120,6 +120,7 @@ function dosave() { xhr.onreadystatechange = function() { if (xhr.readyState === 4) { editor.style.display = "none"; + editelem.innerHTML = x; } } diff --git a/web/save.cgi b/web/save.cgi index 90e7e4f0d83e8ee85d3afc24636d41cf7505b1e1..7c145e70622bbf4ae42f768c19b5d93c424412c9 100755 --- a/web/save.cgi +++ b/web/save.cgi @@ -11,8 +11,8 @@ import datetime DIR = "/var/www/bjcp-styleguide" LOGFILE = "%s/logfile" % DIR -SNIPPETDIR = "/var/www/bjcp-styleguide/snippets" -REPODIR = "/var/www/bjcp-styleguide/bjcp-2015-styleguide" +SNIPPETDIR = "%s/snippets" % DIR +REPODIR = "%s/bjcp-2015-styleguide" % DIR LANG = "de" @@ -111,13 +111,17 @@ origfilename = "%s/orig/%s.xml" % (REPODIR, id) translatedfilename = "%s/%s/%s.xml" % (REPODIR, LANG, id) if os.path.isfile(translatedfilename): - log("creating new translation file %s/%s.xml from orig/%s.xml and snippet" % (LANG, id, id)) + log("updating translation file %s/%s.xml based on snippet" % (LANG, id)) cmd = "xsltproc --stringparam snippet %s %s/xsl/bjcp-2015-styleguide-merge.xsl %s > %s.tmp ; mv %s.tmp %s" % (snippetfilename, REPODIR, translatedfilename, translatedfilename, translatedfilename, translatedfilename) os.system(cmd) -if os.path.isfile(origfilename): - log("updating translation file %s/%s.xml based on snippet" % (LANG, id)) + cmd = "make -C %s && cp %s/bjcp-2015-styleguide-de-edit.html %s/bjcp-2015-styleguide-de-edit.html" % (REPODIR, REPODIR, DIR) + os.system(cmd) +elif os.path.isfile(origfilename): + log("creating new translation file %s/%s.xml from orig/%s.xml and snippet" % (LANG, id, id)) cmd = "xsltproc --stringparam snippet %s %s/xsl/bjcp-2015-styleguide-merge.xsl %s > %s" % (snippetfilename, REPODIR, origfilename, translatedfilename) os.system(cmd) + cmd = "make -C %s && cp %s/bjcp-2015-styleguide-de-edit.html %s/bjcp-2015-styleguide-de-edit.html" % (REPODIR, REPODIR, DIR) + os.system(cmd) else: log("neither orig file %s nor translated file %s for id %s exists" % (origfilename, translatedfilename, id)) diff --git a/xsl/bjcp-2015-styleguide-split.xsl b/xsl/bjcp-2015-styleguide-split.xsl index dc0257ae8eef52aae394cb9884e7ca2e1928aa48..e5dbd40f3538554e8747bfd1474e4ebc0d5567d7 100644 --- a/xsl/bjcp-2015-styleguide-split.xsl +++ b/xsl/bjcp-2015-styleguide-split.xsl @@ -109,7 +109,7 @@ <!-- suppress these tags in translations --> - <xsl:template match="tags|specs"> + <xsl:template match="bjcp:tags|bjcp:specs"> </xsl:template>