[feature] i18n for automatic reconnection messages/buttons

This commit is contained in:
Luiza Pagliari 2017-04-04 18:09:33 -03:00
parent 5e90700561
commit 0eae83f252
2 changed files with 10 additions and 1 deletions

View File

@ -74,6 +74,8 @@
"pad.modals.connected": "Connected.",
"pad.modals.reconnecting": "Reconnecting to your pad..",
"pad.modals.forcereconnect": "Force reconnect",
"pad.modals.reconnecttimer": "This pad will be automatically reconnected in ",
"pad.modals.cancel": "Cancel",
"pad.modals.userdup": "Opened in another window",
"pad.modals.userdup.explanation": "This pad seems to be opened in more than one browser window on this computer.",

View File

@ -22,16 +22,23 @@ var createCountDownElementsIfNecessary = function($modal) {
// create extra DOM elements, if they don't exist
var $reconnectTimerMessage = $('<p class="reconnecttimer"> \
<span data-l10n-id="pad.modals.reconnecttimer">This window will automatically reconnect in </span> \
<span data-l10n-id="pad.modals.reconnecttimer">This pad will be automatically reconnected in </span> \
<span class="timetoexpire"></span> \
</p>');
var $cancelReconnect = $('<button id="cancelreconnect" data-l10n-id="pad.modals.cancel">Cancel</button>');
localize($reconnectTimerMessage);
localize($cancelReconnect);
$reconnectTimerMessage.insertAfter($defaultMessage);
$cancelReconnect.insertAfter($reconnectButton);
}
}
var localize = function($element) {
html10n.translateElement(html10n.translations, $element.get(0));
};
var createTimerForModal = function($modal) {
var timer = new CountDownTimer(clientVars.automaticReconnectionTimeout);