Internationalize logout message (#3450)

# Description of Changes

Please provide a summary of the changes, including:

- **What was changed**  
- Controller now uses the `login.logoutMessage` i18n key instead of
hard-coded text.
- Added `login.logoutMessage` entry to `messages_de_DE.properties` and
`messages_en_GB.properties`.
- Updated `login.html` to resolve the logout message via
`th:text="#{…}"`.

- **Why the change was made**  
  - To support localization for logout feedback.
- To eliminate hard-coded strings from the view layer and rely on
message bundles.

before:


![image](https://github.com/user-attachments/assets/5e9975f6-717f-4035-8e3c-76df8c0275bb)


after:


![image](https://github.com/user-attachments/assets/934f45ad-d490-4a34-9399-5c9031f2db2d)


---

## Checklist

### General

- [x] I have read the [Contribution
Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md)
- [x] I have read the [Stirling-PDF Developer
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md)
(if applicable)
- [ ] I have read the [How to add new languages to
Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md)
(if applicable)
- [x] I have performed a self-review of my own code
- [x] My changes generate no new warnings

### Documentation

- [ ] I have updated relevant docs on [Stirling-PDF's doc
repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/)
(if functionality has heavily changed)
- [ ] I have read the section [Add New Translation
Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags)
(for new translation tags only)

### UI Changes (if applicable)

- [x] Screenshots or videos demonstrating the UI changes are attached
(e.g., as comments or direct attachments in the PR)

### Testing (if applicable)

- [ ] I have tested my changes locally. Refer to the [Testing
Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing)
for more details.
This commit is contained in:
Ludy 2025-04-30 10:30:15 +02:00 committed by GitHub
parent 4b86703082
commit 1377aa4f8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 3 deletions

View File

@ -191,7 +191,7 @@ public class AccountWebController {
}
if (request.getParameter("logout") != null) {
model.addAttribute("logoutMessage", "You have been logged out.");
model.addAttribute("logoutMessage", "login.logoutMessage");
}
return "login";

View File

@ -607,6 +607,7 @@ login.userIsDisabled=Benutzer ist deaktiviert, die Anmeldung ist mit diesem Benu
login.alreadyLoggedIn=Sie sind bereits an
login.alreadyLoggedIn2=Geräten angemeldet. Bitte melden Sie sich dort ab und versuchen es dann erneut.
login.toManySessions=Sie haben zu viele aktive Sitzungen
login.logoutMessage=Sie wurden erfolgreich abgemeldet.
#auto-redact
autoRedact.title=Automatisch zensieren/schwärzen

View File

@ -609,6 +609,7 @@ login.userIsDisabled=User is deactivated, login is currently blocked with this u
login.alreadyLoggedIn=You are already logged in to
login.alreadyLoggedIn2=devices. Please log out of the devices and try again.
login.toManySessions=You have too many active sessions
login.logoutMessage=You have been logged out.
#auto-redact
autoRedact.title=Auto Redact

View File

@ -112,7 +112,7 @@
<div th:if="${error}" th:text="#{${error}}">OAuth2: Error Message</div>
</div>
<div class="text-danger text-center">
<div th:if="${logoutMessage}" class="alert alert-success" th:text="${logoutMessage}"></div>
<div th:if="${logoutMessage}" class="alert alert-success" th:text="#{${logoutMessage}}"></div>
<div th:if="${messageType}" class="alert alert-success">
<span th:text="#{${messageType}}">Default message if not found</span>
</div>