[!!!][TASK] Streamline felogin locallang keys 41/61241/4
authorJan Stockfisch <typo3@jan-stockfisch.de>
Tue, 9 Jul 2019 10:43:40 +0000 (12:43 +0200)
committerBenni Mack <benni@typo3.org>
Tue, 9 Jul 2019 13:18:07 +0000 (15:18 +0200)
Resolves: #88706
Releases: master
Change-Id: Ic32c33947c18adc9d4547c8ab7582e40c8474a69
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61241
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Jörg Bösche <typo3@joergboesche.de>
Tested-by: Henning Liebe <h.liebe@neusta.de>
Tested-by: Tobi Kretschmann <tobi@tobishome.de>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Steffen Frese <steffenf14@gmail.com>
Reviewed-by: Jörg Bösche <typo3@joergboesche.de>
Reviewed-by: Henning Liebe <h.liebe@neusta.de>
Reviewed-by: Tobi Kretschmann <tobi@tobishome.de>
Reviewed-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Breaking-88706-StreamlineFeloginLocallangKeys.rst [new file with mode: 0644]
typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php
typo3/sysext/felogin/Resources/Private/Language/locallang.xlf

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-88706-StreamlineFeloginLocallangKeys.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-88706-StreamlineFeloginLocallangKeys.rst
new file mode 100644 (file)
index 0000000..b9cb964
--- /dev/null
@@ -0,0 +1,63 @@
+.. include:: ../../Includes.txt
+
+====================================================
+Breaking: #88706 - Streamline felogin locallang keys
+====================================================
+
+See :issue:`88706`
+
+Description
+===========
+
+Remove  `ll_` prefixes from translation keys in :file:`ext:felogin/Resources/private/Language/locallang.xlf` so that they share the same identifiers with the flexform settings.
+
+
+Impact
+======
+
+Breaks installations that override ext:felogin language keys that are prefixed with `ll_`.
+
+
+Affected Installations
+======================
+
+Only installations that override one of the following keys via TypoScript are affected.
+
+Keys:
+
+- `ll_welcome_header`
+- `ll_welcome_message`
+- `ll_logout_header`
+- `ll_logout_message`
+- `ll_error_header`
+- `ll_error_message`
+- `ll_success_header`
+- `ll_success_message`
+- `ll_status_header`
+- `ll_status_message`
+- `ll_change_password_header`
+- `ll_change_password_message`
+- `ll_change_password_nolinkprefix_message`
+- `ll_change_password_notvalid_message`
+- `ll_change_password_notequal_message`
+- `ll_change_password_tooshort_message`
+- `ll_change_password_done_message`
+- `ll_forgot_header`
+- `ll_forgot_email_password`
+- `ll_forgot_email_nopassword`
+- `ll_forgot_validate_reset_password`
+- `ll_forgot_message`
+- `ll_forgot_message_emailSent`
+- `ll_forgot_reset_message`
+- `ll_forgot_reset_message_emailSent`
+- `ll_forgot_reset_message_error`
+- `ll_forgot_header_backToLogin`
+- `ll_enter_your_data`
+
+
+Migration
+=========
+
+Remove the corresponding `ll_` from the key.
+
+.. index:: Frontend, NotScanned, ext:felogin
index 490ae83..bd3a8f1 100644 (file)
@@ -266,14 +266,14 @@ class FrontendLoginController extends AbstractPlugin
                     // Generate an email with the hashed link
                     $error = $this->generateAndSendHash($row);
                 } elseif ($this->conf['exposeNonexistentUserInForgotPasswordDialog']) {
-                    $error = $this->pi_getLL('ll_forgot_reset_message_error');
+                    $error = $this->pi_getLL('forgot_reset_message_error');
                 }
                 // Generate message
                 if ($error) {
                     $markerArray['###STATUS_MESSAGE###'] = $this->cObj->stdWrap($error, $this->conf['forgotErrorMessage_stdWrap.']);
                 } else {
                     $markerArray['###STATUS_MESSAGE###'] = $this->cObj->stdWrap(
-                        $this->pi_getLL('ll_forgot_reset_message_emailSent'),
+                        $this->pi_getLL('forgot_reset_message_emailSent'),
                         $this->conf['forgotResetMessageEmailSentMessage_stdWrap.']
                     );
                 }
