mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-22 04:30:47 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b7595b28e5 | ||
|
|
94440a4129 | ||
|
|
29660a9677 |
No files matched your search
Vendored
+16
-11
@@ -12,6 +12,7 @@
|
||||
#import "SUOperatingSystem.h"
|
||||
#include <sys/sysctl.h>
|
||||
#import "SPUUpdaterDelegate.h"
|
||||
#import "SULocalizations.h"
|
||||
|
||||
|
||||
#include "AppKitPrevention.h"
|
||||
@@ -32,6 +33,10 @@ NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
|
||||
|
||||
+ (NSArray<NSDictionary<NSString *, NSString *> *> *)systemProfileArrayForHost:(SUHost *)host
|
||||
{
|
||||
#if SPARKLE_COPY_LOCALIZATIONS
|
||||
NSBundle *sparkleBundle = SUSparkleBundle();
|
||||
#endif
|
||||
|
||||
// Gather profile information and append it to the URL.
|
||||
NSMutableArray<NSDictionary<NSString *, NSString *> *> *profileArray = [NSMutableArray array];
|
||||
NSArray *profileDictKeys = @[@"key", @"displayKey", @"value", @"displayValue"];
|
||||
@@ -42,7 +47,7 @@ NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
|
||||
// OS version
|
||||
NSString *currentSystemVersion = [SUOperatingSystem systemVersionString];
|
||||
if (currentSystemVersion != nil) {
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerOperatingSystemVersionKey, @"OS Version", currentSystemVersion, currentSystemVersion] forKeys:profileDictKeys]];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerOperatingSystemVersionKey, SULocalizedStringFromTableInBundle(@"OS Version", SPARKLE_TABLE, sparkleBundle, nil), currentSystemVersion, currentSystemVersion] forKeys:profileDictKeys]];
|
||||
}
|
||||
|
||||
// CPU type (decoder info for values found here is in mach/machine.h)
|
||||
@@ -58,7 +63,7 @@ NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
|
||||
case CPU_TYPE_POWERPC: visibleCPUType = @"PowerPC"; break;
|
||||
default: visibleCPUType = @"Other"; break;
|
||||
}
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerCPUTypeKey, @"CPU Type", [NSString stringWithFormat:@"%d", value], visibleCPUType] forKeys:profileDictKeys]];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerCPUTypeKey, SULocalizedStringFromTableInBundle(@"CPU Type", SPARKLE_TABLE, sparkleBundle, nil), [NSString stringWithFormat:@"%d", value], visibleCPUType] forKeys:profileDictKeys]];
|
||||
}
|
||||
error = sysctlbyname("hw.cpu64bit_capable", &value, &length, NULL, 0);
|
||||
if (error != 0) {
|
||||
@@ -72,7 +77,7 @@ NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
|
||||
|
||||
if (error == 0) {
|
||||
is64bit = value == 1;
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerCPU64bitKey, @"CPU is 64-Bit?", [NSString stringWithFormat:@"%d", is64bit], is64bit ? @"Yes" : @"No"] forKeys:profileDictKeys]];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerCPU64bitKey, SULocalizedStringFromTableInBundle(@"CPU is 64-Bit?", SPARKLE_TABLE, sparkleBundle, nil), [NSString stringWithFormat:@"%d", is64bit], is64bit ? SULocalizedStringFromTableInBundle(@"Yes", SPARKLE_TABLE, sparkleBundle, nil) : SULocalizedStringFromTableInBundle(@"No", SPARKLE_TABLE, sparkleBundle, nil)] forKeys:profileDictKeys]];
|
||||
}
|
||||
error = sysctlbyname("hw.cpusubtype", &value, &length, NULL, 0);
|
||||
if (error == 0) {
|
||||
@@ -97,7 +102,7 @@ NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
|
||||
} else {
|
||||
visibleCPUSubType = @"Other";
|
||||
}
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerCPUSubtypeKey, @"CPU Subtype", [NSString stringWithFormat:@"%d", value], visibleCPUSubType] forKeys:profileDictKeys]];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerCPUSubtypeKey, SULocalizedStringFromTableInBundle(@"CPU Subtype", SPARKLE_TABLE, sparkleBundle, nil), [NSString stringWithFormat:@"%d", value], visibleCPUSubType] forKeys:profileDictKeys]];
|
||||
}
|
||||
error = sysctlbyname("hw.model", NULL, &length, NULL, 0);
|
||||
if (error == 0) {
|
||||
@@ -107,7 +112,7 @@ NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
|
||||
if (error == 0) {
|
||||
NSString *rawModelName = @(cpuModel);
|
||||
NSString *visibleModelName = rawModelName;
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerHardwareModelKey, @"Mac Model", rawModelName, visibleModelName] forKeys:profileDictKeys]];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerHardwareModelKey, SULocalizedStringFromTableInBundle(@"Mac Model", SPARKLE_TABLE, sparkleBundle, nil), rawModelName, visibleModelName] forKeys:profileDictKeys]];
|
||||
}
|
||||
free(cpuModel);
|
||||
}
|
||||
@@ -117,24 +122,24 @@ NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
|
||||
error = sysctlbyname("hw.ncpu", &value, &length, NULL, 0);
|
||||
if (error == 0) {
|
||||
NSString *stringValue = [NSString stringWithFormat:@"%d", value];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerCPUCountKey, @"Number of CPUs", stringValue, stringValue] forKeys:profileDictKeys]];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerCPUCountKey, SULocalizedStringFromTableInBundle(@"Number of CPUs", SPARKLE_TABLE, sparkleBundle, nil), stringValue, stringValue] forKeys:profileDictKeys]];
|
||||
}
|
||||
|
||||
// User preferred language
|
||||
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
|
||||
NSArray *languages = [defs objectForKey:@"AppleLanguages"];
|
||||
if ([languages count] > 0) {
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerPreferredLanguageKey, @"Preferred Language", [languages objectAtIndex:0], [languages objectAtIndex:0]] forKeys:profileDictKeys]];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerPreferredLanguageKey, SULocalizedStringFromTableInBundle(@"Preferred Language", SPARKLE_TABLE, sparkleBundle, nil), [languages objectAtIndex:0], [languages objectAtIndex:0]] forKeys:profileDictKeys]];
|
||||
}
|
||||
|
||||
// Application sending the request
|
||||
NSString *appName = [host name];
|
||||
if (appName) {
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerApplicationNameKey, @"Application Name", appName, appName] forKeys:profileDictKeys]];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerApplicationNameKey, SULocalizedStringFromTableInBundle(@"Application Name", SPARKLE_TABLE, sparkleBundle, nil), appName, appName] forKeys:profileDictKeys]];
|
||||
}
|
||||
NSString *appVersion = [host version];
|
||||
if (appVersion) {
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerApplicationVersionKey, @"Application Version", appVersion, appVersion] forKeys:profileDictKeys]];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerApplicationVersionKey, SULocalizedStringFromTableInBundle(@"Application Version", SPARKLE_TABLE, sparkleBundle, nil), appVersion, appVersion] forKeys:profileDictKeys]];
|
||||
}
|
||||
|
||||
// Number of displays?
|
||||
@@ -145,7 +150,7 @@ NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
|
||||
if (sysctlbyname("hw.cpufrequency", &hz, &hz_size, NULL, 0) == 0) {
|
||||
unsigned long mhz = hz / 1000000;
|
||||
NSString *stringValue = [NSString stringWithFormat:@"%lu", mhz];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerCPUFrequencyKey, @"CPU Speed (MHz)", stringValue, stringValue] forKeys:profileDictKeys]];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerCPUFrequencyKey, SULocalizedStringFromTableInBundle(@"CPU Speed (MHz)", SPARKLE_TABLE, sparkleBundle, nil), stringValue, stringValue] forKeys:profileDictKeys]];
|
||||
}
|
||||
|
||||
// amount of RAM
|
||||
@@ -154,7 +159,7 @@ NSString *const SUSystemProfilerPreferredLanguageKey = @"lang";
|
||||
if (sysctlbyname("hw.memsize", &bytes, &bytes_size, NULL, 0) == 0) {
|
||||
double megabytes = bytes / (1024. * 1024.);
|
||||
NSString *stringValue = [NSString stringWithFormat:@"%lu", (unsigned long)megabytes];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerMemoryKey, @"Memory (MB)", stringValue, stringValue] forKeys:profileDictKeys]];
|
||||
[profileArray addObject:[NSDictionary dictionaryWithObjects:@[SUSystemProfilerMemoryKey, SULocalizedStringFromTableInBundle(@"Memory (MB)", SPARKLE_TABLE, sparkleBundle, nil), stringValue, stringValue] forKeys:profileDictKeys]];
|
||||
}
|
||||
|
||||
return [profileArray copy];
|
||||
|
||||
Vendored
+47
-8
@@ -1,17 +1,17 @@
|
||||
/* Description text for SUUpdateAlert when the critical update has already been downloaded and ready to install. */
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ הורד והוא מוכן לשימוש! זהו עדכון חשוב; האם תרצה להתקין אותו ולהפעיל מחדש את %1$@ כעת?";
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! This is an important update; would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ הורד והוא מוכן לשימוש! זהו עדכון חשוב; האם ברצונך להתקין אותו ולהפעיל מחדש את %1$@ כעת?";
|
||||
|
||||
/* Description text for SUUpdateAlert when the update has already been downloaded and ready to install. */
|
||||
"%1$@ %2$@ has been downloaded and is ready to use! Would you like to install it and relaunch %1$@ now?" = "%1$@ %2$@ הורד והוא מוכן לשימוש! האם תרצה להתקין אותו ולהפעיל מחדש את %1$@ כעת?";
|
||||
"%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$@ %2$@ is available but your macOS version is too new for this update. This update only supports up to macOS %3$@." = "%1$@ %2$@ זמין, אך גרסת ה-macOS שלך חדשה מדי עבור עדכון זה. עדכון זה תומך רק עד macOS %3$@.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%1$@ %2$@ is available but your macOS version is too old to install it. At least macOS %3$@ is required." = "%1$@ %2$@ זמין אך גרסת ה-macOS שלך ישנה מדי. נדרשת לפחות macOS %3$@.";
|
||||
"%1$@ %2$@ is available but your macOS version is too old to install it. At least macOS %3$@ is required." = "%1$@ %2$@ זמין אך גרסת ה-macOS שלך ישנה מדי. נדרשת macOS %3$@ לפחות.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"%1$@ can’t be updated if it’s running from the location it was downloaded to." = "לא ניתן לעדכן את %1$@ כשהוא פועל מתיקיית ההורדות.";
|
||||
"%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$@ מכיוון שהוא נפתח ממיקום זמני או לקריאה בלבד.";
|
||||
@@ -23,13 +23,13 @@
|
||||
"%@ %@ is currently the newest version available.\n(You are currently running version %@.)" = "%@ %@ היא הגרסה החדשה ביותר שזמינה.\n(אתה מפעיל כעת את גרסה %@.)";
|
||||
|
||||
/* Description text for SUUpdateAlert when the critical update is downloadable. */
|
||||
"%@ %@ is now available—you have %@. This is an important update; would you like to download it now?" = "%@ %@ זמין - אתה משתמש ב-%@. זהו עדכון חשוב; האם תרצה להוריד אותו כעת?";
|
||||
"%@ %@ is now available—you have %@. This is an important update; would you like to download it now?" = "%@ %@ זמין - אתה משתמש ב-%@. זהו עדכון חשוב; האם ברצונך להוריד אותו כעת?";
|
||||
|
||||
/* Description text for SUUpdateAlert when the update is downloadable. */
|
||||
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%@ %@ זמין - אתה משתמש ב-%@. האם תרצה להוריד אותו כעת?";
|
||||
"%@ %@ is now available—you have %@. Would you like to download it now?" = "%@ %@ זמין - אתה משתמש ב-%@. האם ברצונך להוריד אותו כעת?";
|
||||
|
||||
/* Description text for SUUpdateAlert when the update informational with no download. */
|
||||
"%@ %@ is now available—you have %@. Would you like to learn more about this update on the web?" = "%@ %@ זמין - אתה משתמש ב-%@. האם תרצה ללמוד עוד על עדכון זה?";
|
||||
"%@ %@ is now available—you have %@. Would you like to learn more about this update on the web?" = "%@ %@ זמין - אתה משתמש ב-%@. האם ברצונך ללמוד עוד על עדכון זה?";
|
||||
|
||||
/* The download progress in a unit of bytes, e.g. 100 KB */
|
||||
"%@ downloaded" = "%@ הורדו";
|
||||
@@ -149,4 +149,43 @@
|
||||
"Your macOS version is too old" = "גרסת ה-macOS שלך ישנה מדי";
|
||||
|
||||
/* Status message shown when the user checks for updates but is already current or the feed doesn't contain any updates. */
|
||||
"You’re up to date!" = "לא נמצאו עדכונים חדשים!";
|
||||
"You’re up to date!" = "לא נמצאו עדכונים חדשים!";
|
||||
|
||||
/* System profile key for OS version */
|
||||
"OS Version" = "גרסת מערכת ההפעלה";
|
||||
|
||||
/* System profile key for CPU Type */
|
||||
"CPU Type" = "סוג מעבד";
|
||||
|
||||
/* System profile key for CPU is 64-bit? */
|
||||
"CPU is 64-Bit?" = "מעבד 64-bit?"
|
||||
|
||||
/* System profile yes value for CPU is 64-bit? */
|
||||
"Yes" = "כן";
|
||||
|
||||
/* System profile no value for CPU is 64-bit? */
|
||||
"No" = "לא";
|
||||
|
||||
/* System profile key for CPU Subtype */
|
||||
"CPU Subtype" = "תת-סוג מעבד";
|
||||
|
||||
/* System profile key for Mac Model */
|
||||
"Mac Model" = "דגם ה-Mac";
|
||||
|
||||
/* System profile key for Number of CPUs */
|
||||
"Number of CPUs" = "מספר ליבות מעבד";
|
||||
|
||||
/* System profile key for Preferred Language */
|
||||
"Preferred Language" = "שפה מועדפת";
|
||||
|
||||
/* System profile key for Application Name */
|
||||
"Application Name" = "שם היישום";
|
||||
|
||||
/* System profile key for Application Version */
|
||||
"Application Version" = "גרסת היישום";
|
||||
|
||||
/* System profile key for CPU Speed (MHz) */
|
||||
"CPU Speed (MHz)" = "מהירות מעבד (MHz)";
|
||||
|
||||
/* System profile key for Memory (MB) */
|
||||
"Memory (MB)" = "זיכרון (MB)";
|
||||
Reference in new issue
Block a user