[TASK] Port TYPO3.LLL usages to TYPO3.lang 36/54836/3
authorPawel Cieslik <p.cieslik@macopedia.pl>
Tue, 28 Nov 2017 16:23:17 +0000 (17:23 +0100)
committerTymoteusz Motylewski <t.motylewski@gmail.com>
Wed, 29 Nov 2017 10:42:10 +0000 (11:42 +0100)
TYPO3 core uses new JS api for fetching language labels - TYPO3.lang.

Resolves: #83142
Releases: master
Change-Id: I690b667b27d1152556b147e7198260fae018c62b
Reviewed-on: https://review.typo3.org/54836
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Łukasz Uznański <l.uznanski@macopedia.pl>
Tested-by: Łukasz Uznański <l.uznanski@macopedia.pl>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/backend/Resources/Public/JavaScript/ContextHelp.js
typo3/sysext/backend/Resources/Public/JavaScript/LiveSearch.js
typo3/sysext/backend/Resources/Public/JavaScript/LoginRefresh.js

index 4ad2783..6b64917 100644 (file)
@@ -163,6 +163,9 @@ class BackendController
         // load debug console
         $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/DebugConsole');
 
+        $this->pageRenderer->addInlineLanguageLabelFile('EXT:lang/Resources/Private/Language/locallang_core.xlf');
+        $this->pageRenderer->addInlineLanguageLabelFile('EXT:lang/Resources/Private/Language/locallang_misc.xlf');
+
         $this->pageRenderer->addInlineSetting('ShowItem', 'moduleUrl', BackendUtility::getModuleUrl('show_item'));
         $this->pageRenderer->addInlineSetting('RecordHistory', 'moduleUrl', BackendUtility::getModuleUrl('record_history'));
         $this->pageRenderer->addInlineSetting('NewRecord', 'moduleUrl', BackendUtility::getModuleUrl('db_new'));
