Skip to content

Commit

Permalink
Add: Translation Support for Sort by: in Home Page (#2850)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
Ludy87 authored Feb 3, 2025
1 parent 883281e commit bacc502
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/resources/messages_en_GB.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<div style="display: flex; column-gap: 3rem; flex-wrap: wrap; margin-left:1rem">
<div
style="height:2.5rem; display: flex; align-items: center; cursor: pointer; justify-content: center;">
<label for="sort-options">Sort by:</label>
<label for="sort-options" th:text="#{home.sortBy}">Sort by:</label>
<select id="sort-options" style="border:none;">
<option value="alphabetical" th:text="#{home.alphabetical}"> </option>
<!-- <option value="personal">Your most used</option> -->
Expand Down

0 comments on commit bacc502

Please sign in to comment.