Skip to content

Commit

Permalink
Process recovery suggestion from Sparkle update error messages in UI …
Browse files Browse the repository at this point in the history
…alert (#2689)

Also update read-only mount localization string to remove extraneous comma
  • Loading branch information
zorgiepoo authored Jan 21, 2025
1 parent 587aa02 commit 19ff91d
Show file tree
Hide file tree
Showing 32 changed files with 45 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Sparkle/Base.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "%1$@ can’t be updated if it’s running from the location it was downloaded to.";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ can’t be updated, because it was opened from a read-only or a temporary location.";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ can’t be updated because it was opened from a read-only or a temporary location.";

/* No comment provided by engineer. */
"%@ %@ is currently the newest version available." = "%1$@ %2$@ is currently the newest version available.";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/SPUBasicUpdateDriver.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ - (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString
if ([_host isRunningTranslocated]) {
[delegate basicDriverIsRequestingAbortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningTranslocated userInfo:@{ NSLocalizedRecoverySuggestionErrorKey: [NSString stringWithFormat:SULocalizedStringFromTableInBundle(@"Quit %1$@, move it into your Applications folder, relaunch it from there and try again.", SPARKLE_TABLE, sparkleBundle, nil), hostName], NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedStringFromTableInBundle(@"%1$@ can’t be updated if it’s running from the location it was downloaded to.", SPARKLE_TABLE, sparkleBundle, nil), hostName], }]];
} else {
[delegate basicDriverIsRequestingAbortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningFromDiskImageError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedStringFromTableInBundle(@"%1$@ can’t be updated, because it was opened from a read-only or a temporary location.", SPARKLE_TABLE, sparkleBundle, nil), hostName], NSLocalizedRecoverySuggestionErrorKey: [NSString stringWithFormat:SULocalizedStringFromTableInBundle(@"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again.", SPARKLE_TABLE, sparkleBundle, nil), hostName] }]];
[delegate basicDriverIsRequestingAbortUpdateWithError:[NSError errorWithDomain:SUSparkleErrorDomain code:SURunningFromDiskImageError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:SULocalizedStringFromTableInBundle(@"%1$@ can’t be updated because it was opened from a read-only or a temporary location.", SPARKLE_TABLE, sparkleBundle, nil), hostName], NSLocalizedRecoverySuggestionErrorKey: [NSString stringWithFormat:SULocalizedStringFromTableInBundle(@"Use Finder to copy %1$@ to the Applications folder, relaunch it from there, and try again.", SPARKLE_TABLE, sparkleBundle, nil), hostName] }]];
}
} else {
[_appcastDriver loadAppcastFromURL:appcastURL userAgent:userAgent httpHeaders:httpHeaders inBackground:background];
Expand Down
16 changes: 14 additions & 2 deletions Sparkle/SPUStandardUserDriver.m
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,21 @@ - (void)showUpdaterError:(NSError *)error acknowledgement:(void (^)(void))acknow
NSBundle *sparkleBundle = SUSparkleBundle();
#endif

// Ideally we should use -[NSAlert alertWithError:] however
// unfortunately Sparkle may return error messages with descriptions that contain
// recovery suggestions. So we will check if an explicit recovery suggestion exists,
// and set the mesage and informative text appropriately.
// In the future we should audit potential error messages and make them consistent.
NSAlert *alert = [[NSAlert alloc] init];
alert.messageText = SULocalizedStringFromTableInBundle(@"Update Error!", SPARKLE_TABLE, sparkleBundle, nil);
alert.informativeText = [NSString stringWithFormat:@"%@", [error localizedDescription]];
NSString *recoverySuggestion = [error localizedRecoverySuggestion];
if (recoverySuggestion != nil) {
alert.messageText = error.localizedDescription;
alert.informativeText = recoverySuggestion;
} else {
alert.messageText = SULocalizedStringFromTableInBundle(@"Update Error!", SPARKLE_TABLE, sparkleBundle, nil);
alert.informativeText = error.localizedDescription;
}

[alert addButtonWithTitle:SULocalizedStringFromTableInBundle(@"Cancel Update", SPARKLE_TABLE, sparkleBundle, nil)];
[self showAlert:alert secondaryAction:nil];

Expand Down
2 changes: 1 addition & 1 deletion Sparkle/ca.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"%@ of %@" = "%1$@ de %2$@";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ no es pot actualitzar quan funciona des d'un disc d'imatge.";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ no es pot actualitzar quan funciona des d'un disc d'imatge.";

/* No comment provided by engineer. */
"A new version of %@ is available!" = "Hi ha una nova versió de %@ disponible!";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/cs.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "Aplikace %1$@ nemůže být aktualizována pokud je spuštěna z umístění, ve kterém je stažena.";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "Aplikace %1$@ nemůže být aktualizována, protože je spuštěna z dočasného umístění nebo z umístění, na které nelze zapisovat.";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "Aplikace %1$@ nemůže být aktualizována, protože je spuštěna z dočasného umístění nebo z umístění, na které nelze zapisovat.";

/* No comment provided by engineer. */
"A new version of %@ is available!" = "Je dostupná nová verze aplikace %@!";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/da.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ er hentet og klar til brug! Vil du installere og genstarte %1$@ nu?";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ kan ikke opdateres når det køres fra en kun læsbar enhed.";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ kan ikke opdateres når det køres fra en kun læsbar enhed.";

/* No comment provided by engineer. */
"A new version of %@ is available!" = "En ny version af %@ er tilgængelig!";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/de.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "„%1$@“ kann nicht aktualisiert werden, wenn das Programm von dem Ort ausgeführt wird, an den es heruntergeladen wurde.";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ kann nicht aktualisiert werden, da es aus dem Downloads-Order, oder von einer DMG-Datei oder einem Laufwerk ohne Schreibzugriff gestartet wurde.";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ kann nicht aktualisiert werden, da es aus dem Downloads-Order, oder von einer DMG-Datei oder einem Laufwerk ohne Schreibzugriff gestartet wurde.";

/* No comment provided by engineer. */
"A new version of %@ is available!" = "Eine neue Version von %@ ist verfügbar!";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/el.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "Το %1$@ %2$@ κατέβηκε. Είναι έτοιμο προς εγκατάσταση! Θέλετε να εγκαταστήσετε και να επανεκκινήσετε το %1$@ τώρα;";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "Το %1$@ δεν μπορεί να ενημερωθεί όσο τρέχει από έναν δίσκο ανάγνωσης-μόνο ή έναν οπτικό δίσκο.";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "Το %1$@ δεν μπορεί να ενημερωθεί όσο τρέχει από έναν δίσκο ανάγνωσης-μόνο ή έναν οπτικό δίσκο.";

/* No comment provided by engineer. */
"A new version of %@ is available!" = "Μία νέα έκδοση του %@ είναι διαθέσιμη!";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/es.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "¡%1$@ %2$@ se ha descargado y está lista para usarse! ¿Te gustaría instalarla y volver a abrir %1$@ ahora?";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ no se puede actualizar porque fue abierta desde una ubicación temporal o de solo lectura.";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ no se puede actualizar porque fue abierta desde una ubicación temporal o de solo lectura.";

/* No comment provided by engineer. */
"A new version of %@ is available!" = "¡Una nueva versión de %@ está disponible!";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/fa.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "%1$@ نمی‌تواند به‌روزرسانی شود، اگر از محلی که در آن بارگیری شده باز شود";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ نمی‌تواند به‌روزرسانی شود، زیرا از محلی با سطح دسترسی فقط-خواندن یا موقت باز شده است";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ نمی‌تواند به‌روزرسانی شود، زیرا از محلی با سطح دسترسی فقط-خواندن یا موقت باز شده است";

/* No comment provided by engineer. */
"A new version of %@ is available!" = "نسخه‌ای جدید از %@ در دسترس است";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/fr.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "%1$@ ne peut pas être mis à jour s’il est exécuté depuis le dossier dans lequel il a été téléchargé.";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ ne peut pas être mis à jour quand il fonctionne à partir d’un volume en lecture seule, comme une image disque ou un lecteur optique.";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ ne peut pas être mis à jour quand il fonctionne à partir d’un volume en lecture seule, comme une image disque ou un lecteur optique.";

/* No comment provided by engineer. */
"A new version of %@ is available!" = "Une nouvelle version de %@ est disponible !";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/he.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "לא ניתן לעדכן את %1$@ כשהוא פועל מהמיקום אליו הוא הורד.";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "לא ניתן לעדכן את %1$@ מכיוון שהוא נפתח ממיקום זמני או לקריאה בלבד.";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "לא ניתן לעדכן את %1$@ מכיוון שהוא נפתח ממיקום זמני או לקריאה בלבד.";

/* No comment provided by engineer. */
"%@ %@ is currently the newest version available." = "%@ %@ היא הגרסה החדשה ביותר שזמינה כרגע.";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/hr.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ je preuzeta i spremna za upotrebu! Želiš li je sada instalirati, te ponovo pokrenuti %1$@?";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ nije moguće aktualizirati, jer je pokrenuta s lokacije bez korisničkih prava pisanja, npr. dmg.";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ nije moguće aktualizirati, jer je pokrenuta s lokacije bez korisničkih prava pisanja, npr. dmg.";

/* No comment provided by engineer. */
"A new version of %@ is available!" = "Dostupna je nova verzija za %@!";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/it.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "%1$@ non può essere aggiornata se è in esecuzione dalla posizione in cui è stato scaricata.";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ non può essere aggiornata perché è stata aperta da una posizione di sola lettura o temporanea.";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ non può essere aggiornata perché è stata aperta da una posizione di sola lettura o temporanea.";

/* No comment provided by engineer. */
"%@ %@ is currently the newest version available." = "%1$@ %2$@ è la versione più recente attualmente disponibile.";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/ja.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "この場所ではダウンロードされたアップデートを%1$@に適用できません。";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@は読み出し専用または一時的な場所で開かれているためアップデートできません。";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@は読み出し専用または一時的な場所で開かれているためアップデートできません。";

/* No comment provided by engineer. */
"A new version of %@ is available!" = "新しいバージョンの%@が入手できます!";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/ko.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "%1$@ 이(가) 다운로드된 위치에서 실행 중인 경우에는 업데이트할 수 없습니다.";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ 이(가) 디스크 이미지나 CD 드라이브 같은 읽기 전용 볼륨에서 실행되고 있으므로 업데이트할 수 없습니다.";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ 이(가) 디스크 이미지나 CD 드라이브 같은 읽기 전용 볼륨에서 실행되고 있으므로 업데이트할 수 없습니다.";

/* No comment provided by engineer. */
"%@ %@ is currently the newest version available." = "%1$@ %2$@ 이(가) 현재 최신 버전입니다.";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/nb.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ er lastet ned og er klar til bruk! Ønsker du å installere og restarte %1$@ nå?";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ kan ikke oppdateres fra en 'bare lesbar' enhet som f.eks. en cd";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ kan ikke oppdateres fra en 'bare lesbar' enhet som f.eks. en cd";

/* No comment provided by engineer. */
"A new version of %@ is available!" = "En ny versjon av %@ er tilgjengelig!";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/nl.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "%1$@ kan niet worden bijgewerkt als het is geopend vanuit de downloadlocatie.";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ kan niet worden bijgewerkt, omdat het vanuit een alleen-lezen- of tijdelijke locatie is geopend.";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ kan niet worden bijgewerkt, omdat het vanuit een alleen-lezen- of tijdelijke locatie is geopend.";

/* No comment provided by engineer. */
"A new version of %@ is available!" = "Een nieuwe versie van %@ is beschikbaar!";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/nn.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ er lasta ned og er klar til bruk! Ynskjer du å installera og starta om att %1$@ no?";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ kan ikkje oppdaterast frå ei eining som berre kan lesast, t.d. frå ein cd";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ kan ikkje oppdaterast frå ei eining som berre kan lesast, t.d. frå ein cd";

/* No comment provided by engineer. */
"A new version of %@ is available!" = "Ein ny versjon av %@ er tilgjengeleg!";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/pl.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ został pobrany i jest gotowy do użycia! Czy chcesz teraz zainstalować i ponownie uruchomić %1$@?";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "%1$@ nie może zostać uaktualniony, ponieważ został uruchomiony z folderu tymczasowego lub tylko do odczytu.";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "%1$@ nie może zostać uaktualniony, ponieważ został uruchomiony z folderu tymczasowego lub tylko do odczytu.";

/* No comment provided by engineer. */
"A new version of %@ is available!" = "Dostępna jest nowa wersja %@!";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/pt-BR.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "O app %1$@ não pode ser atualizado se ele estiver aberto do local onde foi baixado.";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "O app %1$@ não pode ser atualizado porque foi aberto de um volume somente leitura ou local temporário.";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "O app %1$@ não pode ser atualizado porque foi aberto de um volume somente leitura ou local temporário.";

/* No comment provided by engineer. */
"A new version of %@ is available!" = "Uma nova versão do app %@ está disponível!";
Expand Down
2 changes: 1 addition & 1 deletion Sparkle/pt-PT.lproj/Sparkle.strings
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "O %1$@ %2$@ foi transferido e está pronto a instalar! Gostaria de o fazer agora e reiniciar o %1$@ posteriormente?";

/* No comment provided by engineer. */
"%1$@ can’t be updated, because it was opened from a read-only or a temporary location." = "O %1$@ não pode ser actualizado quando estiver a ser executado a partir de um volume apenas de leitura como uma imagem de disco ou disco óptico.";
"%1$@ can’t be updated because it was opened from a read-only or a temporary location." = "O %1$@ não pode ser actualizado quando estiver a ser executado a partir de um volume apenas de leitura como uma imagem de disco ou disco óptico.";

/* No comment provided by engineer. */
"A new version of %@ is available!" = "Uma nova versão do %@ está dísponível!";
Expand Down
Loading

0 comments on commit 19ff91d

Please sign in to comment.