diff --git a/app/core/src/main/resources/messages_en_GB.properties b/app/core/src/main/resources/messages_en_GB.properties index f78e80b65..9ddc32c23 100644 --- a/app/core/src/main/resources/messages_en_GB.properties +++ b/app/core/src/main/resources/messages_en_GB.properties @@ -366,6 +366,38 @@ navbar.sections.popular=Popular settings.title=Settings settings.update=Update available settings.updateAvailable={0} is the current installed version. A new version ({1}) is available. + +# Update modal and notification strings +update.urgentUpdateAvailable=🚨 Update Available +update.updateAvailable=Update Available +update.modalTitle=Update Available +update.current=Current +update.latest=Latest +update.latestStable=Latest Stable +update.priority=Priority +update.recommendedAction=Recommended Action +update.breakingChangesDetected=⚠️ Breaking Changes Detected +update.breakingChangesMessage=This update contains breaking changes. Please review the migration guides below. +update.migrationGuides=Migration Guides: +update.viewGuide=View Guide +update.loadingDetailedInfo=Loading detailed version information... +update.close=Close +update.viewAllReleases=View All Releases +update.downloadLatest=Download Latest +update.availableUpdates=Available Updates: +update.unableToLoadDetails=Unable to load detailed version information. +update.version=Version + +# Update priority levels +update.priority.urgent=URGENT +update.priority.normal=NORMAL +update.priority.minor=MINOR +update.priority.low=LOW + +# Breaking changes text +update.breakingChanges=Breaking Changes: +update.breakingChangesDefault=This version contains breaking changes +update.migrationGuide=Migration Guide settings.appVersion=App Version: settings.downloadOption.title=Choose download option (For single file non zip downloads): settings.downloadOption.1=Open in same window diff --git a/app/core/src/main/resources/static/js/githubVersion.js b/app/core/src/main/resources/static/js/githubVersion.js index 059fcccfa..20a89ace9 100644 --- a/app/core/src/main/resources/static/js/githubVersion.js +++ b/app/core/src/main/resources/static/js/githubVersion.js @@ -46,6 +46,17 @@ function getDownloadUrl() { return null; } +// Function to get translated priority text +function getTranslatedPriority(priority) { + switch(priority?.toLowerCase()) { + case 'urgent': return updatePriorityUrgent; + case 'normal': return updatePriorityNormal; + case 'minor': return updatePriorityMinor; + case 'low': return updatePriorityLow; + default: return priority?.toUpperCase() || 'NORMAL'; + } +} + async function getUpdateSummary() { // Map Java License enum to API types let type = 'normal'; @@ -153,13 +164,13 @@ async function checkForUpdate() { // Style button based on priority if (priority === 'urgent') { updateBtn.classList.add("btn-danger"); - updateBtn.innerHTML = "🚨 Update Available"; + updateBtn.innerHTML = urgentUpdateAvailable; } else if (priority === 'normal') { updateBtn.classList.add("btn-warning"); - updateBtn.innerHTML = "Update Available"; + updateBtn.innerHTML = updateAvailableText; } else { updateBtn.classList.add("btn-outline-primary"); - updateBtn.innerHTML = "Update Available"; + updateBtn.innerHTML = updateAvailableText; } // Store summary for initial display @@ -221,7 +232,7 @@ async function showUpdateModal() {
${version.announcement.message}
${version.compatibility.breaking_changes ? `Unable to load detailed version information.
'; + spinner.parentElement.innerHTML = `${updateUnableToLoadDetails}
`; } } } diff --git a/app/core/src/main/resources/templates/fragments/navbar.html b/app/core/src/main/resources/templates/fragments/navbar.html index 7814bd00e..833d4fd91 100644 --- a/app/core/src/main/resources/templates/fragments/navbar.html +++ b/app/core/src/main/resources/templates/fragments/navbar.html @@ -17,6 +17,38 @@ const noFavourites = /*[[#{noFavourites}]]*/ ''; console.log(noFavourites); const updateAvailable = /*[[#{settings.updateAvailable}]]*/ ''; + + // Update notification i18n constants + const urgentUpdateAvailable = /*[[#{update.urgentUpdateAvailable}]]*/ '🚨 Update Available'; + const updateAvailableText = /*[[#{update.updateAvailable}]]*/ 'Update Available'; + const updateModalTitle = /*[[#{update.modalTitle}]]*/ 'Update Available'; + const updateCurrent = /*[[#{update.current}]]*/ 'Current'; + const updateLatest = /*[[#{update.latest}]]*/ 'Latest'; + const updateLatestStable = /*[[#{update.latestStable}]]*/ 'Latest Stable'; + const updatePriority = /*[[#{update.priority}]]*/ 'Priority'; + const updateRecommendedAction = /*[[#{update.recommendedAction}]]*/ 'Recommended Action'; + const updateBreakingChangesDetected = /*[[#{update.breakingChangesDetected}]]*/ '⚠️ Breaking Changes Detected'; + const updateBreakingChangesMessage = /*[[#{update.breakingChangesMessage}]]*/ 'This update contains breaking changes. Please review the migration guides below.'; + const updateMigrationGuides = /*[[#{update.migrationGuides}]]*/ 'Migration Guides:'; + const updateViewGuide = /*[[#{update.viewGuide}]]*/ 'View Guide'; + const updateLoadingDetailedInfo = /*[[#{update.loadingDetailedInfo}]]*/ 'Loading detailed version information...'; + const updateClose = /*[[#{update.close}]]*/ 'Close'; + const updateViewAllReleases = /*[[#{update.viewAllReleases}]]*/ 'View All Releases'; + const updateDownloadLatest = /*[[#{update.downloadLatest}]]*/ 'Download Latest'; + const updateAvailableUpdates = /*[[#{update.availableUpdates}]]*/ 'Available Updates:'; + const updateUnableToLoadDetails = /*[[#{update.unableToLoadDetails}]]*/ 'Unable to load detailed version information.'; + const updateVersion = /*[[#{update.version}]]*/ 'Version'; + + // Update priority levels + const updatePriorityUrgent = /*[[#{update.priority.urgent}]]*/ 'URGENT'; + const updatePriorityNormal = /*[[#{update.priority.normal}]]*/ 'NORMAL'; + const updatePriorityMinor = /*[[#{update.priority.minor}]]*/ 'MINOR'; + const updatePriorityLow = /*[[#{update.priority.low}]]*/ 'LOW'; + + // Breaking changes text + const updateBreakingChanges = /*[[#{update.breakingChanges}]]*/ 'Breaking Changes:'; + const updateBreakingChangesDefault = /*[[#{update.breakingChangesDefault}]]*/ 'This version contains breaking changes'; + const updateMigrationGuide = /*[[#{update.migrationGuide}]]*/ 'Migration Guide';