@@ -287,7 +287,7 @@ class FrontendLoginController extends AbstractPlugin
             $markerArray['###STATUS_MESSAGE###'] = $this->getDisplayText('forgot_reset_message', $this->conf['forgotMessage_stdWrap.']);
             $markerArray['###BACKLINK_LOGIN###'] = '';
         }
-        $markerArray['###BACKLINK_LOGIN###'] = $this->getPageLink(htmlspecialchars($this->pi_getLL('ll_forgot_header_backToLogin')), []);
+        $markerArray['###BACKLINK_LOGIN###'] = $this->getPageLink(htmlspecialchars($this->pi_getLL('forgot_header_backToLogin')), []);
         $markerArray['###STATUS_HEADER###'] = $this->getDisplayText('forgot_header', $this->conf['forgotHeader_stdWrap.']);
         $markerArray['###LEGEND###'] = htmlspecialchars($this->pi_getLL('legend', $this->pi_getLL('reset_password')));
         $markerArray['###ACTION_URI###'] = $this->getPageLink('', [$this->prefixId . '[forgot]' => 1], true);
@@ -295,7 +295,7 @@ class FrontendLoginController extends AbstractPlugin
         $markerArray['###FORGOT_PASSWORD_ENTEREMAIL###'] = htmlspecialchars($this->pi_getLL('forgot_password_enterEmail'));
         $markerArray['###FORGOT_EMAIL###'] = $this->prefixId . '[forgot_email]';
         $markerArray['###SEND_PASSWORD###'] = htmlspecialchars($this->pi_getLL('reset_password'));
-        $markerArray['###DATA_LABEL###'] = htmlspecialchars($this->pi_getLL('ll_enter_your_data'));
+        $markerArray['###DATA_LABEL###'] = htmlspecialchars($this->pi_getLL('enter_your_data'));
         $markerArray = array_merge($markerArray, $this->getUserFieldMarkers());
         // Generate hash
         $hash = md5($this->generatePassword(3));
@@ -417,7 +417,7 @@ class FrontendLoginController extends AbstractPlugin
                             $done = true;
                             $subpartArray['###CHANGEPASSWORD_FORM###'] = '';
                             $markerArray['###BACKLINK_LOGIN###'] = $this->getPageLink(
-                                htmlspecialchars($this->pi_getLL('ll_forgot_header_backToLogin')),
+                                htmlspecialchars($this->pi_getLL('forgot_header_backToLogin')),
                                 [$this->prefixId . '[redirectReferrer]' => 'off']
                             );
                         }
@@ -499,9 +499,9 @@ class FrontendLoginController extends AbstractPlugin
             $link = $this->frontendController->baseUrlWrap($link);
         } else {
             // No prefix is set, return the error
-            return $this->pi_getLL('ll_change_password_nolinkprefix_message');
+            return $this->pi_getLL('change_password_nolinkprefix_message');
         }
