+
+# How to add new languages to Stirling-PDF
+
+Fork Stirling-PDF and make a new branch out of Main
+
+Then add reference to the language in the navbar by adding a new language entry to the dropdown
+
+https://github.com/Frooodle/Stirling-PDF/blob/main/src/main/resources/templates/fragments/navbar.html#L80
+
+For example to add Polish you would add
+```
+Polish
+```
+The data-language-code is the code used to reference the file in the next step.
+
+Start by copying the existing english property file
+
+[https://github.com/Frooodle/Stirling-PDF/tree/langSetup/src/main/resources/messages_en_GB.properties](https://github.com/Frooodle/Stirling-PDF/blob/main/src/main/resources/messages_en_US.properties)
+
+Copy and rename it to messages_{your data-language-code here}.properties, in the polish example you would set the name to messages_pl_PL.properties
+
+
+Then simply translate all property entries within that file and make a PR into main for others to use!
+
+If you do not have a java IDE i am happy to verify the changes worked once you raise PR (but wont be able to verify the translations themselves)
+
+
+
diff --git a/src/main/java/stirling/software/SPDF/config/Beans.java b/src/main/java/stirling/software/SPDF/config/Beans.java
new file mode 100644
index 00000000..72a41b6a
--- /dev/null
+++ b/src/main/java/stirling/software/SPDF/config/Beans.java
@@ -0,0 +1,35 @@
+package stirling.software.SPDF.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.LocaleResolver;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
+import org.springframework.web.servlet.i18n.SessionLocaleResolver;
+
+import java.util.Locale;
+
+@Configuration
+public class Beans implements WebMvcConfigurer {
+
+ @Bean
+ public LocaleResolver localeResolver() {
+ SessionLocaleResolver slr = new SessionLocaleResolver();
+ slr.setDefaultLocale(Locale.US);
+ return slr;
+ }
+
+ @Bean
+ public LocaleChangeInterceptor localeChangeInterceptor() {
+ LocaleChangeInterceptor lci = new LocaleChangeInterceptor();
+ lci.setParamName("lang");
+ return lci;
+ }
+
+ @Override
+ public void addInterceptors(InterceptorRegistry registry) {
+ registry.addInterceptor(localeChangeInterceptor());
+ }
+
+}
diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties
new file mode 100644
index 00000000..e69de29b
diff --git a/src/main/resources/messages_en_GB.properties b/src/main/resources/messages_en_GB.properties
new file mode 100644
index 00000000..a84c3148
--- /dev/null
+++ b/src/main/resources/messages_en_GB.properties
@@ -0,0 +1,209 @@
+###########
+# Generic #
+###########
+pdfPrompt=Choose PDF
+multiPdfPrompt=Choose PDFs (2+)
+multiPdfDropPrompt=Select (or drag & drop) all PDFs you require
+imgPrompt=Choose Image
+genericSubmit=Submit
+processTimeWarning=Warning: This process can take up to a minute depending on file-size
+pageOrderPrompt=Page Order (Enter a comma-separated list of page numbers) :
+goToPage=go
+#############
+# HOME-PAGE #
+#############
+home.desc=Your locally hosted one-stop-shop for all your PDF needs.
+
+navbar.convert=Convert
+navbar.security=Security
+navbar.other=Other
+navbar.darkmode=Dark Mode
+
+home.merge.title=Merge PDFs
+home.merge.desc=Easily merge multiple PDFs into one.
+
+home.split.title=Split PDFs
+home.split.desc=Split PDFs into multiple documents
+
+home.rotate.title=Rotate PDFs
+home.rotate.desc=Easily rotate your PDFs.
+
+home.imageToPdf.title=Image to PDF
+home.imageToPdf.desc=Convert a images (PNG, JPEG, GIF) to PDF.
+
+home.pdfToImage.title=PDF to Image
+home.pdfToImage.desc=Convert a PDF to a image. (PNG, JPEG, GIF)
+
+home.pdfOrganiser.title=PDF Organiser
+home.pdfOrganiser.desc=Remove/Rearrange pages in any order
+
+home.addImage.title=Add image onto PDF
+home.addImage.desc=Adds a image onto a set location on the PDF (Work in progress)
+
+home.watermark.title=Add Watermark
+home.watermark.desc=Add a custom watermark to your PDF document.
+
+home.permissions.title=Change Permissions
+home.permissions.desc=Change the permissions of your PDF document
+
+home.removePages.title=Remove Pages
+home.removePages.desc=Delete unwanted pages from your PDF document.
+
+home.addPassword.title=Add Password
+home.addPassword.desc=Encrypt your PDF document with a password.
+
+home.removePassword.title=Remove Password
+home.removePassword.desc=Remove password protection from your PDF document.
+
+home.compressPdfs.title=Compress PDFs
+home.compressPdfs.desc=Compress PDFs to reduce their file size.
+
+
+
+#Add image
+addImage.title=Add Image
+addImage.header=Add image to PDF (Work in progress)
+addImage.submit=Add image
+
+#compress
+compress.title=Compress
+compress.header=Compress PDF
+compress.compressLevel=Value between 1 and 100 (1 being most reduced)
+compress.submit=Compress
+
+
+#merge
+merge.title=Merge
+merge.header=Merge multiple PDFs (2+)
+merge.submit=Merge
+
+#pdfOrganiser
+pdfOrganiser.title=Page Organiser
+pdfOrganiser.header=PDF Page Organiser
+pdfOrganiser.submit=Rearrange Pages
+
+
+#pageRemover
+pageRemover.title=Page Remover
+pageRemover.header=PDF Page remover
+pageRemover.pagesToDelete=Pages to delete (Enter a comma-separated list of page numbers) :
+pageRemover.submit=Delete Pages
+
+#rotate
+rotate.title=Rotate PDF
+rotate.header=Rotate PDF
+rotate.selectAngle=Select rotation angle (in multiples of 90 degrees):
+rotate.submit=Rotate
+
+
+
+
+#merge
+split.title=Split PDF
+split.header=Split PDF
+split.desc.1=The numbers you select are the page number you wish to do a split on
+split.desc.2=As such selecting 1,3,7-8 would split a 10 page document into 6 separate PDFS with:
+split.desc.3=Document #1: Page 1
+split.desc.4=Document #2: Page 2 and 3
+split.desc.5=Document #3: Page 4, 5 and 6
+split.desc.6=Document #4: Page 7
+split.desc.7=Document #5: Page 8
+split.desc.8=Document #6: Page 9 and 10
+split.splitPages=Enter pages to split on:
+split.submit=Split
+
+
+#merge
+imageToPDF.title=Image to PDF
+imageToPDF.header=Image to PDF
+imageToPDF.submit=Convert
+
+#pdfToImage
+pdfToImage.title=PDF to Image
+pdfToImage.header=PDF to Image
+pdfToImage.selectText=Image Format
+pdfToImage.submit=Convert
+
+#addPassword
+addPassword.title=Add Password
+addPassword.header=Add password (Encrypt)
+addPassword.selectText.1=Select PDF to encrypt
+addPassword.selectText.2=Password
+addPassword.selectText.3=Encryption Key Length
+addPassword.selectText.4=Higher values are stronger, but lower values have better compatibility.
+addPassword.selectText.5=Permissions to set
+addPassword.selectText.6=Prevent assembly of document
+addPassword.selectText.7=Prevent content extraction
+addPassword.selectText.8=Prevent extraction for accessibility
+addPassword.selectText.9=Prevent filling in form
+addPassword.selectText.10=Prevent modification
+addPassword.selectText.11=Prevent annotation modification
+addPassword.selectText.12=Prevent printing
+addPassword.selectText.13=Prevent printing different formats
+addPassword.submit=Encrypt
+
+#watermark
+watermark.title=Add Watermark
+watermark.header=Add Watermark
+watermark.selectText.1=Select PDF to add watermark to:
+watermark.selectText.2=Watermark Text:
+watermark.selectText.3=Font Size:
+watermark.selectText.4=Rotation (0-360):
+watermark.selectText.5=widthSpacer (Space between each watermark horizontally):
+watermark.selectText.6=heightSpacer (Space between each watermark vertically):
+watermark.submit=Add Watermark
+
+
+#Change permissions
+permissions.title=Change Permissions
+permissions.header=Change Permissions
+permissions.warning=Warning to have these permissions be unchangeable it is recommended to set them with a password via the add-password page
+permissions.selectText.1=Select PDF to change permissions
+permissions.selectText.2=Permissions to set
+permissions.selectText.3=Prevent assembly of document
+permissions.selectText.4=Prevent content extraction
+permissions.selectText.5=Prevent extraction for accessibility
+permissions.selectText.6=Prevent filling in form
+permissions.selectText.7=Prevent modification
+permissions.selectText.8=Prevent annotation modification
+permissions.selectText.9=Prevent printing
+permissions.selectText.10=Prevent printing different formats
+permissions.submit=Change
+
+#remove password
+removePassword.title=Remove password
+removePassword.header=Remove password (Decrypt)
+removePassword.selectText.1=Select PDF to Decrypt
+removePassword.selectText.2=Password
+removePassword.submit=Remove
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/messages_en_US.properties b/src/main/resources/messages_en_US.properties
new file mode 100644
index 00000000..802fbe34
--- /dev/null
+++ b/src/main/resources/messages_en_US.properties
@@ -0,0 +1,209 @@
+###########
+# Generic #
+###########
+pdfPrompt=Choose PDF
+multiPdfPrompt=Choose PDFs (2+)
+multiPdfDropPrompt=Select (or drag & drop) all PDFs you require
+imgPrompt=Choose Image
+genericSubmit=Submit
+processTimeWarning=Warning: This process can take up to a minute depending on file-size
+pageOrderPrompt=Page Order (Enter a comma-separated list of page numbers) :
+goToPage=go
+#############
+# HOME-PAGE #
+#############
+home.desc=Your locally hosted one-stop-shop for all your PDF needs.
+
+navbar.convert=Convert
+navbar.security=Security
+navbar.other=Other
+navbar.darkmode=Dark Mode
+
+home.merge.title=Merge PDFs
+home.merge.desc=Easily merge multiple PDFs into one.
+
+home.split.title=Split PDFs
+home.split.desc=Split PDFs into multiple documents
+
+home.rotate.title=Rotate PDFs
+home.rotate.desc=Easily rotate your PDFs.
+
+home.imageToPdf.title=Image to PDF
+home.imageToPdf.desc=Convert a images (PNG, JPEG, GIF) to PDF.
+
+home.pdfToImage.title=PDF to Image
+home.pdfToImage.desc=Convert a PDF to a image. (PNG, JPEG, GIF)
+
+home.pdfOrganiser.title=PDF Organizer
+home.pdfOrganiser.desc=Remove/Rearrange pages in any order
+
+home.addImage.title=Add image onto PDF
+home.addImage.desc=Adds a image onto a set location on the PDF (Work in progress)
+
+home.watermark.title=Add Watermark
+home.watermark.desc=Add a custom watermark to your PDF document.
+
+home.permissions.title=Change Permissions
+home.permissions.desc=Change the permissions of your PDF document
+
+home.removePages.title=Remove Pages
+home.removePages.desc=Delete unwanted pages from your PDF document.
+
+home.addPassword.title=Add Password
+home.addPassword.desc=Encrypt your PDF document with a password.
+
+home.removePassword.title=Remove Password
+home.removePassword.desc=Remove password protection from your PDF document.
+
+home.compressPdfs.title=Compress PDFs
+home.compressPdfs.desc=Compress PDFs to reduce their file size.
+
+
+
+#Add image
+addImage.title=Add Image
+addImage.header=Add image to PDF (Work in progress)
+addImage.submit=Add image
+
+#compress
+compress.title=Compress
+compress.header=Compress PDF
+compress.compressLevel=Value between 1 and 100 (1 being most reduced)
+compress.submit=Compress
+
+
+#merge
+merge.title=Merge
+merge.header=Merge multiple PDFs (2+)
+merge.submit=Merge
+
+#pdfOrganiser
+pdfOrganiser.title=Page Organizer
+pdfOrganiser.header=PDF Page Organizer
+pdfOrganiser.submit=Rearrange Pages
+
+
+#pageRemover
+pageRemover.title=Page Remover
+pageRemover.header=PDF Page remover
+pageRemover.pagesToDelete=Pages to delete (Enter a comma-separated list of page numbers) :
+pageRemover.submit=Delete Pages
+
+#rotate
+rotate.title=Rotate PDF
+rotate.header=Rotate PDF
+rotate.selectAngle=Select rotation angle (in multiples of 90 degrees):
+rotate.submit=Rotate
+
+
+
+
+#merge
+split.title=Split PDF
+split.header=Split PDF
+split.desc.1=The numbers you select are the page number you wish to do a split on
+split.desc.2=As such selecting 1,3,7-8 would split a 10 page document into 6 separate PDFS with:
+split.desc.3=Document #1: Page 1
+split.desc.4=Document #2: Page 2 and 3
+split.desc.5=Document #3: Page 4, 5 and 6
+split.desc.6=Document #4: Page 7
+split.desc.7=Document #5: Page 8
+split.desc.8=Document #6: Page 9 and 10
+split.splitPages=Enter pages to split on:
+split.submit=Split
+
+
+#merge
+imageToPDF.title=Image to PDF
+imageToPDF.header=Image to PDF
+imageToPDF.submit=Convert
+
+#pdfToImage
+pdfToImage.title=PDF to Image
+pdfToImage.header=PDF to Image
+pdfToImage.selectText=Image Format
+pdfToImage.submit=Convert
+
+#addPassword
+addPassword.title=Add Password
+addPassword.header=Add password (Encrypt)
+addPassword.selectText.1=Select PDF to encrypt
+addPassword.selectText.2=Password
+addPassword.selectText.3=Encryption Key Length
+addPassword.selectText.4=Higher values are stronger, but lower values have better compatibility.
+addPassword.selectText.5=Permissions to set
+addPassword.selectText.6=Prevent assembly of document
+addPassword.selectText.7=Prevent content extraction
+addPassword.selectText.8=Prevent extraction for accessibility
+addPassword.selectText.9=Prevent filling in form
+addPassword.selectText.10=Prevent modification
+addPassword.selectText.11=Prevent annotation modification
+addPassword.selectText.12=Prevent printing
+addPassword.selectText.13=Prevent printing different formats
+addPassword.submit=Encrypt
+
+#watermark
+watermark.title=Add Watermark
+watermark.header=Add Watermark
+watermark.selectText.1=Select PDF to add watermark to:
+watermark.selectText.2=Watermark Text:
+watermark.selectText.3=Font Size:
+watermark.selectText.4=Rotation (0-360):
+watermark.selectText.5=widthSpacer (Space between each watermark horizontally):
+watermark.selectText.6=heightSpacer (Space between each watermark vertically):
+watermark.submit=Add Watermark
+
+
+#Change permissions
+permissions.title=Change Permissions
+permissions.header=Change Permissions
+permissions.warning=Warning to have these permissions be unchangeable it is recommended to set them with a password via the add-password page
+permissions.selectText.1=Select PDF to change permissions
+permissions.selectText.2=Permissions to set
+permissions.selectText.3=Prevent assembly of document
+permissions.selectText.4=Prevent content extraction
+permissions.selectText.5=Prevent extraction for accessibility
+permissions.selectText.6=Prevent filling in form
+permissions.selectText.7=Prevent modification
+permissions.selectText.8=Prevent annotation modification
+permissions.selectText.9=Prevent printing
+permissions.selectText.10=Prevent printing different formats
+permissions.submit=Change
+
+#remove password
+removePassword.title=Remove password
+removePassword.header=Remove password (Decrypt)
+removePassword.selectText.1=Select PDF to Decrypt
+removePassword.selectText.2=Password
+removePassword.submit=Remove
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/templates/add-image.html b/src/main/resources/templates/add-image.html
index 111775dd..4d80fb81 100644
--- a/src/main/resources/templates/add-image.html
+++ b/src/main/resources/templates/add-image.html
@@ -2,7 +2,7 @@
-
+
@@ -14,7 +14,7 @@
\ No newline at end of file
diff --git a/src/main/resources/templates/fragments/navbar.html b/src/main/resources/templates/fragments/navbar.html
index 3fb1202a..d1c8123c 100644
--- a/src/main/resources/templates/fragments/navbar.html
+++ b/src/main/resources/templates/fragments/navbar.html
@@ -12,56 +12,46 @@