From 515b5b1492226a2a953b5dbaf3b0225937d0fbe6 Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Thu, 6 Jun 2024 20:42:50 +0200 Subject: [PATCH 1/4] Minor corrections in the languages --- README.md | 22 ++++++++++---------- scripts/translation_status.toml | 18 ++++++++++++++++ src/main/resources/messages_cs_CZ.properties | 2 +- src/main/resources/messages_de_DE.properties | 10 ++++----- src/main/resources/messages_hr_HR.properties | 20 +++++++++++------- src/main/resources/messages_no_NB.properties | 6 +++--- 6 files changed, 50 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 493c2f2f..a2002414 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ Please view https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToUseOCR ## Supported Languages -Stirling PDF currently supports 28! +Stirling PDF currently supports 32! | Language | Progress | | ------------------------------------------- | -------------------------------------- | @@ -167,15 +167,15 @@ Stirling PDF currently supports 28! | English (US) (en_US) | ![100%](https://geps.dev/progress/100) | | Arabic (العربية) (ar_AR) | ![40%](https://geps.dev/progress/40) | | German (Deutsch) (de_DE) | ![99%](https://geps.dev/progress/99) | -| French (Français) (fr_FR) | ![94%](https://geps.dev/progress/94) | +| French (Français) (fr_FR) | ![93%](https://geps.dev/progress/93) | | Spanish (Español) (es_ES) | ![95%](https://geps.dev/progress/95) | | Simplified Chinese (简体中文) (zh_CN) | ![95%](https://geps.dev/progress/95) | | Traditional Chinese (繁體中文) (zh_TW) | ![94%](https://geps.dev/progress/94) | | Catalan (Català) (ca_CA) | ![49%](https://geps.dev/progress/49) | | Italian (Italiano) (it_IT) | ![98%](https://geps.dev/progress/98) | | Swedish (Svenska) (sv_SE) | ![40%](https://geps.dev/progress/40) | -| Polish (Polski) (pl_PL) | ![43%](https://geps.dev/progress/43) | -| Romanian (Română) (ro_RO) | ![40%](https://geps.dev/progress/40) | +| Polish (Polski) (pl_PL) | ![42%](https://geps.dev/progress/42) | +| Romanian (Română) (ro_RO) | ![39%](https://geps.dev/progress/39) | | Korean (한국어) (ko_KR) | ![87%](https://geps.dev/progress/87) | | Portuguese Brazilian (Português) (pt_BR) | ![61%](https://geps.dev/progress/61) | | Russian (Русский) (ru_RU) | ![87%](https://geps.dev/progress/87) | @@ -183,17 +183,17 @@ Stirling PDF currently supports 28! | Japanese (日本語) (ja_JP) | ![87%](https://geps.dev/progress/87) | | Dutch (Nederlands) (nl_NL) | ![85%](https://geps.dev/progress/85) | | Greek (Ελληνικά) (el_GR) | ![85%](https://geps.dev/progress/85) | -| Turkish (Türkçe) (tr_TR) | ![98%](https://geps.dev/progress/98) | -| Indonesia (Bahasa Indonesia) (id_ID) | ![79%](https://geps.dev/progress/79) | +| Turkish (Türkçe) (tr_TR) | ![97%](https://geps.dev/progress/97) | +| Indonesia (Bahasa Indonesia) (id_ID) | ![78%](https://geps.dev/progress/78) | | Hindi (हिंदी) (hi_IN) | ![79%](https://geps.dev/progress/79) | | Hungarian (Magyar) (hu_HU) | ![78%](https://geps.dev/progress/78) | | Bulgarian (Български) (bg_BG) | ![98%](https://geps.dev/progress/98) | -| Sebian Latin alphabet (Srpski) (sr_LATN_RS) | ![81%](https://geps.dev/progress/81) | -| Ukrainian (Українська) (uk_UA) | ![87%](https://geps.dev/progress/87) | -| Slovakian (Slovensky) (sk_SK) | ![96%](https://geps.dev/progress/96) | +| Sebian Latin alphabet (Srpski) (sr_LATN_RS) | ![80%](https://geps.dev/progress/80) | +| Ukrainian (Українська) (uk_UA) | ![86%](https://geps.dev/progress/86) | +| Slovakian (Slovensky) (sk_SK) | ![95%](https://geps.dev/progress/95) | | Czech (Česky) (cs_CZ) | ![94%](https://geps.dev/progress/94) | -| Croatian (Hrvatski) (hr_HR) | ![94%](https://geps.dev/progress/94) | -| Norwegian (Norsk) (no_NB) | ![94%](https://geps.dev/progress/94) | +| Croatian (Hrvatski) (hr_HR) | ![98%](https://geps.dev/progress/98) | +| Norwegian (Norsk) (no_NB) | ![98%](https://geps.dev/progress/98) | ## Contributing (creating issues, translations, fixing bugs, etc.) diff --git a/scripts/translation_status.toml b/scripts/translation_status.toml index 633847c9..4a57aaf4 100644 --- a/scripts/translation_status.toml +++ b/scripts/translation_status.toml @@ -15,7 +15,10 @@ ignore = [ [cs_CZ] ignore = [ + 'info', 'language.direction', + 'pipeline.header', + 'text', ] [de_DE] @@ -65,6 +68,16 @@ ignore = [ 'language.direction', ] +[hr_HR] +ignore = [ + 'font', + 'home.pipeline.title', + 'info', + 'language.direction', + 'pdfOrganiser.tags', + 'showJS.tags', +] + [hu_HU] ignore = [ 'language.direction', @@ -103,6 +116,11 @@ ignore = [ 'language.direction', ] +[no_NB] +ignore = [ + 'language.direction', +] + [pl_PL] ignore = [ 'language.direction', diff --git a/src/main/resources/messages_cs_CZ.properties b/src/main/resources/messages_cs_CZ.properties index c382e92d..42539603 100644 --- a/src/main/resources/messages_cs_CZ.properties +++ b/src/main/resources/messages_cs_CZ.properties @@ -26,7 +26,7 @@ bored=Nudíte se při čekání? alphabet=Abeceda downloadPdf=Stáhnout PDF text=Text -font=Font +font=Písmo selectFillter=-- Vyberte -- pageNum=Číslo stránky sizes.small=Malé diff --git a/src/main/resources/messages_de_DE.properties b/src/main/resources/messages_de_DE.properties index 8677a886..bd306345 100644 --- a/src/main/resources/messages_de_DE.properties +++ b/src/main/resources/messages_de_DE.properties @@ -71,7 +71,7 @@ visitGithub=GitHub-Repository besuchen donate=Spenden color=Farbe sponsor=Sponsor -info=Die Info +info=Informationen @@ -660,10 +660,10 @@ certSign.submit=PDF signieren #removeCertSign -removeCertSign.title=Remove Certificate Signature -removeCertSign.header=Remove the digital certificate from the PDF -removeCertSign.selectPDF=Select a PDF file: -removeCertSign.submit=Remove Signature +removeCertSign.title=Zertifikatsignatur entfernen +removeCertSign.header=Digitales Zertifikat aus dem PDF entfernen +removeCertSign.selectPDF=PDF-Datei auswählen: +removeCertSign.submit=Signatur entfernen #removeBlanks diff --git a/src/main/resources/messages_hr_HR.properties b/src/main/resources/messages_hr_HR.properties index c55b9868..e5e4d92f 100644 --- a/src/main/resources/messages_hr_HR.properties +++ b/src/main/resources/messages_hr_HR.properties @@ -1,7 +1,7 @@ ########### # Generic # ########### -# the direction that the language is written (ltr=left to right, rtl = right to left) +# the direction that the language is written (ltr = left to right, rtl = right to left) language.direction=ltr pdfPrompt=Odaberi PDF(ove) @@ -331,9 +331,10 @@ compare.tags=razlikovati,kontrast,izmjene,analiza home.certSign.title=Potpišite s certifikatom home.certSign.desc=Potpisuje PDF s certifikatom/ključem (PEM/P12) certSign.tags=autentifikacija,PEM,P12,zvanično,šifriranje -# home.removeCertSign.title=Remove Certificate Sign -# home.removeCertSign.desc=Remove certificate signature from PDF -# removeCertSign.tags=authenticate,PEM,P12,official,decrypt + +home.removeCertSign.title=Remove Certificate Sign +home.removeCertSign.desc=Remove certificate signature from PDF +removeCertSign.tags=authenticate,PEM,P12,official,decrypt home.pageLayout.title=Izgled s više stranica home.pageLayout.desc=Spojite više stranica PDF dokumenta u jednu stranicu @@ -656,10 +657,13 @@ certSign.reason=Razlog certSign.location=Mjesto certSign.name=Ime certSign.submit=Potpiši PDF -# removeCertSign.title=Remove Certificate Signature -# removeCertSign.header=Remove the digital certificate from the PDF -# removeCertSign.selectPDF=Select a PDF file: -# removeCertSign.submit=Remove Signature + + +#removeCertSign +removeCertSign.title=Remove Certificate Signature +removeCertSign.header=Remove the digital certificate from the PDF +removeCertSign.selectPDF=Select a PDF file: +removeCertSign.submit=Remove Signature #removeBlanks diff --git a/src/main/resources/messages_no_NB.properties b/src/main/resources/messages_no_NB.properties index 37c45e16..cee5c3f9 100644 --- a/src/main/resources/messages_no_NB.properties +++ b/src/main/resources/messages_no_NB.properties @@ -438,7 +438,7 @@ PDFToBook.tags=bok,comic,calibre,konvertere,manga,amazon,kindle,epub,mobi,azw3,d home.BookToPDF.title=Bok til PDF home.BookToPDF.desc=Konverter bøker/tegneserier til PDF ved hjelp av calibre - +BookToPDF.tags=Book,Comic,Calibre,Convert,manga,amazon,kindle,epub,mobi,azw3,docx,rtf,txt,html,lit,fb2,pdb,lrf ########################### @@ -783,7 +783,7 @@ compress.selectText.2=Optimeringsnivå: compress.selectText.3=4 (Dårlig for tekstbilder) compress.selectText.4=Automatisk modus - Justerer automatisk kvaliteten for å få PDF til nøyaktig størrelse compress.selectText.5=Forventet PDF-størrelse (f.eks. 25MB, 10.8MB, 25KB) -compress.Submit=Komprimer +compress.submit=Komprimer #Add image @@ -855,7 +855,7 @@ split.desc.6=Dokument #4: Side 8 split.desc.7=Dokument #5: Side 9 split.desc.8=Dokument #6: Side 10 split.splitPages=Skriv inn sidene som skal deles på: -split.Submit=Del +split.submit=Del #merge From 7d9edfca6d7abced4b51616e29190cbc08d96332 Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Thu, 6 Jun 2024 21:03:06 +0200 Subject: [PATCH 2/4] Enhance OAuth2 Client Registration with Dynamic Provider Details --- .../security/SecurityConfiguration.java | 16 ++++++------ .../CustomOAuth2LogoutSuccessHandler.java | 2 +- .../oauth2/CustomOAuth2UserService.java | 25 ++++++++++++++++--- .../controller/web/AccountWebController.java | 8 +++--- .../SPDF/model/ApplicationProperties.java | 18 +++++++++++-- .../software/SPDF/model/Provider.java | 5 ++++ 6 files changed, 56 insertions(+), 18 deletions(-) diff --git a/src/main/java/stirling/software/SPDF/config/security/SecurityConfiguration.java b/src/main/java/stirling/software/SPDF/config/security/SecurityConfiguration.java index ce6ce799..fad0f285 100644 --- a/src/main/java/stirling/software/SPDF/config/security/SecurityConfiguration.java +++ b/src/main/java/stirling/software/SPDF/config/security/SecurityConfiguration.java @@ -238,7 +238,7 @@ public class SecurityConfiguration { GoogleProvider google = client.getGoogle(); return google != null && google.isSettingsValid() ? Optional.of( - ClientRegistration.withRegistrationId("google") + ClientRegistration.withRegistrationId(google.getName()) .clientId(google.getClientId()) .clientSecret(google.getClientSecret()) .scope(google.getScopes()) @@ -246,8 +246,8 @@ public class SecurityConfiguration { .tokenUri(google.getTokenuri()) .userInfoUri(google.getUserinfouri()) .userNameAttributeName(google.getUseAsUsername()) - .clientName("Google") - .redirectUri("{baseUrl}/login/oauth2/code/google") + .clientName(google.getClientName()) + .redirectUri("{baseUrl}/login/oauth2/code/" + google.getName()) .authorizationGrantType( org.springframework.security.oauth2.core .AuthorizationGrantType.AUTHORIZATION_CODE) @@ -269,12 +269,12 @@ public class SecurityConfiguration { return keycloak != null && keycloak.isSettingsValid() ? Optional.of( ClientRegistrations.fromIssuerLocation(keycloak.getIssuer()) - .registrationId("keycloak") + .registrationId(keycloak.getName()) .clientId(keycloak.getClientId()) .clientSecret(keycloak.getClientSecret()) .scope(keycloak.getScopes()) .userNameAttributeName(keycloak.getUseAsUsername()) - .clientName("Keycloak") + .clientName(keycloak.getClientName()) .build()) : Optional.empty(); } @@ -291,7 +291,7 @@ public class SecurityConfiguration { GithubProvider github = client.getGithub(); return github != null && github.isSettingsValid() ? Optional.of( - ClientRegistration.withRegistrationId("github") + ClientRegistration.withRegistrationId(github.getName()) .clientId(github.getClientId()) .clientSecret(github.getClientSecret()) .scope(github.getScopes()) @@ -299,8 +299,8 @@ public class SecurityConfiguration { .tokenUri(github.getTokenuri()) .userInfoUri(github.getUserinfouri()) .userNameAttributeName(github.getUseAsUsername()) - .clientName("GitHub") - .redirectUri("{baseUrl}/login/oauth2/code/github") + .clientName(github.getClientName()) + .redirectUri("{baseUrl}/login/oauth2/code/" + github.getName()) .authorizationGrantType( org.springframework.security.oauth2.core .AuthorizationGrantType.AUTHORIZATION_CODE) diff --git a/src/main/java/stirling/software/SPDF/config/security/oauth2/CustomOAuth2LogoutSuccessHandler.java b/src/main/java/stirling/software/SPDF/config/security/oauth2/CustomOAuth2LogoutSuccessHandler.java index e209d0cd..9b12b279 100644 --- a/src/main/java/stirling/software/SPDF/config/security/oauth2/CustomOAuth2LogoutSuccessHandler.java +++ b/src/main/java/stirling/software/SPDF/config/security/oauth2/CustomOAuth2LogoutSuccessHandler.java @@ -81,7 +81,7 @@ public class CustomOAuth2LogoutSuccessHandler extends SimpleUrlLogoutSuccessHand logger.info("Session invalidated: " + sessionId); } - switch (registrationId) { + switch (registrationId.toLowerCase()) { case "keycloak": // Add Keycloak specific logout URL if needed String logoutUrl = diff --git a/src/main/java/stirling/software/SPDF/config/security/oauth2/CustomOAuth2UserService.java b/src/main/java/stirling/software/SPDF/config/security/oauth2/CustomOAuth2UserService.java index a5d65ff0..b9766480 100644 --- a/src/main/java/stirling/software/SPDF/config/security/oauth2/CustomOAuth2UserService.java +++ b/src/main/java/stirling/software/SPDF/config/security/oauth2/CustomOAuth2UserService.java @@ -16,6 +16,8 @@ import org.springframework.security.oauth2.core.oidc.user.OidcUser; import stirling.software.SPDF.config.security.LoginAttemptService; import stirling.software.SPDF.config.security.UserService; import stirling.software.SPDF.model.ApplicationProperties; +import stirling.software.SPDF.model.ApplicationProperties.Security.OAUTH2; +import stirling.software.SPDF.model.ApplicationProperties.Security.OAUTH2.Client; import stirling.software.SPDF.model.User; public class CustomOAuth2UserService implements OAuth2UserService { @@ -41,11 +43,27 @@ public class CustomOAuth2UserService implements OAuth2UserService duser = userService.findByUsernameIgnoreCase(username); if (duser.isPresent()) { if (loginAttemptService.isBlocked(username)) { @@ -56,13 +74,14 @@ public class CustomOAuth2UserService implements OAuth2UserService getScopes() { if (scopes == null || scopes.isEmpty()) { - scopes.add("openid"); scopes.add("profile"); scopes.add("email"); } @@ -684,6 +693,11 @@ public class ApplicationProperties { return "keycloak"; } + @Override + public String getClientName() { + return "Keycloak"; + } + public boolean isSettingsValid() { return isValid(this.getIssuer(), "issuer") && isValid(this.getClientId(), "clientId") diff --git a/src/main/java/stirling/software/SPDF/model/Provider.java b/src/main/java/stirling/software/SPDF/model/Provider.java index a8dce446..c378975d 100644 --- a/src/main/java/stirling/software/SPDF/model/Provider.java +++ b/src/main/java/stirling/software/SPDF/model/Provider.java @@ -4,11 +4,16 @@ import java.util.Collection; public class Provider implements ProviderInterface { private String name; + private String clientName; public String getName() { return name; } + public String getClientName() { + return clientName; + } + protected boolean isValid(String value, String name) { if (value != null && !value.trim().isEmpty()) { return true; From 37c75971f298ed2694ed667ee92b4d7b4ea69ea6 Mon Sep 17 00:00:00 2001 From: Ludy87 Date: Thu, 6 Jun 2024 21:14:34 +0200 Subject: [PATCH 3/4] Update ApplicationProperties.java --- .../stirling/software/SPDF/model/ApplicationProperties.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/stirling/software/SPDF/model/ApplicationProperties.java b/src/main/java/stirling/software/SPDF/model/ApplicationProperties.java index 3ba5ffb6..bc98b24f 100644 --- a/src/main/java/stirling/software/SPDF/model/ApplicationProperties.java +++ b/src/main/java/stirling/software/SPDF/model/ApplicationProperties.java @@ -455,6 +455,7 @@ public class ApplicationProperties { @Override public Collection getScopes() { if (scopes == null || scopes.isEmpty()) { + scopes = new ArrayList<>(); scopes.add("https://www.googleapis.com/auth/userinfo.email"); scopes.add("https://www.googleapis.com/auth/userinfo.profile"); } @@ -560,6 +561,7 @@ public class ApplicationProperties { public Collection getScopes() { if (scopes == null || scopes.isEmpty()) { + scopes = new ArrayList<>(); scopes.add("read:user"); } return scopes; @@ -652,6 +654,7 @@ public class ApplicationProperties { @Override public Collection getScopes() { if (scopes == null || scopes.isEmpty()) { + scopes = new ArrayList<>(); scopes.add("profile"); scopes.add("email"); } From 319ecbcbc1c0e6212bbb3c21085e11017f72180a Mon Sep 17 00:00:00 2001 From: "GitHub Action action@github.com" Date: Thu, 6 Jun 2024 19:23:20 +0000 Subject: [PATCH 4/4] :floppy_disk: Sync Versions > Made via sync_files.yml --- chart/stirling-pdf/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart/stirling-pdf/Chart.yaml b/chart/stirling-pdf/Chart.yaml index 30263954..ae25f637 100644 --- a/chart/stirling-pdf/Chart.yaml +++ b/chart/stirling-pdf/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: 0.25.1 +appVersion: 0.25.2 description: locally hosted web application that allows you to perform various operations on PDF files home: https://github.com/Stirling-Tools/Stirling-PDF