-        $msg = sprintf($this->pi_getLL('ll_forgot_validate_reset_password'), $user['username'], $link, $validEndString);
+        $msg = sprintf($this->pi_getLL('forgot_validate_reset_password'), $user['username'], $link, $validEndString);
         // Add hook for extra processing of mail message
         $params = [
             'message' => &$msg,
@@ -652,7 +652,7 @@ class FrontendLoginController extends AbstractPlugin
         $markerArray = array_merge($markerArray, $this->getUserFieldMarkers());
         if ($this->conf['showForgotPasswordLink']) {
             $linkpartArray['###FORGOT_PASSWORD_LINK###'] = explode('|', $this->getPageLink('|', [$this->prefixId . '[forgot]' => 1]));
-            $markerArray['###FORGOT_PASSWORD###'] = htmlspecialchars($this->pi_getLL('ll_forgot_header'));
+            $markerArray['###FORGOT_PASSWORD###'] = htmlspecialchars($this->pi_getLL('forgot_header'));
         } else {
             $subpartArray['###FORGOTP_VALID###'] = '';
         }
@@ -996,7 +996,7 @@ class FrontendLoginController extends AbstractPlugin
      */
     protected function getDisplayText($label, $stdWrapArray = [])
     {
-        $text = $this->flexFormValue($label, 's_messages') ? $this->cObj->stdWrap($this->flexFormValue($label, 's_messages'), $stdWrapArray) : $this->cObj->stdWrap($this->pi_getLL('ll_' . $label), $stdWrapArray);
+        $text = $this->flexFormValue($label, 's_messages') ? $this->cObj->stdWrap($this->flexFormValue($label, 's_messages'), $stdWrapArray) : $this->cObj->stdWrap($this->pi_getLL($label), $stdWrapArray);
         $replace = $this->getUserFieldMarkers();
         return strtr($text, $replace);
     }
index 92b9b49..6c419fc 100644 (file)
@@ -3,36 +3,36 @@
        <file t3:id="1415814821" source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:32Z" product-name="felogin">
                <header/>
                <body>
-                       <trans-unit id="ll_welcome_header">
+                       <trans-unit id="welcome_header">
                                <source>User login</source>
                        </trans-unit>
-                       <trans-unit id="ll_welcome_message">
+                       <trans-unit id="welcome_message">
                                <source>Enter your username and password here in order to log in on the website</source>
                        </trans-unit>
-                       <trans-unit id="ll_logout_header">
+                       <trans-unit id="logout_header">
                                <source>You have logged out.</source>
                        </trans-unit>
-                       <trans-unit id="ll_logout_message">
+                       <trans-unit id="logout_message">
                                <source>You just logged out from your user session on this website. You can login again or as another user by the form below.</source>
                        </trans-unit>
-                       <trans-unit id="ll_error_header">
+                       <trans-unit id="error_header">
                                <source>Login failure</source>
                        </trans-unit>
-                       <trans-unit id="ll_error_message" xml:space="preserve">
+                       <trans-unit id="error_message" xml:space="preserve">
                                <source>An error occurred during login. Most likely you didn't enter the username or password correctly.
 Be certain that you enter them precisely as they are, including upper/lower case.
 Another possibility is that cookies might be disabled in your web browser.</source>
                        </trans-unit>
-                       <trans-unit id="ll_success_header">
+                       <trans-unit id="success_header">
                                <source>Login successful</source>
                        </trans-unit>
-                       <trans-unit id="ll_success_message">
+                       <trans-unit id="success_message">
                                <source>You are now logged in as '###USER###'</source>
                        </trans-unit>
-                       <trans-unit id="ll_status_header">
+                       <trans-unit id="status_header">
                                <source>Current status</source>
                        </trans-unit>
-                       <trans-unit id="ll_status_message">
+                       <trans-unit id="status_message">
                                <source>This is your current status</source>
                        </trans-unit>
                        <trans-unit id="cookie_warning">
@@ -59,25 +59,25 @@ Another possibility is that cookies might be disabled in your web browser.</sour
                        <trans-unit id="reset_password">
                                <source>Reset Password</source>
                        </trans-unit>
-                       <trans-unit id="ll_change_password_header">
+                       <trans-unit id="change_password_header">
                                <source>Change your password</source>
                        </trans-unit>
-                       <trans-unit id="ll_change_password_message">
+                       <trans-unit id="change_password_message">
                                <source>Please enter your new password twice. Password needs a minimum length of %s chars.</source>
                        </trans-unit>
-                       <trans-unit id="ll_change_password_nolinkprefix_message">
+                       <trans-unit id="change_password_nolinkprefix_message">
                                <source>Error: there is no prefix for the link. Please set one of the following in your typoscript template: plugin.tx_felogin_pi1.feloginBaseURL = http://yourdomain/, config.baseURL = http://yourdomain/, config.absRefPrefix = /</source>
                        </trans-unit>
-                       <trans-unit id="ll_change_password_notvalid_message">
+                       <trans-unit id="change_password_notvalid_message">
                                <source>The link you clicked is not valid. Please repeat the forgot password procedure.</source>
                        </trans-unit>
-                       <trans-unit id="ll_change_password_notequal_message">
+                       <trans-unit id="change_password_notequal_message">
                                <source>The passwords are not equal, please enter your new password twice. Password needs a minimum length of %s chars.</source>
                        </trans-unit>
-                       <trans-unit id="ll_change_password_tooshort_message">
+                       <trans-unit id="change_password_tooshort_message">
                                <source>The password length is too short. Please enter your new password twice. Password needs a minimum length of %s chars.</source>
                        </trans-unit>
-                       <trans-unit id="ll_change_password_done_message">
+                       <trans-unit id="change_password_done_message">
                                <source>Your password has been saved. You can now login with your new password.</source>
                        </trans-unit>
                        <trans-unit id="change_password">
@@ -92,23 +92,23 @@ Another possibility is that cookies might be disabled in your web browser.</sour
                        <trans-unit id="your_email">
                                <source>Your email</source>
                        </trans-unit>
-                       <trans-unit id="ll_forgot_header">
+                       <trans-unit id="forgot_header">
                                <source>Forgot your password?</source>
                        </trans-unit>
-                       <trans-unit id="ll_forgot_email_password" xml:space="preserve">
+                       <trans-unit id="forgot_email_password" xml:space="preserve">
                                <source>Your password
 Hi %s
 
 Your username is "%s"
 Your password is "%s"</source>
                        </trans-unit>
-                       <trans-unit id="ll_forgot_email_nopassword" xml:space="preserve">
+                       <trans-unit id="forgot_email_nopassword" xml:space="preserve">
                                <source>Your password
 Hi %s
 
 We couldn't find a username for this email address and so cannot send the password to you. Probably you misspelled the email address (upper/lower case makes a difference) or maybe you even didn't register yet?</source>
                        </trans-unit>
-                       <trans-unit id="ll_forgot_validate_reset_password" xml:space="preserve">
+                       <trans-unit id="forgot_validate_reset_password" xml:space="preserve">
                                <source>Your new password
 Dear %s,
 
@@ -117,25 +117,25 @@ This email was sent in response to your request to reset your password. Please c
 
 For security reasons, this link is only active until %s. If you do not visit the link before then, you will need to repeat the password reset steps.</source>
                        </trans-unit>
-                       <trans-unit id="ll_forgot_message">
+                       <trans-unit id="forgot_message">
                                <source>Please enter the email address by which you registered your user account. Then press "Send password" and your password will immediately be emailed to you. Make sure to spell your email address correctly.</source>
                        </trans-unit>
-                       <trans-unit id="ll_forgot_message_emailSent">
+                       <trans-unit id="forgot_message_emailSent">
                                <source>Your password has now been sent to the email address %s</source>
                        </trans-unit>
-                       <trans-unit id="ll_forgot_reset_message">
+                       <trans-unit id="forgot_reset_message">
                                <source>Please enter your username or email address. Instructions for resetting the password will be immediately emailed to you.</source>
                        </trans-unit>
-                       <trans-unit id="ll_forgot_reset_message_emailSent">
+                       <trans-unit id="forgot_reset_message_emailSent">
                                <source>An email has been sent to the address stored in your account and contains a link to reset your password. If you do not receive an email, your account or email address was not found.</source>
                        </trans-unit>
-                       <trans-unit id="ll_forgot_reset_message_error">
+                       <trans-unit id="forgot_reset_message_error">
                                <source>Your account or email address does not exist.</source>
                        </trans-unit>
-                       <trans-unit id="ll_forgot_header_backToLogin">
+                       <trans-unit id="forgot_header_backToLogin">
                                <source>Return to login form</source>
                        </trans-unit>
-                       <trans-unit id="ll_enter_your_data">
+                       <trans-unit id="enter_your_data">
                                <source>Username or email address</source>
                        </trans-unit>
                </body>