Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composeApp/src/desktopMain/kotlin/org/ooni/probe/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ fun main(args: Array<String>) {
// Only show update UI on Mac and Windows platforms
if (updateController.supportsUpdates()) {
Item(
text = updateController.getMenuText(),
text = stringResource(updateController.getMenuText()),
enabled = updateState != UpdateState.CHECKING_FOR_UPDATES,
onClick = { updateController.checkNow() },
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.launch
import ooniprobe.composeapp.generated.resources.Res
import ooniprobe.composeapp.generated.resources.Tray_Notification_Check_Updates
import ooniprobe.composeapp.generated.resources.Tray_Notification_Checking_Updates
import ooniprobe.composeapp.generated.resources.Tray_Notification_Updates_Available
import org.jetbrains.compose.resources.StringResource
import org.ooni.probe.config.UpdateConfig
import org.ooni.probe.dependencies
import org.ooni.probe.shared.DesktopOS
Expand Down Expand Up @@ -118,12 +123,11 @@ class DesktopUpdateController(
updateManager.retryLastOperation()
}

// TODO: add translations after macOS has been finalized
fun getMenuText(): String =
fun getMenuText(): StringResource =
when (_state.value) {
UpdateState.CHECKING_FOR_UPDATES -> "Checking for Updates..."
UpdateState.UPDATE_AVAILABLE -> "Update Available!"
else -> "Check for Updates"
UpdateState.CHECKING_FOR_UPDATES -> Res.string.Tray_Notification_Checking_Updates
UpdateState.UPDATE_AVAILABLE -> Res.string.Tray_Notification_Updates_Available
else -> Res.string.Tray_Notification_Check_Updates
}

suspend fun cleanup() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,7 @@
<string name="Settings_Donate_Action_Error">Error opening donation page. Please go to %1$s</string>

<string name="Dashboard_Runv2_Overview_Uninstall_Prompt">You will be able to install this link again only from the original link sent by the creator. Measurements from this link will be deleted, but will be accessible from explorer.</string>
<string name="Tray_Notification_Check_Updates">Check for Updates</string>
<string name="Tray_Notification_Updates_Available">Update Available!</string>
<string name="Tray_Notification_Checking_Updates">Checking for updates...</string>
</resources>
Loading