index edf32e0..cf24dee 100644 (file)
@@ -48,8 +48,8 @@ define(['jquery', 'TYPO3/CMS/Backend/Popover', 'bootstrap'], function($, Popover
                        $('.icon-actions-system-shortcut-new').closest('.btn').hide();
                }
                var title = '&nbsp;';
-               if (typeof backendWindow.TYPO3.LLL !== 'undefined') {
-                       title = backendWindow.TYPO3.LLL.core.csh_tooltip_loading;
+               if (typeof backendWindow.TYPO3.lang !== 'undefined') {
+                       title = backendWindow.TYPO3.lang['csh_tooltip_loading'];
                }
                var $element = $(this.selector);
                $element
index bb71251..43ae4ba 100644 (file)
@@ -48,10 +48,10 @@ define([
                        showNoSuggestionNotice: true,
                        triggerSelectOnValidInput: false,
                        preventBadQueries: false,
-                       noSuggestionNotice: '<h3 class="dropdown-headline">' + TYPO3.LLL.liveSearch.listEmptyText + '</h3>'
-                                       + '<p>' + TYPO3.LLL.liveSearch.helpTitle + '</p>'
+                       noSuggestionNotice: '<h3 class="dropdown-headline">' + TYPO3.lang['liveSearch_listEmptyText'] + '</h3>'
+                                       + '<p>' + TYPO3.lang['liveSearch_helpTitle'] + '</p>'
                                        + '<hr>'
-                                       + '<p>' + TYPO3.LLL.liveSearch.helpDescription + '<br>' + TYPO3.LLL.liveSearch.helpDescriptionPages + '</p>',
+                                       + '<p>' + TYPO3.lang['liveSearch_helpDescription'] + '<br>' + TYPO3.lang['liveSearch_helpDescriptionPages'] + '</p>',
                        // put the AJAX results in the right format
                        transformResult: function(response) {
                                return {
@@ -106,7 +106,7 @@ define([
                        beforeRender: function(container) {
                                container.append('<hr><div>' +
                                        '<a href="#" class="btn btn-primary pull-right t3js-live-search-show-all">' +
-                                               TYPO3.LLL.liveSearch.showAllResults +
+                                               TYPO3.lang['liveSearch_showAllResults'] +
                                        '</a>' +
                                '</div>');
                                if (!$(toolbarItem).hasClass('open')) {
index e1a86a2..da64e7f 100644 (file)
@@ -113,9 +113,9 @@ define(['jquery', 'TYPO3/CMS/Backend/Notification', 'bootstrap'], function($, Ty
        LoginRefresh.initializeTimeoutModal = function() {
                LoginRefresh.$timeoutModal = LoginRefresh.generateModal(LoginRefresh.identifier.loginrefresh);
                LoginRefresh.$timeoutModal.addClass('modal-severity-notice');
-               LoginRefresh.$timeoutModal.find('.modal-header h4').text(TYPO3.LLL.core.login_about_to_expire_title);
+               LoginRefresh.$timeoutModal.find('.modal-header h4').text(TYPO3.lang['mess.login_about_to_expire_title']);
                LoginRefresh.$timeoutModal.find('.modal-body').append(
-                       $('<p />').text(TYPO3.LLL.core.login_about_to_expire),
+                       $('<p />').text(TYPO3.lang['mess.login_about_to_expire']),
                        $('<div />', {class: 'progress'}).append(
                                $('<div />', {
                                        class: 'progress-bar progress-bar-warning progress-bar-striped active',
@@ -128,10 +128,10 @@ define(['jquery', 'TYPO3/CMS/Backend/Notification', 'bootstrap'], function($, Ty
                        )
                );
                LoginRefresh.$timeoutModal.find('.modal-footer').append(
-                       $('<button />', {class: 'btn btn-default', 'data-action': 'logout'}).text(TYPO3.LLL.core.refresh_login_logout_button).on('click', function() {
+                       $('<button />', {class: 'btn btn-default', 'data-action': 'logout'}).text(TYPO3.lang['mess.refresh_login_logout_button']).on('click', function() {
                                top.location.href = LoginRefresh.logoutUrl;
                        }),
-                       $('<button />', {class: 'btn btn-primary t3js-active', 'data-action': 'refreshSession'}).text(TYPO3.LLL.core.refresh_login_refresh_button).on('click', function() {
+                       $('<button />', {class: 'btn btn-primary t3js-active', 'data-action': 'refreshSession'}).text(TYPO3.lang['mess.refresh_login_refresh_button']).on('click', function() {
                                $.ajax({
                                        url: TYPO3.settings.ajaxUrls['login_timedout'],
                                        method: 'GET',
@@ -156,8 +156,8 @@ define(['jquery', 'TYPO3/CMS/Backend/Notification', 'bootstrap'], function($, Ty
                LoginRefresh.fillProgressbar(LoginRefresh.$timeoutModal);
 
                if (typeof Notification !== 'undefined' && Notification.permission === 'granted' && !LoginRefresh.isPageActive()) {
-                       LoginRefresh.webNotification = new Notification(TYPO3.LLL.core.login_about_to_expire_title, {
-                               body: TYPO3.LLL.core.login_about_to_expire,
+                       LoginRefresh.webNotification = new Notification(TYPO3.lang['mess.login_about_to_expire_title'], {
+                               body: TYPO3.lang['mess.login_about_to_expire'],
                                icon: '/typo3/sysext/backend/Resources/Public/Images/Logo.png'
                        });
                        LoginRefresh.webNotification.onclick = function() {
@@ -183,9 +183,9 @@ define(['jquery', 'TYPO3/CMS/Backend/Notification', 'bootstrap'], function($, Ty
         */
        LoginRefresh.initializeBackendLockedModal = function() {
                LoginRefresh.$backendLockedModal = LoginRefresh.generateModal(LoginRefresh.identifier.lockedModal);
-               LoginRefresh.$backendLockedModal.find('.modal-header h4').text(TYPO3.LLL.core.please_wait);
+               LoginRefresh.$backendLockedModal.find('.modal-header h4').text(TYPO3.lang['mess.please_wait']);
                LoginRefresh.$backendLockedModal.find('.modal-body').append(
-                       $('<p />').text(TYPO3.LLL.core.be_locked)
+                       $('<p />').text(TYPO3.lang['mess.be_locked'])
                );
                LoginRefresh.$backendLockedModal.find('.modal-footer').remove();
 
@@ -217,22 +217,22 @@ define(['jquery', 'TYPO3/CMS/Backend/Notification', 'bootstrap'], function($, Ty
 
                LoginRefresh.$loginForm = LoginRefresh.generateModal(LoginRefresh.identifier.loginFormModal);
                LoginRefresh.$loginForm.addClass('modal-notice');
-               var refresh_login_title = String(TYPO3.LLL.core.refresh_login_title).replace('%s', TYPO3.configuration.username);
+               var refresh_login_title = String(TYPO3.lang['mess.refresh_login_title']).replace('%s', TYPO3.configuration.username);
                LoginRefresh.$loginForm.find('.modal-header h4').text(refresh_login_title);
                LoginRefresh.$loginForm.find('.modal-body').append(
-                       $('<p />').text(TYPO3.LLL.core.login_expired),
+                       $('<p />').text(TYPO3.lang['mess.login_expired']),
                        $('<form />', {id: 'beLoginRefresh', method: 'POST', action: TYPO3.settings.ajaxUrls['login']}).append(
                                $('<div />', {class: 'form-group'}).append(
-                                       $('<input />', {type: 'password', name: 'p_field', autofocus: 'autofocus', class: 'form-control', placeholder: TYPO3.LLL.core.refresh_login_password, 'data-rsa-encryption': 't3-loginrefres-userident'})
+                                       $('<input />', {type: 'password', name: 'p_field', autofocus: 'autofocus', class: 'form-control', placeholder: TYPO3.lang['mess.refresh_login_password'], 'data-rsa-encryption': 't3-loginrefres-userident'})
                                ),
                                $('<input />', {type: 'hidden', name: 'username', value: TYPO3.configuration.username}),
                                $('<input />', {type: 'hidden', name: 'userident', id: 't3-loginrefres-userident'})
                        )
                );
                LoginRefresh.$loginForm.find('.modal-footer').append(
-                       $('<a />', {href: LoginRefresh.logoutUrl, class: 'btn btn-default'}).text(TYPO3.LLL.core.refresh_exit_button),
+                       $('<a />', {href: LoginRefresh.logoutUrl, class: 'btn btn-default'}).text(TYPO3.lang['mess.refresh_exit_button']),
                        $('<button />', {type: 'button', class: 'btn btn-primary', 'data-action': 'refreshSession'})
-                               .text(TYPO3.LLL.core.refresh_login_button)
+                               .text(TYPO3.lang['mess.refresh_login_button'])
                                .on('click', function(e) {
                                        LoginRefresh.$loginForm.find('form').submit();
                                })
@@ -343,7 +343,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Notification', 'bootstrap'], function($, Ty
                        passwordFieldValue = $passwordField.val();
 
                if (passwordFieldValue === '' && $useridentField.val() === '') {
-                       Typo3Notification.error(TYPO3.LLL.core.refresh_login_failed, TYPO3.LLL.core.refresh_login_emptyPassword);
+                       Typo3Notification.error(TYPO3.lang['mess.refresh_login_failed'], TYPO3.lang['mess.refresh_login_emptyPassword']);
                        $passwordField.focus();
                        return;
                }
@@ -369,7 +369,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Notification', 'bootstrap'], function($, Ty
                                        // User is logged in
                                        LoginRefresh.hideLoginForm();
                                } else {
-                                       Typo3Notification.error(TYPO3.LLL.core.refresh_login_failed, TYPO3.LLL.core.refresh_login_failed_message);
+                                       Typo3Notification.error(TYPO3.lang['mess.refresh_login_failed'], TYPO3.lang['mess.refresh_login_failed_message']);
                                        $passwordField.focus();
                                }
                        }