summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorPhilip Molares2021-03-11 12:21:44 +0100
committerPhilip Molares2021-03-16 10:48:44 +0100
commit8e6aab0145019b40cb5517cbb66d2bbe545f0ec9 (patch)
treeadce712a4458cac655acd8a30b25baa902cf9e69 /public
parent4c9fc63884615f4b80ed54c438cdd64f76aa9ee8 (diff)
Templates: Remove lang and add translation parameter
Since the interface is not always in english, we mostly removed the lang attribute from all html tags. Since the error messages in error.ejs are not translated, but always in english, there the global lang="en" should be kept. Also in the slide and editor template the div, which contains the user generated text, has the attribute translate="no" now, to avoid unwanted translations. Since on the publish view (pretty.ejs) only the user generated content is shown, we set the lang to the language defined in yaml (or 'en') as a default, but that was also moved to the corresponding markdown div instead of html. Fixes #881 See also #437 Signed-off-by: Philip Molares <philip.molares@udo.edu>
Diffstat (limited to 'public')
-rw-r--r--public/views/hedgedoc.ejs4
-rw-r--r--public/views/html.hbs4
-rw-r--r--public/views/index.ejs2
-rw-r--r--public/views/pretty.ejs4
-rw-r--r--public/views/slide.ejs4
5 files changed, 9 insertions, 9 deletions
diff --git a/public/views/hedgedoc.ejs b/public/views/hedgedoc.ejs
index b4bf816e..725e11c8 100644
--- a/public/views/hedgedoc.ejs
+++ b/public/views/hedgedoc.ejs
@@ -1,11 +1,11 @@
<!DOCTYPE html>
-<html lang="en">
+<html>
<head>
<%- include('hedgedoc/head') %>
</head>
-<body>
+<body translate="no">
<%- include('hedgedoc/header') %>
<%- include('hedgedoc/body') %>
<%- include('hedgedoc/footer') %>
diff --git a/public/views/html.hbs b/public/views/html.hbs
index 7ac97241..7e8268ba 100644
--- a/public/views/html.hbs
+++ b/public/views/html.hbs
@@ -1,6 +1,6 @@
<!DOCTYPE html>
-<html lang="en">
+<html>
<head>
<meta charset="utf-8">
@@ -37,7 +37,7 @@
<![endif]-->
</head>
-<body>
+<body translate="no">
{{{html}}}
<div class="ui-toc dropup unselectable hidden-print" style="display:none;">
<div class="pull-right dropdown">
diff --git a/public/views/index.ejs b/public/views/index.ejs
index bd2c4fe6..b88b66b1 100644
--- a/public/views/index.ejs
+++ b/public/views/index.ejs
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="en">
+<html>
<head>
<%- include('index/head') %>
diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs
index 78795211..8dc8db1a 100644
--- a/public/views/pretty.ejs
+++ b/public/views/pretty.ejs
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="<%= lang || "en" %>">
+<html>
<head>
<meta charset="utf-8">
@@ -60,7 +60,7 @@
<% } %>
</small>
</div>
- <div id="doc" class="container markdown-body"><%= body %></div>
+ <div id="doc" class="container markdown-body" <% if (lang) { %> lang="<%= lang %>"<% } %>><%= body %></div>
<div class="ui-toc dropup unselectable hidden-print" style="display:none;">
<div class="pull-right dropdown">
<a id="tocLabel" class="ui-toc-label btn btn-default" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" title="Table of content">
diff --git a/public/views/slide.ejs b/public/views/slide.ejs
index bec8079a..44ed8c70 100644
--- a/public/views/slide.ejs
+++ b/public/views/slide.ejs
@@ -1,5 +1,5 @@
<!doctype html>
-<html lang="en">
+<html>
<head>
<meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
@@ -48,7 +48,7 @@
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
</head>
- <body>
+ <body translate="no">
<div class="container">
<div class="reveal">
<div class="slides"><%= body %></div>