Commit dc93cfdc authored by webchick's avatar webchick

Issue #2052973 by Mark Carver, nod_, hass: Fixed Improve translatability of strings in toolbar.js.

parent 99575b2b
......@@ -15,8 +15,6 @@ var options = $.extend({
'module.toolbar.wide': ''
},
strings: {
opened: Drupal.t('opened'),
closed: Drupal.t('closed'),
horizontal: Drupal.t('Horizontal orientation'),
vertical: Drupal.t('Vertical orientation')
}
......@@ -273,11 +271,15 @@ Drupal.toolbar = {
*/
onActiveTrayChange: function (model, tray) {
var relevantTray = (tray === null) ? model.previous('activeTray') : tray;
var state = (tray === null) ? this.strings.closed : this.strings.opened;
Drupal.announce(Drupal.t('"@tray" tray @state.', {
'@tray': relevantTray.querySelector('.toolbar-tray-name').textContent,
'@state': state
}));
var trayName = relevantTray.querySelector('.toolbar-tray-name').textContent;
var text;
if (tray === null) {
text = Drupal.t('Tray "@tray" closed.', { '@tray': trayName });
}
else {
text = Drupal.t('Tray "@tray" opened.', { '@tray': trayName });
}
Drupal.announce(text);
}
}),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment