mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #3264 from overleaf/jpa-translations-cleanup
[ExpressLocals] drop support for htmlEncoding the translate content GitOrigin-RevId: d70621dadda96feee0db9e424db368f9197a2162
This commit is contained in:
parent
22046266e1
commit
372a9323ba
4 changed files with 4 additions and 23 deletions
|
@ -3,7 +3,6 @@ const Settings = require('settings-sharelatex')
|
||||||
const querystring = require('querystring')
|
const querystring = require('querystring')
|
||||||
const _ = require('lodash')
|
const _ = require('lodash')
|
||||||
const Url = require('url')
|
const Url = require('url')
|
||||||
const NodeHtmlEncoder = require('node-html-encoder').Encoder
|
|
||||||
const Path = require('path')
|
const Path = require('path')
|
||||||
const moment = require('moment')
|
const moment = require('moment')
|
||||||
|
|
||||||
|
@ -14,8 +13,6 @@ const AuthenticationController = require('../Features/Authentication/Authenticat
|
||||||
const PackageVersions = require('./PackageVersions')
|
const PackageVersions = require('./PackageVersions')
|
||||||
const Modules = require('./Modules')
|
const Modules = require('./Modules')
|
||||||
|
|
||||||
const htmlEncoder = new NodeHtmlEncoder('numerical')
|
|
||||||
|
|
||||||
let webpackManifest
|
let webpackManifest
|
||||||
if (!IS_DEV_ENV) {
|
if (!IS_DEV_ENV) {
|
||||||
// Only load webpack manifest file in production. In dev, the web and webpack
|
// Only load webpack manifest file in production. In dev, the web and webpack
|
||||||
|
@ -179,20 +176,10 @@ module.exports = function(webRouter, privateApiRouter, publicApiRouter) {
|
||||||
})
|
})
|
||||||
|
|
||||||
webRouter.use(function(req, res, next) {
|
webRouter.use(function(req, res, next) {
|
||||||
res.locals.translate = function(key, vars, htmlEncode) {
|
res.locals.translate = function(key, vars) {
|
||||||
if (vars == null) {
|
vars = vars || {}
|
||||||
vars = {}
|
|
||||||
}
|
|
||||||
if (htmlEncode == null) {
|
|
||||||
htmlEncode = false
|
|
||||||
}
|
|
||||||
vars.appName = Settings.appName
|
vars.appName = Settings.appName
|
||||||
const str = req.i18n.translate(key, vars)
|
return req.i18n.translate(key, vars)
|
||||||
if (htmlEncode) {
|
|
||||||
return htmlEncoder.htmlEncode(str)
|
|
||||||
} else {
|
|
||||||
return str
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Don't include the query string parameters, otherwise Google
|
// Don't include the query string parameters, otherwise Google
|
||||||
// treats ?nocdn=true as the canonical version
|
// treats ?nocdn=true as the canonical version
|
||||||
|
|
|
@ -105,7 +105,7 @@ div.full-size(
|
||||||
i.synctex-control-icon(ng-show="!syncToPdfInFlight")
|
i.synctex-control-icon(ng-show="!syncToPdfInFlight")
|
||||||
i.synctex-spin-icon.fa.fa-refresh.fa-spin(ng-show="syncToPdfInFlight")
|
i.synctex-spin-icon.fa.fa-refresh.fa-spin(ng-show="syncToPdfInFlight")
|
||||||
a.btn.btn-default.btn-xs.synctex-control.synctex-control-goto-code(
|
a.btn.btn-default.btn-xs.synctex-control.synctex-control-goto-code(
|
||||||
tooltip-html="'"+translate('go_to_pdf_location_in_code', {}, true)+"'"
|
tooltip=translate('go_to_pdf_location_in_code')
|
||||||
tooltip-placement="right"
|
tooltip-placement="right"
|
||||||
tooltip-append-to-body="true"
|
tooltip-append-to-body="true"
|
||||||
ng-click="syncToCode()"
|
ng-click="syncToCode()"
|
||||||
|
|
5
services/web/package-lock.json
generated
5
services/web/package-lock.json
generated
|
@ -24675,11 +24675,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-3.7.0.tgz",
|
||||||
"integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w=="
|
"integrity": "sha512-L/Eg02Epx6Si2NXmedx+Okg+4UHqmaf3TNcxd50SF9NQGcJaON3AtU++kax69XV7YWz4tUspqZSAsVofhFKG2w=="
|
||||||
},
|
},
|
||||||
"node-html-encoder": {
|
|
||||||
"version": "0.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/node-html-encoder/-/node-html-encoder-0.0.2.tgz",
|
|
||||||
"integrity": "sha512-ZiuSweV3goJorYOkG7FFApxq/BPkiSVIBwQqR/tiDBq8y7Ty2GQ4OOmckgSSHSQXhBoB6RcpeXF6Yn84PoLKiQ=="
|
|
||||||
},
|
|
||||||
"node-int64": {
|
"node-int64": {
|
||||||
"version": "0.4.0",
|
"version": "0.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz",
|
||||||
|
|
|
@ -101,7 +101,6 @@
|
||||||
"mongoose": "^4.13.19",
|
"mongoose": "^4.13.19",
|
||||||
"multer": "git+https://github.com/overleaf/multer.git",
|
"multer": "git+https://github.com/overleaf/multer.git",
|
||||||
"nocache": "^2.1.0",
|
"nocache": "^2.1.0",
|
||||||
"node-html-encoder": "0.0.2",
|
|
||||||
"nodemailer": "2.1.0",
|
"nodemailer": "2.1.0",
|
||||||
"nodemailer-mandrill-transport": "^1.2.0",
|
"nodemailer-mandrill-transport": "^1.2.0",
|
||||||
"nodemailer-ses-transport": "^1.5.1",
|
"nodemailer-ses-transport": "^1.5.1",
|
||||||
|
|
Loading…
Reference in a new issue