NSString * ViewsLocalizedStringFormat(NSString *key,NSString *defValue);
// Handle localized strings stored in a bundle
NSString * ViewsLocalizedStringFormat(NSString *key,NSString *defValue)
{
static NSBundle *viewsBundle = nil;
if (viewsBundle == nil) {
NSBundle *viewBundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"views" ofType:@"bundle"]];
viewsBundle = [NSBundle bundleWithPath:[viewBundle pathForResource:[[NSLocale preferredLanguages] objectAtIndex:0] ofType:@"lproj"]];
if (viewsBundle == nil) {
viewsBundle = [NSBundle bundleWithPath:[viewBundle pathForResource:@"en" ofType:@"lproj"]];
}
}
if (defValue==nil) {
defValue=key;
}
return [viewsBundle localizedStringForKey:key value:defValue table:nil];
}