From 3c98264f82f539680de2c2a48d6b2a16a4599bc9 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 6 Nov 2023 16:28:32 +1300 Subject: [PATCH 1/2] TLN Update translations --- lang/en.yml | 1 + lang/nl.yml | 25 ++++++++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/lang/en.yml b/lang/en.yml index 9eecf2ddc..d6b088bcd 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -40,6 +40,7 @@ en: CURRENT_PASSWORD_MISSING: 'You must enter your current password.' LOGGED_IN_ERROR: 'You must be logged in to change your password.' MAXIMUM: 'Passwords must be at most {max} characters long.' + RANDOM_IF_EMPTY: 'If this is left blank then a random password will be automatically generated.' SHOWONCLICKTITLE: 'Change Password' SilverStripe\Forms\DateField: NOTSET: 'not set' diff --git a/lang/nl.yml b/lang/nl.yml index 5bd9dbcaf..b8f8c4352 100644 --- a/lang/nl.yml +++ b/lang/nl.yml @@ -13,9 +13,9 @@ nl: HELLO: Hallo SilverStripe\Control\Email\ForgotPasswordEmail_ss: HELLO: Hallo - TEXT1: 'Je hebt aangegeven je wachtwoord te zijn vergeten. Klik op de' - TEXT2: 'onderstaande link' - TEXT3: 'om je wachtwoord opnieuw in te stellen voor ' + TEXT1: 'Je hebt aangegeven je wachtwoord te zijn vergeten. Klik op de knop ' + TEXT2: 'herstel wachtwoord' + TEXT3: ', om je wachtwoord opnieuw in te stellen voor ' SilverStripe\Control\Middleware\ConfirmationMiddleware\GetParameter: CONFIRMATION_NAME: '"{key}" GET parameter' SilverStripe\Control\Middleware\ConfirmationMiddleware\Url: @@ -151,6 +151,8 @@ nl: one: 'Data object' other: '{count} Data objecten' SINGULARNAME: 'Data object' + many_many_FileTracking: 'Bestanden volgen' + many_many_LinkTracking: 'Links volgen' SilverStripe\ORM\FieldType\DBBoolean: ANY: Elke NOANSWER: Nee @@ -236,11 +238,20 @@ nl: SINGULARNAME: Groep Sort: Sorteer-richting ValidationIdentifierAlreadyExists: 'Er bestaat al een groep ({group}) met eenzelfde {identifier}' + db_AccessAllSubsites: 'Toegang tot alle subsites' + db_Code: Code + db_DN: DN db_Description: Omschrijving + db_GUID: GUID + db_HtmlEditorConfig: 'HTML editor config' + db_LastSynced: 'Laatst gesynchroniseerd' + db_Locked: Vergrendeld db_Sort: Volgorde db_Title: Titel has_many_Groups: Groepen + has_many_LDAPGroupMappings: 'LDAP group mappings' has_many_Permissions: Rechten + has_one_Parent: Bovenliggende many_many_Members: Leden many_many_Roles: Rollen many_many_Subsites: Subsites @@ -254,6 +265,7 @@ nl: other: '{count} inlogpogingen' SINGULARNAME: Inlogpogingen Status: Status + db_IP: IP db_Status: Status has_one_Member: Lid SilverStripe\Security\Member: @@ -286,6 +298,7 @@ nl: PLURALS: one: 'Een lid' other: '{count} leden' + RequiresPasswordChangeOnNextLogin: 'Vereist wachtwoordwijziging bij volgende aanmelding' SINGULARNAME: Lid SUBJECTPASSWORDCHANGED: 'Je wachtwoord is aangepast' SUBJECTPASSWORDRESET: 'Je wachtwoord opnieuw instellen' @@ -296,8 +309,11 @@ nl: WELCOMEBACK: 'Welkom terug, {firstname}' YOUROLDPASSWORD: 'Je oude wachtwoord' belongs_many_many_Groups: Groepen + db_AccountResetExpired: 'Het opnieuw instellen van het account is verlopen' db_Email: E-mail db_FirstName: Voornaam + db_GUID: GUID + db_LastSynced: 'Laatst gesynchroniseerd' db_Locale: 'Interface taal' db_LockedOutUntil: 'Gesloten tot' db_Password: Wachtwoord @@ -339,6 +355,7 @@ nl: other: '{count} rechten' SINGULARNAME: Machtiging UserPermissionsIntro: 'Groepen aan deze gebruiker toewijzen zullen diens permissies aanpassen. Zie de sectie Groepen voor meer informatie over machtigingen voor afzonderlijke groepen.' + db_Code: Code db_Type: 'Soort veld' has_one_Group: Groep SilverStripe\Security\PermissionCheckboxSetField: @@ -364,6 +381,7 @@ nl: other: '{count} permissiecodes' PermsError: 'U moet (ADMIN) rechten hebben om de code "{code}" toe te kennen' SINGULARNAME: Permissiecode + db_Code: Code has_one_Role: Rol SilverStripe\Security\RememberLoginHash: PLURALNAME: 'Versleutelde logins' @@ -371,6 +389,7 @@ nl: one: 'Een versleutelde login' other: '{count} loginsleutels' SINGULARNAME: Loginsleutel + has_one_LoginSession: inlogsessie has_one_Member: Lid SilverStripe\Security\Security: ALREADYLOGGEDIN: 'U hebt geen toegang tot deze pagina. Als u een andere account met de nodige rechten hebt, kan u hieronder opnieuw inloggen.' From d883719c16075412640e623557a2df4275965de1 Mon Sep 17 00:00:00 2001 From: Sabina Talipova Date: Tue, 31 Oct 2023 14:11:06 +1300 Subject: [PATCH 2/2] FIX ModelAdmin toast elements --- lang/en.yml | 4 +++- .../GridFieldDetailForm_ItemRequest.php | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lang/en.yml b/lang/en.yml index d6b088bcd..da8ebaa01 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -103,7 +103,7 @@ en: Create: Create Delete: Delete DeletePermissionsFailure: 'No delete permissions' - Deleted: 'Deleted {type} {name}' + Deleted: 'Deleted {type} "{name}"' Save: Save Saved: 'Saved {name} {link}' SilverStripe\Forms\GridField\GridFieldDetailForm_ItemRequest: @@ -112,6 +112,8 @@ en: NEXT: 'Go to next record' PREVIOUS: 'Go to previous record' ViewPermissionsFailure: 'It seems you don''t have the necessary permissions to view "{ObjectTitle}"' + SAVETOASTMESSAGE: 'Saved {type} "{title}" successfully.' + SAVEDUP: 'Saved successfully.' SilverStripe\Forms\GridField\GridFieldEditButton: EDIT: Edit SilverStripe\Forms\GridField\GridFieldFilterHeader: diff --git a/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php b/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php index fef944f0c..43ddd6bb3 100644 --- a/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php +++ b/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php @@ -8,6 +8,7 @@ use SilverStripe\Control\Controller; use SilverStripe\Control\HTTPRequest; use SilverStripe\Control\HTTPResponse; use SilverStripe\Control\RequestHandler; +use SilverStripe\Core\Convert; use SilverStripe\Forms\CompositeField; use SilverStripe\Forms\FieldList; use SilverStripe\Forms\Form; @@ -543,6 +544,18 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler $form->sessionMessage($message, 'good', ValidationResult::CAST_HTML); + $message = _t( + __CLASS__ . '.SAVETOASTMESSAGE', + 'Saved {type} "{title}" successfully.', + [ + 'type' => $this->record->i18n_singular_name(), + 'title' => Convert::raw2xml($this->record->Title) + ] + ); + + $controller = $this->getToplevelController(); + $controller->getResponse()->addHeader('X-Status', $message); + // Redirect after save return $this->redirectAfterSave($isNewRecord); } @@ -706,6 +719,8 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler } elseif ($this->gridField->getList()->byID($this->record->ID)) { // Return new view, as we can't do a "virtual redirect" via the CMS Ajax // to the same URL (it assumes that its content is already current, and doesn't reload) + $message = $controller->getResponse()->getHeader('X-Status') ?? rawurlencode(_t(__CLASS__ . '.SAVEDUP', 'Saved successfully') ?? ''); + $controller->getResponse()->addHeader('X-Status', $message); return $this->edit($controller->getRequest()); } else { // We might be able to redirect to open the record in a different view @@ -782,7 +797,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler $message = _t( 'SilverStripe\\Forms\\GridField\\GridFieldDetailForm.Deleted', - 'Deleted {type} {name}', + 'Deleted {type} "{name}"', [ 'type' => $this->record->i18n_singular_name(), 'name' => htmlspecialchars($title ?? '', ENT_QUOTES) @@ -800,6 +815,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler //when an item is deleted, redirect to the parent controller $controller = $this->getToplevelController(); $controller->getRequest()->addHeader('X-Pjax', 'Content'); // Force a content refresh + $controller->getResponse()->addHeader('X-Status', $message); return $controller->redirect($this->getBackLink(), 302); //redirect back to admin section }