From bacc502f0713b41923c0185a387aeae2b92bbeb4 Mon Sep 17 00:00:00 2001 From: Ludy Date: Mon, 3 Feb 2025 11:29:22 +0100 Subject: [PATCH] Add: Translation Support for `Sort by:` in Home Page (#2850) # Description of Changes ### Summary - Added a new translation key `home.sortBy` in `messages_en_GB.properties` for "Sort by:". - Updated `home.html` to use the new translation key via `th:text="#{home.sortBy}"`. - Ensures the "Sort by:" label is properly localized and can be translated into different languages. ### Why the Change? - Improves internationalization (i18n) by allowing the "Sort by:" label to be translated. - Keeps consistency with other translatable UI elements. ### Challenges Encountered - Ensuring that all relevant parts of the UI correctly reference the translation key. --- ## 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) - [x] 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) - [x] 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) - [x] 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_en_GB.properties | 1 + src/main/resources/templates/home.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/resources/messages_en_GB.properties b/src/main/resources/messages_en_GB.properties index 1e3076db..0139fa96 100644 --- a/src/main/resources/messages_en_GB.properties +++ b/src/main/resources/messages_en_GB.properties @@ -273,6 +273,7 @@ home.legacyHomepage=Old homepage home.newHomePage=Try our new homepage! home.alphabetical=Alphabetical home.globalPopularity=Global Popularity +home.sortBy=Sort by: home.multiTool.title=PDF Multi Tool home.multiTool.desc=Merge, Rotate, Rearrange, Split, and Remove pages diff --git a/src/main/resources/templates/home.html b/src/main/resources/templates/home.html index f53558c6..ccf5c020 100644 --- a/src/main/resources/templates/home.html +++ b/src/main/resources/templates/home.html @@ -58,7 +58,7 @@
- +