#define ForRelease 0
#define ForSaurik (0 && !ForRelease)
#define LogBrowser (1 && !ForRelease)
+#define TrackResize (0 && !ForRelease)
#define ManualRefresh (1 && !ForRelease)
#define ShowInternals (0 && !ForRelease)
#define IgnoreInstall (0 && !ForRelease)
static const NSString *Safari_ = nil;
CFLocaleRef Locale_;
+NSArray *Languages_;
CGColorSpaceRef space_;
bool bootstrap_;
}
NSString *LocalizeSection(NSString *section) {
- return section;
+ static Pcre title_r("^(.*?) \\((.*)\\)$");
+ if (title_r(section))
+ return [NSString stringWithFormat:CYLocalize("PARENTHETICAL"),
+ LocalizeSection(title_r[1]),
+ LocalizeSection(title_r[2])
+ ];
+
+ return [[NSBundle mainBundle] localizedStringForKey:section value:nil table:@"Sections"];
}
NSString *Simplify(NSString *title) {
if (paren_r(data, size))
return Simplify(paren_r[1]);
- static Pcre title_r("^(.*?) \\(.*\\)$");
+ static Pcre title_r("^(.*?) \\((.*)\\)$");
if (title_r(data, size))
return Simplify(title_r[1]);
}
+ (Package *) packageWithIterator:(pkgCache::PkgIterator)iterator withZone:(NSZone *)zone inPool:(apr_pool_t *)pool database:(Database *)database {
- pkgCache::VerIterator version([database policy]->GetCandidateVer(iterator));
+ pkgCache::VerIterator version;
+
+ _profile(Package$packageWithIterator$GetCandidateVer)
+ version = [database policy]->GetCandidateVer(iterator);
+ _end
+
if (version.end())
return nil;
+
return [[[Package alloc]
initWithVersion:version
withZone:zone
[self setPopupHook:nil];
WebThreadUnlock();
+ //[self yieldToSelector:@selector(callFunction:) withObject:special_];
[super callFunction:special_];
}
}
[cancel_ addTarget:self action:@selector(_onCancel) forControlEvents:UIControlEventTouchUpInside];
CGRect frame = [cancel_ frame];
- frame.size.width = 65;
frame.origin.x = ovrrect.size.width - frame.size.width - 5;
frame.origin.y = (ovrrect.size.height - frame.size.height) / 2;
[cancel_ setFrame:frame];
@"home-dn.png", kUIButtonBarButtonSelectedInfo,
[NSNumber numberWithInt:1], kUIButtonBarButtonTag,
self, kUIButtonBarButtonTarget,
- CYLocalize("HOME"), kUIButtonBarButtonTitle,
+ @"Cydia", kUIButtonBarButtonTitle,
@"0", kUIButtonBarButtonType,
nil],
Font18Bold_ = [[UIFont boldSystemFontOfSize:18] retain];
Font22Bold_ = [[UIFont boldSystemFontOfSize:22] retain];
- _assert(pkgInitConfig(*_config));
- _assert(pkgInitSystem(*_config, _system));
-
tag_ = 1;
essential_ = [[NSMutableArray alloc] initWithCapacity:4];
/* }}} */
/* Set Locale {{{ */
Locale_ = CFLocaleCopyCurrent();
-
- CFStringRef locale(CFLocaleGetIdentifier(Locale_));
- setenv("LANG", [(NSString *) locale UTF8String], true);
+ Languages_ = [NSLocale preferredLanguages];
+ //CFStringRef locale(CFLocaleGetIdentifier(Locale_));
+ NSLog(@"%@", [Languages_ description]);
+ const char *lang;
+ if (Languages_ == nil || [Languages_ count] == 0)
+ lang = NULL;
+ else
+ lang = [[Languages_ objectAtIndex:0] UTF8String];
+ setenv("LANG", lang, true);
+ //std::setlocale(LC_ALL, lang);
+ NSLog(@"Setting Language: %s", lang);
/* }}} */
// XXX: apr_app_initialize?
_assert(errno == ENOENT);
}
+ _assert(pkgInitConfig(*_config));
+ _assert(pkgInitSystem(*_config, _system));
+
+ if (lang != NULL)
+ _config->Set("APT::Acquire::Translation", lang);
+
/* Color Choices {{{ */
space_ = CGColorSpaceCreateDeviceRGB();