From d421c26d9c83f1198f6ce565d9bc74240bba3ebc Mon Sep 17 00:00:00 2001 From: Mark Carver Date: Mon, 29 Jul 2013 11:52:19 -0500 Subject: Issue #2052973 by Mark Carver: Improve translatability of strings in toolbar.js --- core/modules/toolbar/js/toolbar.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/core/modules/toolbar/js/toolbar.js b/core/modules/toolbar/js/toolbar.js index a0efd2a..27983b8 100644 --- a/core/modules/toolbar/js/toolbar.js +++ b/core/modules/toolbar/js/toolbar.js @@ -15,8 +15,8 @@ var options = $.extend({ 'module.toolbar.wide': '' }, strings: { - opened: Drupal.t('opened'), - closed: Drupal.t('closed'), + opened: Drupal.t('Opened'), + closed: Drupal.t('Closed'), horizontal: Drupal.t('Horizontal orientation'), vertical: Drupal.t('Vertical orientation') } @@ -273,11 +273,16 @@ 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 - })); + if (tray === null) { + Drupal.announce(Drupal.t('Tray "@tray" closed.', { + '@tray': relevantTray.querySelector('.toolbar-tray-name').textContent + })); + } + else { + Drupal.announce(Drupal.t('Tray "@tray" opened.', { + '@tray': relevantTray.querySelector('.toolbar-tray-name').textContent + })); + } } }), -- 1.8.2