mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 22:23:33 +01:00
Fix missing arg handling in html10n.js
This commit is contained in:
parent
405e3e3e19
commit
d5c5ca224b
2 changed files with 6 additions and 4 deletions
|
@ -31,6 +31,8 @@
|
||||||
.gritter-item .gritter-content {
|
.gritter-item .gritter-content {
|
||||||
flex: 1 auto;
|
flex: 1 auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
width: 95%;
|
||||||
|
overflow-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gritter-item .gritter-close {
|
.gritter-item .gritter-close {
|
||||||
|
|
|
@ -779,16 +779,16 @@ window.html10n = (function(window, document, undefined) {
|
||||||
function substArguments(str, args) {
|
function substArguments(str, args) {
|
||||||
var reArgs = /\{\{\s*([a-zA-Z\.]+)\s*\}\}/
|
var reArgs = /\{\{\s*([a-zA-Z\.]+)\s*\}\}/
|
||||||
, match
|
, match
|
||||||
|
var translations = html10n.translations;
|
||||||
while (match = reArgs.exec(str)) {
|
while (match = reArgs.exec(str)) {
|
||||||
if (!match || match.length < 2)
|
if (!match || match.length < 2)
|
||||||
return str // argument key not found
|
return str // argument key not found
|
||||||
|
|
||||||
var arg = match[1]
|
var arg = match[1]
|
||||||
, sub = ''
|
, sub = ''
|
||||||
if (arg in args) {
|
if (args && arg in args) {
|
||||||
sub = args[arg]
|
sub = args[arg]
|
||||||
} else if (arg in translations) {
|
} else if (translations && arg in translations) {
|
||||||
sub = translations[arg]
|
sub = translations[arg]
|
||||||
} else {
|
} else {
|
||||||
console.warn('Could not find argument {{' + arg + '}}')
|
console.warn('Could not find argument {{' + arg + '}}')
|
||||||
|
|
Loading…
Reference in a new issue