From aef64cd7ccf99c5df3f92e11dd2d5868658ad33f Mon Sep 17 00:00:00 2001 From: Ludy Date: Fri, 2 May 2025 17:00:12 +0200 Subject: [PATCH 1/3] Validate H2 Database Type and URL Consistency for Custom Databases (#3458) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Description of Changes Please provide a summary of the changes, including: - **What was changed** Introduced a local `isCustomDatabase` flag (based on `datasource.isEnableCustomDatabase()`) to ensure that the H2-specific URL/type consistency checks (and corresponding warnings/exceptions) only run when a custom database configuration is enabled. Refactored the return statement to use this flag (`return !isCustomDatabase || isH2;`) instead of calling `isEnableCustomDatabase()` directly. - **Why the change was made** Previously, even when custom database support was disabled, the method would still validate H2 configuration and potentially throw an `IllegalStateException`. By guarding those checks, we avoid spurious warnings or exceptions in default (non-custom) setups and make the method’s behavior more predictable. --- ## 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) - [ ] 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) - [ ] 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. --- .../security/database/DatabaseService.java | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/main/java/stirling/software/SPDF/config/security/database/DatabaseService.java b/src/main/java/stirling/software/SPDF/config/security/database/DatabaseService.java index 04b470f92..27e9ae7b1 100644 --- a/src/main/java/stirling/software/SPDF/config/security/database/DatabaseService.java +++ b/src/main/java/stirling/software/SPDF/config/security/database/DatabaseService.java @@ -246,26 +246,28 @@ public class DatabaseService implements DatabaseInterface { boolean isDBUrlH2 = datasource.getCustomDatabaseUrl().contains("h2") || datasource.getCustomDatabaseUrl().contains("H2"); + boolean isCustomDatabase = datasource.isEnableCustomDatabase(); - if (isTypeH2 && !isDBUrlH2) { - log.warn( - "Datasource type is H2, but the URL does not contain 'h2'. " - + "Please check your configuration."); - throw new IllegalStateException( - "Datasource type is H2, but the URL does not contain 'h2'. Please check your" - + " configuration."); - } else if (!isTypeH2 && isDBUrlH2) { - log.warn( - "Datasource URL contains 'h2', but the type is not H2. " - + "Please check your configuration."); - throw new IllegalStateException( - "Datasource URL contains 'h2', but the type is not H2. Please check your" - + " configuration."); + if (isCustomDatabase) { + if (isTypeH2 && !isDBUrlH2) { + log.warn( + "Datasource type is H2, but the URL does not contain 'h2'. " + + "Please check your configuration."); + throw new IllegalStateException( + "Datasource type is H2, but the URL does not contain 'h2'. Please check" + + " your configuration."); + } else if (!isTypeH2 && isDBUrlH2) { + log.warn( + "Datasource URL contains 'h2', but the type is not H2. " + + "Please check your configuration."); + throw new IllegalStateException( + "Datasource URL contains 'h2', but the type is not H2. Please check your" + + " configuration."); + } } - boolean isH2 = isTypeH2 && isDBUrlH2; - return !datasource.isEnableCustomDatabase() || isH2; + return !isCustomDatabase || isH2; } /** From 47bfab896d2b59af65d18fa408764c7812f1cf97 Mon Sep 17 00:00:00 2001 From: albanobattistella <34811668+albanobattistella@users.noreply.github.com> Date: Fri, 2 May 2025 17:00:42 +0200 Subject: [PATCH 2/3] Update messages_it_IT.properties (#3456) # Description of Changes Please provide a summary of the changes, including: - What was changed - Why the change was made - Any challenges encountered Closes #(issue_number) --- ## Checklist ### General - [ ] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [ ] 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) - [ ] I have performed a self-review of my own code - [ ] 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) - [ ] 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. --- src/main/resources/messages_it_IT.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/messages_it_IT.properties b/src/main/resources/messages_it_IT.properties index 3c654ddb5..9e2a54af4 100644 --- a/src/main/resources/messages_it_IT.properties +++ b/src/main/resources/messages_it_IT.properties @@ -609,7 +609,7 @@ login.userIsDisabled=L'utente è disattivato, l'accesso è attualmente bloccato login.alreadyLoggedIn=Hai già effettuato l'accesso a login.alreadyLoggedIn2=dispositivi. Esci dai dispositivi e riprova. login.toManySessions=Hai troppe sessioni attive -login.logoutMessage=You have been logged out. +login.logoutMessage=Sei stato disconnesso. #auto-redact autoRedact.title=Redazione automatica From 8516ad154318b014cfab14f29e8687701b5b255e Mon Sep 17 00:00:00 2001 From: "stirlingbot[bot]" <195170888+stirlingbot[bot]@users.noreply.github.com> Date: Fri, 2 May 2025 16:23:18 +0100 Subject: [PATCH 3/3] :globe_with_meridians: Sync Translations + Update README Progress Table (#3461) ### Description of Changes This Pull Request was automatically generated to synchronize updates to translation files and documentation. Below are the details of the changes made: #### **1. Synchronization of Translation Files** - Updated translation files (`messages_*.properties`) to reflect changes in the reference file `messages_en_GB.properties`. - Ensured consistency and synchronization across all supported language files. - Highlighted any missing or incomplete translations. #### **2. Update README.md** - Generated the translation progress table in `README.md`. - Added a summary of the current translation status for all supported languages. - Included up-to-date statistics on translation coverage. #### **Why these changes are necessary** - Keeps translation files aligned with the latest reference updates. - Ensures the documentation reflects the current translation progress. --- Auto-generated by [create-pull-request][1]. [1]: https://github.com/peter-evans/create-pull-request Co-authored-by: stirlingbot[bot] <195170888+stirlingbot[bot]@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d4be314e3..e642dd8b4 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ Stirling-PDF currently supports 39 languages! | Hungarian (Magyar) (hu_HU) | ![99%](https://geps.dev/progress/99) | | Indonesian (Bahasa Indonesia) (id_ID) | ![80%](https://geps.dev/progress/80) | | Irish (Gaeilge) (ga_IE) | ![91%](https://geps.dev/progress/91) | -| Italian (Italiano) (it_IT) | ![98%](https://geps.dev/progress/98) | +| Italian (Italiano) (it_IT) | ![99%](https://geps.dev/progress/99) | | Japanese (日本語) (ja_JP) | ![93%](https://geps.dev/progress/93) | | Korean (한국어) (ko_KR) | ![92%](https://geps.dev/progress/92) | | Norwegian (Norsk) (no_NB) | ![86%](https://geps.dev/progress/86) |