Skip to content

Commit 19ff91d

Browse files
authored
Process recovery suggestion from Sparkle update error messages in UI alert (#2689)
Also update read-only mount localization string to remove extraneous comma
1 parent 587aa02 commit 19ff91d

File tree

32 files changed

+45
-33
lines changed

32 files changed

+45
-33
lines changed

Sparkle/Base.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"%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.";
1515

1616
/* No comment provided by engineer. */
17-
"%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.";
17+
"%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.";
1818

1919
/* No comment provided by engineer. */
2020
"%@ %@ is currently the newest version available." = "%1$@ %2$@ is currently the newest version available.";

Sparkle/SPUBasicUpdateDriver.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ - (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString
7777
if ([_host isRunningTranslocated]) {
7878
[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], }]];
7979
} else {
80-
[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] }]];
80+
[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] }]];
8181
}
8282
} else {
8383
[_appcastDriver loadAppcastFromURL:appcastURL userAgent:userAgent httpHeaders:httpHeaders inBackground:background];

Sparkle/SPUStandardUserDriver.m

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,9 +586,21 @@ - (void)showUpdaterError:(NSError *)error acknowledgement:(void (^)(void))acknow
586586
NSBundle *sparkleBundle = SUSparkleBundle();
587587
#endif
588588

589+
// Ideally we should use -[NSAlert alertWithError:] however
590+
// unfortunately Sparkle may return error messages with descriptions that contain
591+
// recovery suggestions. So we will check if an explicit recovery suggestion exists,
592+
// and set the mesage and informative text appropriately.
593+
// In the future we should audit potential error messages and make them consistent.
589594
NSAlert *alert = [[NSAlert alloc] init];
590-
alert.messageText = SULocalizedStringFromTableInBundle(@"Update Error!", SPARKLE_TABLE, sparkleBundle, nil);
591-
alert.informativeText = [NSString stringWithFormat:@"%@", [error localizedDescription]];
595+
NSString *recoverySuggestion = [error localizedRecoverySuggestion];
596+
if (recoverySuggestion != nil) {
597+
alert.messageText = error.localizedDescription;
598+
alert.informativeText = recoverySuggestion;
599+
} else {
600+
alert.messageText = SULocalizedStringFromTableInBundle(@"Update Error!", SPARKLE_TABLE, sparkleBundle, nil);
601+
alert.informativeText = error.localizedDescription;
602+
}
603+
592604
[alert addButtonWithTitle:SULocalizedStringFromTableInBundle(@"Cancel Update", SPARKLE_TABLE, sparkleBundle, nil)];
593605
[self showAlert:alert secondaryAction:nil];
594606

Sparkle/ca.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"%@ of %@" = "%1$@ de %2$@";
1212

1313
/* No comment provided by engineer. */
14-
"%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.";
14+
"%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.";
1515

1616
/* No comment provided by engineer. */
1717
"A new version of %@ is available!" = "Hi ha una nova versió de %@ disponible!";

Sparkle/cs.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"%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.";
4242

4343
/* No comment provided by engineer. */
44-
"%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.";
44+
"%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.";
4545

4646
/* No comment provided by engineer. */
4747
"A new version of %@ is available!" = "Je dostupná nová verze aplikace %@!";

Sparkle/da.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"%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?";
2121

2222
/* No comment provided by engineer. */
23-
"%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.";
23+
"%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.";
2424

2525
/* No comment provided by engineer. */
2626
"A new version of %@ is available!" = "En ny version af %@ er tilgængelig!";

Sparkle/de.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"%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.";
4242

4343
/* No comment provided by engineer. */
44-
"%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.";
44+
"%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.";
4545

4646
/* No comment provided by engineer. */
4747
"A new version of %@ is available!" = "Eine neue Version von %@ ist verfügbar!";

Sparkle/el.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "Το %1$@ %2$@ κατέβηκε. Είναι έτοιμο προς εγκατάσταση! Θέλετε να εγκαταστήσετε και να επανεκκινήσετε το %1$@ τώρα;";
1818

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

2222
/* No comment provided by engineer. */
2323
"A new version of %@ is available!" = "Μία νέα έκδοση του %@ είναι διαθέσιμη!";

Sparkle/es.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"%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?";
2424

2525
/* No comment provided by engineer. */
26-
"%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.";
26+
"%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.";
2727

2828
/* No comment provided by engineer. */
2929
"A new version of %@ is available!" = "¡Una nueva versión de %@ está disponible!";

Sparkle/fa.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "%1$@ نمی‌تواند به‌روزرسانی شود، اگر از محلی که در آن بارگیری شده باز شود";
2727

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

3131
/* No comment provided by engineer. */
3232
"A new version of %@ is available!" = "نسخه‌ای جدید از %@ در دسترس است";

Sparkle/fr.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"%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é.";
2727

2828
/* No comment provided by engineer. */
29-
"%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.";
29+
"%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.";
3030

3131
/* No comment provided by engineer. */
3232
"A new version of %@ is available!" = "Une nouvelle version de %@ est disponible !";

Sparkle/he.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "לא ניתן לעדכן את %1$@ כשהוא פועל מהמיקום אליו הוא הורד.";
1515

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

1919
/* No comment provided by engineer. */
2020
"%@ %@ is currently the newest version available." = "%@ %@ היא הגרסה החדשה ביותר שזמינה כרגע.";

Sparkle/hr.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"%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$@?";
2424

2525
/* No comment provided by engineer. */
26-
"%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.";
26+
"%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.";
2727

2828
/* No comment provided by engineer. */
2929
"A new version of %@ is available!" = "Dostupna je nova verzija za %@!";

Sparkle/it.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"%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.";
1515

1616
/* No comment provided by engineer. */
17-
"%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.";
17+
"%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.";
1818

1919
/* No comment provided by engineer. */
2020
"%@ %@ is currently the newest version available." = "%1$@ %2$@ è la versione più recente attualmente disponibile.";

Sparkle/ja.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "この場所ではダウンロードされたアップデートを%1$@に適用できません。";
4242

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

4646
/* No comment provided by engineer. */
4747
"A new version of %@ is available!" = "新しいバージョンの%@が入手できます!";

Sparkle/ko.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "%1$@ 이(가) 다운로드된 위치에서 실행 중인 경우에는 업데이트할 수 없습니다.";
1515

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

1919
/* No comment provided by engineer. */
2020
"%@ %@ is currently the newest version available." = "%1$@ %2$@ 이(가) 현재 최신 버전입니다.";

Sparkle/nb.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"%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å?";
2121

2222
/* No comment provided by engineer. */
23-
"%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";
23+
"%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";
2424

2525
/* No comment provided by engineer. */
2626
"A new version of %@ is available!" = "En ny versjon av %@ er tilgjengelig!";

Sparkle/nl.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"%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.";
4242

4343
/* No comment provided by engineer. */
44-
"%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.";
44+
"%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.";
4545

4646
/* No comment provided by engineer. */
4747
"A new version of %@ is available!" = "Een nieuwe versie van %@ is beschikbaar!";

Sparkle/nn.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"%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?";
2121

2222
/* No comment provided by engineer. */
23-
"%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";
23+
"%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";
2424

2525
/* No comment provided by engineer. */
2626
"A new version of %@ is available!" = "Ein ny versjon av %@ er tilgjengeleg!";

Sparkle/pl.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"%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$@?";
2121

2222
/* No comment provided by engineer. */
23-
"%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.";
23+
"%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.";
2424

2525
/* No comment provided by engineer. */
2626
"A new version of %@ is available!" = "Dostępna jest nowa wersja %@!";

Sparkle/pt-BR.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"%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.";
3939

4040
/* No comment provided by engineer. */
41-
"%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.";
41+
"%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.";
4242

4343
/* No comment provided by engineer. */
4444
"A new version of %@ is available!" = "Uma nova versão do app %@ está disponível!";

Sparkle/pt-PT.lproj/Sparkle.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"%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?";
1818

1919
/* No comment provided by engineer. */
20-
"%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.";
20+
"%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.";
2121

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

0 commit comments

Comments
 (0)