Fixes comments from review.
Adds a safe check, i18n is expecting undefined not null. Fix a method name and translation to be at placeholder.
This commit is contained in:
parent
076f7a82de
commit
b2a1c9881e
|
@ -146,10 +146,10 @@ export default class Dialog {
|
||||||
this.submitted = false;
|
this.submitted = false;
|
||||||
this.onCloseCallback = function() {};
|
this.onCloseCallback = function() {};
|
||||||
|
|
||||||
this.setDefaulOptions();
|
this.setDefaultOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
setDefaulOptions() {
|
setDefaultOptions() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
this.options = {
|
this.options = {
|
||||||
|
|
|
@ -156,7 +156,8 @@ export default class InviteDialogView {
|
||||||
</label>
|
</label>
|
||||||
<div class="input-control__container">
|
<div class="input-control__container">
|
||||||
<input class="input-control__input" id="newPasswordInput"
|
<input class="input-control__input" id="newPasswordInput"
|
||||||
type="text" data-i18n="dialog.createPassword">
|
type="text"
|
||||||
|
data-i18n="[placeholder]dialog.createPassword">
|
||||||
<button id="addPasswordBtn" id="inviteDialogAddPassword"
|
<button id="addPasswordBtn" id="inviteDialogAddPassword"
|
||||||
disabled data-i18n="dialog.add"
|
disabled data-i18n="dialog.add"
|
||||||
class="button-control button-control_light">
|
class="button-control button-control_light">
|
||||||
|
|
|
@ -98,7 +98,9 @@ module.exports = {
|
||||||
return i18n.lng();
|
return i18n.lng();
|
||||||
},
|
},
|
||||||
translateElement: function (selector, options) {
|
translateElement: function (selector, options) {
|
||||||
selector.i18n(options);
|
// i18next expects undefined if options are missing, check if its null
|
||||||
|
selector.i18n(
|
||||||
|
options === null ? undefined : options);
|
||||||
},
|
},
|
||||||
generateTranslationHTML: function (key, options) {
|
generateTranslationHTML: function (key, options) {
|
||||||
var str = "<span data-i18n=\"" + key + "\"";
|
var str = "<span data-i18n=\"" + key + "\"";
|
||||||
|
@ -106,7 +108,8 @@ module.exports = {
|
||||||
str += " data-i18n-options='" + JSON.stringify(options) + "'";
|
str += " data-i18n-options='" + JSON.stringify(options) + "'";
|
||||||
}
|
}
|
||||||
str += ">";
|
str += ">";
|
||||||
str += i18n.t(key, options);
|
// i18next expects undefined if options ARE missing, check if its null
|
||||||
|
str += i18n.t(key, options === null ? undefined : options);
|
||||||
str += "</span>";
|
str += "</span>";
|
||||||
return str;
|
return str;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue