[ios] Using of L(str) macro instead of NSLocalizedString

This commit is contained in:
Igor Khmurets 2014-10-16 16:21:03 +03:00 committed by Alex Zolotarev
parent ebf2796c2a
commit 915141d3e8
22 changed files with 142 additions and 138 deletions

View file

@ -1,6 +1,7 @@
#import "AccountManager.h"
#import <FacebookSDK/FacebookSDK.h>
#import "UIKitCategories.h"
@interface AccountManager ()
@ -54,7 +55,7 @@
- (void)shareTextToFacebookWithCompletion:(CompletionBlock)block
{
NSDictionary * parameters = @{@"message" : NSLocalizedString(@"maps_me_is_free_today_facebook_post_ios", nil),
NSDictionary * parameters = @{@"message" : L(@"maps_me_is_free_today_facebook_post_ios"),
@"picture" : @"http://static.mapswithme.com/images/17th_august_promo.jpg",
@"link" : @"http://maps.me/get?17aug"};
[FBRequestConnection startWithGraphPath:@"me/feed" parameters:parameters HTTPMethod:@"POST" completionHandler:^(FBRequestConnection * connection, id result, NSError * error) {

View file

@ -1,5 +1,7 @@
#import "AddSetVC.h"
#import "Framework.h"
#import "UIKitCategories.h"
#define TEXT_FIELD_TAG 666
@ -12,7 +14,7 @@
{
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(onSaveClicked)];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(onCancelClicked)];
self.title = NSLocalizedString(@"add_new_set", @"Add New Bookmark Set dialog title");
self.title = L(@"add_new_set");
}
return self;
}
@ -76,7 +78,7 @@
f.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
f.delegate = self;
f.textColor = cell.textLabel.textColor;
f.placeholder = NSLocalizedString(@"bookmark_set_name", @"Add Bookmark Set dialog - hint when set name is empty");
f.placeholder = L(@"bookmark_set_name");
f.autocapitalizationType = UITextAutocapitalizationTypeWords;
f.font = [cell.textLabel.font fontWithSize:[cell.textLabel.font pointSize]];
f.tag = TEXT_FIELD_TAG;

View file

@ -16,7 +16,7 @@
self = [super initWithStyle:UITableViewStyleGrouped];
if (self)
{
self.title = NSLocalizedString(@"bookmarks", @"Boormarks - dialog title");
self.title = L(@"bookmarks");
self.tableView.allowsSelectionDuringEditing = YES;
[[NSNotificationCenter defaultCenter] addObserver:self
@ -49,8 +49,8 @@
label.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
label.backgroundColor = [UIColor clearColor];
bool const showDetailedHint = !GetFramework().GetBmCategoriesCount();
label.text = showDetailedHint ? NSLocalizedString(@"bookmarks_usage_hint", nil)
: NSLocalizedString(@"bookmarks_usage_hint_import_only", nil);
label.text = showDetailedHint ? L(@"bookmarks_usage_hint")
: L(@"bookmarks_usage_hint_import_only");
label.textAlignment = NSTextAlignmentCenter;
label.lineBreakMode = NSLineBreakByWordWrapping;
label.numberOfLines = 0;
@ -58,7 +58,7 @@
}
UILabel * label = [m_hint.subviews objectAtIndex:0];
label.bounds = CGRectInset(rect, offset, offset);
[label sizeToFit];
[label sizeToIntegralFit];
m_hint.bounds = CGRectMake(0, 0, rect.size.width, label.bounds.size.height + 2 * offset);
label.center = CGPointMake(m_hint.bounds.size.width / 2, m_hint.bounds.size.height / 2);
@ -193,7 +193,7 @@
f.adjustsFontSizeToFitWidth = YES;
f.text = cell.textLabel.text;
f.textColor = cell.detailTextLabel.textColor;
f.placeholder = NSLocalizedString(@"bookmark_set_name", @"Add Bookmark Set dialog - hint when set name is empty");
f.placeholder = L(@"bookmark_set_name");
f.font = [cell.textLabel.font fontWithSize:[cell.textLabel.font pointSize]];
f.tag = TEXTFIELD_TAG;
f.delegate = self;

View file

@ -81,9 +81,9 @@
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
if (section == m_trackSection)
return NSLocalizedString(@"tracks", nil);
return L(@"tracks");
if (section == m_bookmarkSection)
return NSLocalizedString(@"bookmarks", nil);
return L(@"bookmarks");
return nil;
}
@ -104,7 +104,7 @@
if (!cell)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"BookmarksVCSetNameCell"];
cell.textLabel.text = NSLocalizedString(@"name", nil);
cell.textLabel.text = L(@"name");
cell.selectionStyle = UITableViewCellSelectionStyleNone;
// Temporary, to init font and color
cell.detailTextLabel.text = @"temp string";
@ -138,7 +138,7 @@
if (!cell)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"BookmarksVCSetVisibilityCell"];
cell.textLabel.text = NSLocalizedString(@"visible", nil);
cell.textLabel.text = L(@"visible");
cell.accessoryView = [[UISwitch alloc] init];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
@ -158,7 +158,7 @@
string dist;
if (MeasurementUtils::FormatDistance(tr->GetLengthMeters(), dist))
//Change Length before release!!!
cell.detailTextLabel.text = [NSString stringWithFormat:@"%@ %@", NSLocalizedString(@"length", nil), [NSString stringWithUTF8String:dist.c_str()]];
cell.detailTextLabel.text = [NSString stringWithFormat:@"%@ %@", L(@"length"), [NSString stringWithUTF8String:dist.c_str()]];
else
cell.detailTextLabel.text = nil;
const graphics::Color c = tr->GetMainColor();
@ -206,7 +206,7 @@
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"BookmarksExportCell"];
cell.textLabel.textAlignment = NSTextAlignmentCenter;
cell.textLabel.text = NSLocalizedString(@"share_by_email", nil);
cell.textLabel.text = L(@"share_by_email");
}
}
@ -427,10 +427,10 @@
{
MFMailComposeViewController * mailVC = [[MFMailComposeViewController alloc] init];
mailVC.mailComposeDelegate = self;
[mailVC setSubject:NSLocalizedString(@"share_bookmarks_email_subject", nil)];
[mailVC setSubject:L(@"share_bookmarks_email_subject")];
NSData * myData = [[NSData alloc] initWithContentsOfFile:filePath];
[mailVC addAttachmentData:myData mimeType:mimeType fileName:[NSString stringWithFormat:@"%@%@", catName, fileExtension]];
[mailVC setMessageBody:[NSString stringWithFormat:NSLocalizedString(@"share_bookmarks_email_body", nil), catName] isHTML:NO];
[mailVC setMessageBody:[NSString stringWithFormat:L(@"share_bookmarks_email_body"), catName] isHTML:NO];
[self presentModalViewController:mailVC animated:YES];
}

View file

@ -19,7 +19,7 @@
if (self)
{
m_bookmarkAndCategory = bookmarkAndCategory;
self.title = NSLocalizedString(@"bookmark_sets", @"Bookmark Sets dialog title");
self.title = L(@"bookmark_sets");
}
return self;
}
@ -52,7 +52,7 @@
// Customize cell
if (indexPath.section == 0)
{
cell.textLabel.text = NSLocalizedString(@"add_new_set", @"Bookmark Sets dialog - Add New Set button");
cell.textLabel.text = L(@"add_new_set");
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
else

View file

@ -1,6 +1,7 @@
#import "BookmarkDescriptionVC.h"
#import "Framework.h"
#import "UIKitCategories.h"
@interface BookmarkDescriptionVC ()
@ -14,7 +15,7 @@
{
[super viewDidLoad];
self.title = NSLocalizedString(@"description", nil);
self.title = L(@"description");
BookmarkCategory const * category = GetFramework().GetBmCategory(self.bookmarkAndCategory.first);
Bookmark const * bookmark = category->GetBookmark(self.bookmarkAndCategory.second);

View file

@ -15,7 +15,7 @@
{
[super viewDidLoad];
self.title = NSLocalizedString(@"name", nil);
self.title = L(@"name");
BookmarkCategory const * category = GetFramework().GetBmCategory(self.bookmarkAndCategory.first);
Bookmark const * bookmark = category->GetBookmark(self.bookmarkAndCategory.second);
@ -24,7 +24,7 @@
self.textField.returnKeyType = UIReturnKeyDone;
if (!self.temporaryName)
self.textField.text = bookmark->GetName().empty() ? NSLocalizedString(@"dropped_pin", nil) : [NSString stringWithUTF8String:bookmark->GetName().c_str()];
self.textField.text = bookmark->GetName().empty() ? L(@"dropped_pin") : [NSString stringWithUTF8String:bookmark->GetName().c_str()];
self.textField.autocapitalizationType = UITextAutocapitalizationTypeWords;
}

View file

@ -53,7 +53,7 @@
NSMutableArray * items = [[NSMutableArray alloc] init];
if (!GetPlatform().IsPro())
[items addObject:@{@"Id" : @"MWMPro", @"Title" : NSLocalizedString(@"become_a_pro", nil), @"Icon" : @"MWMProIcon", @"Color" : @"15c783"}];
[items addObject:@{@"Id" : @"MWMPro", @"Title" : L(@"become_a_pro"), @"Icon" : @"MWMProIcon", @"Color" : @"15c783"}];
bool adsEnabled = true;
(void)Settings::Get("MenuLinksEnabled", adsEnabled);
@ -64,11 +64,11 @@
[items addObjectsFromArray:serverItems];
}
[items addObject:@{@"Id" : @"MoreApps", @"Title" : NSLocalizedString(@"more_apps_guides", nil), @"Icon" : @"IconMoreApps"}];
[items addObject:@{@"Id" : @"MoreApps", @"Title" : L(@"more_apps_guides"), @"Icon" : @"IconMoreApps"}];
NSArray * standardItems = @[@{@"Id" : @"Maps", @"Title" : NSLocalizedString(@"download_maps", nil), @"Icon" : @"IconMap"},
@{@"Id" : @"Settings", @"Title" : NSLocalizedString(@"settings_and_more", nil), @"Icon" : @"IconSettings"},
@{@"Id" : @"Share", @"Title" : NSLocalizedString(@"share_my_location", nil), @"Icon" : @"IconShare"}];
NSArray * standardItems = @[@{@"Id" : @"Maps", @"Title" : L(@"download_maps"), @"Icon" : @"IconMap"},
@{@"Id" : @"Settings", @"Title" : L(@"settings_and_more"), @"Icon" : @"IconSettings"},
@{@"Id" : @"Share", @"Title" : L(@"share_my_location"), @"Icon" : @"IconShare"}];
[items addObjectsFromArray:standardItems];
return items;

View file

@ -59,8 +59,8 @@ typedef void (^CompletionHandler)(UIBackgroundFetchResult);
[self markNotificationShowingForIndex:index];
UILocalNotification * notification = [[UILocalNotification alloc] init];
notification.alertAction = NSLocalizedString(@"download", nil);
notification.alertBody = NSLocalizedString(@"download_map_notification", nil);
notification.alertAction = L(@"download");
notification.alertBody = L(@"download_map_notification");
notification.soundName = UILocalNotificationDefaultSoundName;
notification.userInfo = @{@"Action" : DOWNLOAD_MAP_ACTION_NAME, @"Group" : @(index.m_group), @"Country" : @(index.m_country), @"Region" : @(index.m_region)};
@ -152,10 +152,10 @@ typedef void (^CompletionHandler)(UIBackgroundFetchResult);
//
// Framework & f = GetFramework();
// NSString * sizeString = [self sizeStringWithBytesCount:f.Storage().CountrySizeInBytes(self.countryIndex).second];
// NSString * downloadText = [NSString stringWithFormat:@"%@ (%@)", NSLocalizedString(@"download", nil), sizeString];
// NSString * downloadText = [NSString stringWithFormat:@"%@ (%@)", L(@"download"), sizeString];
// std::string const name = f.GetCountryName(self.countryIndex);
// NSString * title = [NSString stringWithFormat:NSLocalizedString(@"download_country_ask", nil), [NSString stringWithUTF8String:name.c_str()]];
// UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:title message:nil delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) otherButtonTitles:downloadText, nil];
// NSString * title = [NSString stringWithFormat:L(@"download_country_ask"), [NSString stringWithUTF8String:name.c_str()]];
// UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:title message:nil delegate:self cancelButtonTitle:L(@"cancel") otherButtonTitles:downloadText, nil];
// [alertView show];
// }
}
@ -171,9 +171,9 @@ typedef void (^CompletionHandler)(UIBackgroundFetchResult);
//- (NSString *)sizeStringWithBytesCount:(size_t)size
//{
// if (size > MB)
// return [NSString stringWithFormat:@"%ld %@", (size + 512 * 1024) / MB, NSLocalizedString(@"mb", nil)];
// return [NSString stringWithFormat:@"%ld %@", (size + 512 * 1024) / MB, L(@"mb")];
// else
// return [NSString stringWithFormat:@"%ld %@", (size + 1023) / 1024, NSLocalizedString(@"kb", nil)];
// return [NSString stringWithFormat:@"%ld %@", (size + 1023) / 1024, L(@"kb")];
//}
- (NSString *)flagStringForIndex:(TIndex)index

View file

@ -65,9 +65,9 @@
case location::EDenied:
{
UIAlertView * alert = [[CustomAlertView alloc] initWithTitle:nil
message:NSLocalizedString(@"location_is_disabled_long_text", @"Location services are disabled by user alert - message")
message:L(@"location_is_disabled_long_text")
delegate:nil
cancelButtonTitle:NSLocalizedString(@"ok", @"Location Services are disabled by user alert - close alert button")
cancelButtonTitle:L(@"ok")
otherButtonTitles:nil];
[alert show];
[[MapsAppDelegate theApp].m_locationManager stop:self];
@ -77,9 +77,9 @@
case location::ENotSupported:
{
UIAlertView * alert = [[CustomAlertView alloc] initWithTitle:nil
message:NSLocalizedString(@"device_doesnot_support_location_services", @"Location Services are not available on the device alert - message")
message:L(@"device_doesnot_support_location_services")
delegate:nil
cancelButtonTitle:NSLocalizedString(@"ok", @"Location Services are not available on the device alert - close alert button")
cancelButtonTitle:L(@"ok")
otherButtonTitles:nil];
[alert show];
[[MapsAppDelegate theApp].m_locationManager stop:self];
@ -564,8 +564,6 @@
if ((self = [super initWithCoder:coder]))
{
self.title = NSLocalizedString(@"back", @"Back button in nav bar to show the map");
Framework & f = GetFramework();
typedef void (*UserMarkActivatedFnT)(id, SEL, UserMarkCopy *);
@ -637,19 +635,19 @@
- (void)showDialogWithMessageID:(string const &)message
{
[[[UIAlertView alloc] initWithTitle:[NSString stringWithUTF8String:message.c_str()] message:nil delegate:self cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil] show];
[[[UIAlertView alloc] initWithTitle:[NSString stringWithUTF8String:message.c_str()] message:nil delegate:self cancelButtonTitle:L(@"ok") otherButtonTitles:nil] show];
}
- (void)showDownloaderDialogWithMessageID:(string const &)message
{
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:[NSString stringWithUTF8String:message.c_str()] message:nil delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) otherButtonTitles:NSLocalizedString(@"ok", nil), nil];
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:[NSString stringWithUTF8String:message.c_str()] message:nil delegate:self cancelButtonTitle:L(@"cancel") otherButtonTitles:L(@"ok"), nil];
alertView.tag = ALERT_VIEW_DOWNLOADER;
[alertView show];
}
- (void)showBuyProDialog
{
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"routing_failed_buy_pro", nil) message:nil delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) otherButtonTitles:NSLocalizedString(@"get_it_now", nil), nil];
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:L(@"routing_failed_buy_pro") message:nil delegate:self cancelButtonTitle:L(@"cancel") otherButtonTitles:L(@"get_it_now"), nil];
alert.tag = ALERT_VIEW_PRO_VERSION_ROUTING;
[alert show];
}
@ -730,7 +728,7 @@
UIButton * clearButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 60, 44)];
[clearButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[clearButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateHighlighted];
[clearButton setTitle:NSLocalizedString(@"clear", nil) forState:UIControlStateNormal];
[clearButton setTitle:L(@"clear") forState:UIControlStateNormal];
[clearButton addTarget:self action:@selector(clearApiMode:) forControlEvents:UIControlEventTouchUpInside];
clearButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
clearButton.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:17];
@ -793,7 +791,7 @@
}
else
{
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"bookmarks_in_pro_version", nil) message:nil delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) otherButtonTitles:NSLocalizedString(@"get_it_now", nil), nil];
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:L(@"bookmarks_in_pro_version") message:nil delegate:self cancelButtonTitle:L(@"cancel") otherButtonTitles:L(@"get_it_now"), nil];
alert.tag = ALERT_VIEW_BOOKMARKS;
[alert show];
}
@ -1185,10 +1183,10 @@ NSInteger compareAddress(id l, id r, void * context)
- (void)showAppStoreRatingMenu
{
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:@"App Store"
message:NSLocalizedString(@"appStore_message", nil)
message:L(@"appStore_message")
delegate:self
cancelButtonTitle:NSLocalizedString(@"no_thanks", nil)
otherButtonTitles:NSLocalizedString(@"ok", nil), NSLocalizedString(@"remind_me_later", nil), nil];
cancelButtonTitle:L(@"no_thanks")
otherButtonTitles:L(@"ok"), L(@"remind_me_later"), nil];
alertView.tag = ALERT_VIEW_APPSTORE;
[alertView show];
}
@ -1196,10 +1194,10 @@ NSInteger compareAddress(id l, id r, void * context)
- (void)showFacebookRatingMenu
{
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:@"Facebook"
message:NSLocalizedString(@"share_on_facebook_text", nil)
message:L(@"share_on_facebook_text")
delegate:self
cancelButtonTitle:NSLocalizedString(@"no_thanks", nil)
otherButtonTitles:NSLocalizedString(@"ok", nil), NSLocalizedString(@"remind_me_later", nil), nil];
cancelButtonTitle:L(@"no_thanks")
otherButtonTitles:L(@"ok"), L(@"remind_me_later"), nil];
alertView.tag = ALERT_VIEW_FACEBOOK;
[alertView show];
}

View file

@ -30,25 +30,25 @@ void InitLocalizedStrings()
{
Framework & f = GetFramework();
// Texts on the map screen when map is not downloaded or is downloading
f.AddString("country_status_added_to_queue", [NSLocalizedString(@"country_status_added_to_queue", @"Message to display at the center of the screen when the country is added to the downloading queue") UTF8String]);
f.AddString("country_status_downloading", [NSLocalizedString(@"country_status_downloading", @"Message to display at the center of the screen when the country is downloading") UTF8String]);
f.AddString("country_status_download_routing", [NSLocalizedString(@"country_status_download_routing", @"") UTF8String]);
f.AddString("country_status_download", [NSLocalizedString(@"country_status_download", @"Button text for the button at the center of the screen when the country is not downloaded") UTF8String]);
f.AddString("country_status_download_failed", [NSLocalizedString(@"country_status_download_failed", @"Message to display at the center of the screen when the country download has failed") UTF8String]);
f.AddString("try_again", [NSLocalizedString(@"try_again", @"Button text for the button under the country_status_download_failed message") UTF8String]);
f.AddString("country_status_added_to_queue", [L(@"country_status_added_to_queue") UTF8String]);
f.AddString("country_status_downloading", [L(@"country_status_downloading") UTF8String]);
f.AddString("country_status_download_routing", [L(@"country_status_download_routing") UTF8String]);
f.AddString("country_status_download", [L(@"country_status_download") UTF8String]);
f.AddString("country_status_download_failed", [L(@"country_status_download_failed") UTF8String]);
f.AddString("try_again", [L(@"try_again") UTF8String]);
// Default texts for bookmarks added in C++ code (by URL Scheme API)
f.AddString("dropped_pin", [NSLocalizedString(@"dropped_pin", nil) UTF8String]);
f.AddString("my_places", [NSLocalizedString(@"my_places", nil) UTF8String]);
f.AddString("my_position", [NSLocalizedString(@"my_position", nil) UTF8String]);
f.AddString("routes", [NSLocalizedString(@"routes", nil) UTF8String]);
f.AddString("dropped_pin", [L(@"dropped_pin") UTF8String]);
f.AddString("my_places", [L(@"my_places") UTF8String]);
f.AddString("my_position", [L(@"my_position") UTF8String]);
f.AddString("routes", [L(@"routes") UTF8String]);
f.AddString("routing_failed_unknown_my_position", [NSLocalizedString(@"routing_failed_unknown_my_position", nil) UTF8String]);
f.AddString("routing_failed_has_no_routing_file", [NSLocalizedString(@"routing_failed_has_no_routing_file", nil) UTF8String]);
f.AddString("routing_failed_start_point_not_found", [NSLocalizedString(@"routing_failed_start_point_not_found", nil) UTF8String]);
f.AddString("routing_failed_dst_point_not_found", [NSLocalizedString(@"routing_failed_dst_point_not_found", nil) UTF8String]);
f.AddString("routing_failed_cross_mwm_building", [NSLocalizedString(@"routing_failed_cross_mwm_building", nil) UTF8String]);
f.AddString("routing_failed_route_not_found", [NSLocalizedString(@"routing_failed_route_not_found", nil) UTF8String]);
f.AddString("routing_failed_internal_error", [NSLocalizedString(@"routing_failed_internal_error", nil) UTF8String]);
f.AddString("routing_failed_unknown_my_position", [L(@"routing_failed_unknown_my_position") UTF8String]);
f.AddString("routing_failed_has_no_routing_file", [L(@"routing_failed_has_no_routing_file") UTF8String]);
f.AddString("routing_failed_start_point_not_found", [L(@"routing_failed_start_point_not_found") UTF8String]);
f.AddString("routing_failed_dst_point_not_found", [L(@"routing_failed_dst_point_not_found") UTF8String]);
f.AddString("routing_failed_cross_mwm_building", [L(@"routing_failed_cross_mwm_building") UTF8String]);
f.AddString("routing_failed_route_not_found", [L(@"routing_failed_route_not_found") UTF8String]);
f.AddString("routing_failed_internal_error", [L(@"routing_failed_internal_error") UTF8String]);
}
@interface MapsAppDelegate()
@ -330,7 +330,7 @@ void InitLocalizedStrings()
if ([[dict objectForKey:@"Proposal"] isEqual:@"OpenGuides"])
{
self.lastGuidesUrl = [dict objectForKey:@"GuideUrl"];
UIAlertView * view = [[UIAlertView alloc] initWithTitle:[dict objectForKey:@"GuideTitle"] message:[dict objectForKey:@"GuideMessage"] delegate:self cancelButtonTitle:NSLocalizedString(@"later", nil) otherButtonTitles:NSLocalizedString(@"get_it_now", nil), nil];
UIAlertView * view = [[UIAlertView alloc] initWithTitle:[dict objectForKey:@"GuideTitle"] message:[dict objectForKey:@"GuideMessage"] delegate:self cancelButtonTitle:L(@"later") otherButtonTitles:L(@"get_it_now"), nil];
view.tag = NOTIFICATION_ALERT_VIEW_TAG;
[view show];
}
@ -378,11 +378,11 @@ void InitLocalizedStrings()
- (void)showLoadFileAlertIsSuccessful:(BOOL)successful
{
m_loadingAlertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"load_kmz_title", nil)
m_loadingAlertView = [[UIAlertView alloc] initWithTitle:L(@"load_kmz_title")
message:
(successful ? NSLocalizedString(@"load_kmz_successful", nil) : NSLocalizedString(@"load_kmz_failed", nil))
(successful ? L(@"load_kmz_successful") : L(@"load_kmz_failed"))
delegate:nil
cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil];
cancelButtonTitle:L(@"ok") otherButtonTitles:nil];
m_loadingAlertView.delegate = self;
[m_loadingAlertView show];
[NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(dismissAlert) userInfo:nil repeats:NO];

View file

@ -28,7 +28,7 @@
- (void)setFree:(BOOL)free
{
NSString * title = free ? NSLocalizedString(@"free", nil) : NSLocalizedString(@"buy", nil);
NSString * title = free ? L(@"free") : L(@"buy");
title = [title uppercaseString];
self.priceButton.width = [title sizeWithDrawSize:CGSizeMake(100, self.priceButton.height) font:self.priceButton.titleLabel.font].width + 18;
[self.priceButton setTitle:title forState:UIControlStateNormal];

View file

@ -29,7 +29,7 @@ using namespace::storage;
{
[super viewDidLoad];
self.title = NSLocalizedString(@"more_apps_guides", nil);
self.title = L(@"more_apps_guides");
guides::GuidesManager & manager = GetFramework().GetGuidesManager();
NSString * JSONPath = [NSString stringWithUTF8String:manager.GetDataFileFullPath().c_str()];
@ -58,8 +58,8 @@ using namespace::storage;
self.guideRegions = [guideRegions sortedArrayUsingDescriptors:@[[NSSortDescriptor sortDescriptorWithKey:@"Country" ascending:YES]]];
TitleMWM = @"maps.me pro";
TitleGuides = NSLocalizedString(@"more_apps_guides", nil);
TitleAds = NSLocalizedString(@"more_apps_ads", nil);
TitleGuides = L(@"more_apps_guides");
TitleAds = L(@"more_apps_ads");
[self updateData];

View file

@ -71,7 +71,7 @@
_shareButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin;
[_shareButton setBackgroundImage:image forState:UIControlStateNormal];
[_shareButton addTarget:self action:@selector(shareButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
[_shareButton setTitle:NSLocalizedString(@"share", nil) forState:UIControlStateNormal];
[_shareButton setTitle:L(@"share") forState:UIControlStateNormal];
[_shareButton setTitleColor:[UIColor colorWithColorCode:@"179E4D"] forState:UIControlStateNormal];
[_shareButton setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted];
}

View file

@ -853,7 +853,7 @@ typedef NS_ENUM(NSUInteger, CellRow)
- (NSString *)nonEmptyTitle:(string const &)name
{
return name.empty() ? NSLocalizedString(@"dropped_pin", nil) : [NSString stringWithUTF8String:name.c_str()];
return name.empty() ? L(@"dropped_pin") : [NSString stringWithUTF8String:name.c_str()];
}
- (NSString *)newBookmarkName
@ -869,7 +869,7 @@ typedef NS_ENUM(NSUInteger, CellRow)
}
else
{
self.temporaryTitle = NSLocalizedString(@"my_position", nil);
self.temporaryTitle = L(@"my_position");
return [self nonEmptyTitle:[self addressInfo].GetPinName()];
}
}
@ -901,7 +901,7 @@ typedef NS_ENUM(NSUInteger, CellRow)
_title = [[self nonEmptyTitle:[self addressInfo].GetPinName()] capitalizedString];
}
NSString * droppedPinTitle = NSLocalizedString(@"dropped_pin", nil);
NSString * droppedPinTitle = L(@"dropped_pin");
if ([_title isEqualToString:droppedPinTitle])
self.temporaryTitle = droppedPinTitle;
}
@ -954,7 +954,7 @@ typedef NS_ENUM(NSUInteger, CellRow)
{
Bookmark const * bookmark = static_cast<Bookmark const *>([self userMark]);
std::string const & description = bookmark->GetDescription();
_bookmarkDescription = description.empty() ? NSLocalizedString(@"description", nil) : [NSString stringWithUTF8String:description.c_str()];
_bookmarkDescription = description.empty() ? L(@"description") : [NSString stringWithUTF8String:description.c_str()];
}
else
{
@ -1079,7 +1079,7 @@ typedef NS_ENUM(NSUInteger, CellRow)
}
else
{
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"bookmarks_in_pro_version", nil) message:nil delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) otherButtonTitles:NSLocalizedString(@"get_it_now", nil), nil];
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:L(@"bookmarks_in_pro_version") message:nil delegate:self cancelButtonTitle:L(@"cancel") otherButtonTitles:L(@"get_it_now"), nil];
[alert show];
}
}

View file

@ -86,7 +86,7 @@
_cancelButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin;
[_cancelButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[_cancelButton setTitleColor:[UIColor colorWithWhite:1 alpha:0.5] forState:UIControlStateHighlighted];
NSString * title = NSLocalizedString(@"cancel", nil);
NSString * title = L(@"cancel");
CGFloat const titleWidth = [title sizeWithDrawSize:CGSizeMake(80, 25) font:_cancelButton.titleLabel.font].width + 2;
_cancelButton.width = MAX(titleWidth, _cancelButton.width);
[_cancelButton setTitle:title forState:UIControlStateNormal];

View file

@ -429,7 +429,7 @@ static void onSearchResultCallback(search::Results const & results)
// Country in the viewport should be downloaded
if (!f.IsCountryLoaded(f.GetViewportCenter()))
{
secondSentence = [NSString stringWithFormat:NSLocalizedString(@"download_viewport_country_to_search", nil),
secondSentence = [NSString stringWithFormat:L(@"download_viewport_country_to_search"),
[NSString stringWithUTF8String:f.GetCountryName(f.GetViewportCenter()).c_str()]];
}
else
@ -439,12 +439,12 @@ static void onSearchResultCallback(search::Results const & results)
if (lastLocation && !f.IsCountryLoaded(MercatorBounds::FromLatLon(lastLocation.coordinate.latitude,
lastLocation.coordinate.longitude)))
{
secondSentence = [NSString stringWithFormat:NSLocalizedString(@"download_location_country", nil),
secondSentence = [NSString stringWithFormat:L(@"download_location_country"),
[NSString stringWithUTF8String:f.GetCountryName(f.GetViewportCenter()).c_str()]];
}
}
NSString * message = [NSString stringWithFormat:@"%@. %@", NSLocalizedString(@"no_search_results_found", nil), secondSentence];
NSString * message = [NSString stringWithFormat:@"%@. %@", L(@"no_search_results_found"), secondSentence];
ToastView * toastView = [[ToastView alloc] initWithMessage:message];
[toastView show];
}
@ -496,7 +496,7 @@ static void onSearchResultCallback(search::Results const & results)
- (void)showBuyProMessage
{
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"search_available_in_pro_version", nil) message:nil delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", nil) otherButtonTitles:NSLocalizedString(@"get_it_now", nil), nil];
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:L(@"search_available_in_pro_version") message:nil delegate:self cancelButtonTitle:L(@"cancel") otherButtonTitles:L(@"get_it_now"), nil];
[alert show];
}
@ -520,7 +520,7 @@ static void onSearchResultCallback(search::Results const & results)
if (!customCell) // only for iOS 5
customCell = [[SearchCategoryCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[SearchCategoryCell className]];
customCell.titleLabel.text = NSLocalizedString(self.categoriesNames[indexPath.row], nil);
customCell.titleLabel.text = L(self.categoriesNames[indexPath.row]);
NSString * iconName = [NSString stringWithFormat:@"CategoryIcon%@", [self.categoriesNames[indexPath.row] capitalizedString]];
customCell.iconImageView.image = [UIImage imageNamed:iconName];
cell = customCell;
@ -532,7 +532,7 @@ static void onSearchResultCallback(search::Results const & results)
if (!customCell) // only for iOS 5
customCell = [[SearchShowOnMapCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:[SearchShowOnMapCell className]];
customCell.titleLabel.text = NSLocalizedString(@"search_on_map", nil);
customCell.titleLabel.text = L(@"search_on_map");
cell = customCell;
break;
}
@ -570,7 +570,7 @@ static void onSearchResultCallback(search::Results const & results)
search::Result const & result = [self.wrapper resultWithPosition:position];
customCell.titleLabel.text = [NSString stringWithUTF8String:result.GetString()];
customCell.iconImageView.image = [UIImage imageNamed:@"SearchCellSpotIcon"];
customCell.iconImageView.image = [UIImage imageNamed:@"SearchSpot"];
cell = customCell;
break;
}
@ -633,7 +633,7 @@ static void onSearchResultCallback(search::Results const & results)
case CellTypeCategory:
{
[[Statistics instance] logEvent:@"Category Selection" withParameters:@{@"Category" : self.categoriesNames[indexPath.row]}];
NSString * newQuery = [NSLocalizedString(self.categoriesNames[indexPath.row], nil) stringByAppendingString:@" "];
NSString * newQuery = [L(self.categoriesNames[indexPath.row]) stringByAppendingString:@" "];
self.searchBar.textField.text = newQuery;
[self search:newQuery];
@ -799,7 +799,7 @@ static void onSearchResultCallback(search::Results const & results)
_emptyResultLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.width, 60)];
_emptyResultLabel.backgroundColor = [UIColor clearColor];
_emptyResultLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:18];
_emptyResultLabel.text = NSLocalizedString(@"no_search_results_found", nil);
_emptyResultLabel.text = L(@"no_search_results_found");
_emptyResultLabel.textColor = [UIColor whiteColor];
_emptyResultLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth;
_emptyResultLabel.textAlignment = NSTextAlignmentCenter;

View file

@ -1,8 +1,10 @@
#import "ShareActionSheet.h"
#import "Framework.h"
#import <MessageUI/MFMessageComposeViewController.h>
#import <MessageUI/MFMailComposeViewController.h>
#import "Statistics.h"
#import "UIKitCategories.h"
#include "../../search/result.hpp"
@ -43,14 +45,14 @@
- (void)showFromRect:(CGRect)rect
{
UIActionSheet * as = [[UIActionSheet alloc] initWithTitle:NSLocalizedString(@"share", nil) delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil];
UIActionSheet * as = [[UIActionSheet alloc] initWithTitle:L(@"share") delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil];
if ([MFMessageComposeViewController canSendText])
[as addButtonWithTitle:NSLocalizedString(@"message", nil)];
[as addButtonWithTitle:L(@"message")];
if ([MFMailComposeViewController canSendMail] || [self canUseGmailApp])
[as addButtonWithTitle:NSLocalizedString(@"email", nil)];
[as addButtonWithTitle:NSLocalizedString(@"copy_link", nil)];
[as addButtonWithTitle:NSLocalizedString(@"cancel", nil)];
[as addButtonWithTitle:L(@"email")];
[as addButtonWithTitle:L(@"copy_link")];
[as addButtonWithTitle:L(@"cancel")];
[as setCancelButtonIndex:as.numberOfButtons - 1];
[as showFromRect:rect inView:self.viewController.view animated:YES];
}
@ -63,11 +65,11 @@
string const s = f.CodeGe0url(MercatorBounds::YToLat(self.info.gY), MercatorBounds::XToLon(self.info.gX), f.GetDrawScale(), [self.info.text UTF8String]);
NSString * shortUrl = [NSString stringWithUTF8String:s.c_str()];
if ([[as buttonTitleAtIndex:buttonIndex] isEqualToString:NSLocalizedString(@"email", nil)])
if ([[as buttonTitleAtIndex:buttonIndex] isEqualToString:L(@"email")])
[self sendEmailWithUrl:shortUrl];
else if ([[as buttonTitleAtIndex:buttonIndex] isEqualToString:NSLocalizedString(@"message", nil)])
else if ([[as buttonTitleAtIndex:buttonIndex] isEqualToString:L(@"message")])
[self sendMessageWithUrl:[shortUrl substringWithRange:NSMakeRange(0, GE0_URL_LENGTH)]];
else if ([[as buttonTitleAtIndex:buttonIndex] isEqualToString:NSLocalizedString(@"copy_link", nil)])
else if ([[as buttonTitleAtIndex:buttonIndex] isEqualToString:L(@"copy_link")])
[UIPasteboard generalPasteboard].string = shortUrl;
}
@ -87,13 +89,13 @@
search::AddressInfo info;
GetFramework().GetAddressInfoForGlobalPoint(m2::PointD(self.info.gX, self.info.gY), info);
NSString * nameAndAddress = [NSString stringWithUTF8String:info.FormatNameAndAddress().c_str()];
body = [NSString stringWithFormat:NSLocalizedString(@"my_position_share_email", nil), nameAndAddress, shortUrl, httpGe0Url];
subject = NSLocalizedString(@"my_position_share_email_subject", nil);
body = [NSString stringWithFormat:L(@"my_position_share_email"), nameAndAddress, shortUrl, httpGe0Url];
subject = L(@"my_position_share_email_subject");
}
else
{
body = [NSString stringWithFormat:NSLocalizedString(@"bookmark_share_email", nil), self.info.text, shortUrl, httpGe0Url];
subject = NSLocalizedString(@"bookmark_share_email_subject", nil);
body = [NSString stringWithFormat:L(@"bookmark_share_email"), self.info.text, shortUrl, httpGe0Url];
subject = L(@"bookmark_share_email_subject");
}
if ([MFMailComposeViewController canSendMail])
@ -118,9 +120,9 @@
NSString * httpGe0Url = [shortUrl stringByReplacingCharactersInRange:NSMakeRange(0, 6) withString:@"http://ge0.me/"];
MFMessageComposeViewController * messageVC = [[MFMessageComposeViewController alloc] init];
if (self.info.myPosition)
[messageVC setBody:[NSString stringWithFormat:NSLocalizedString(@"my_position_share_sms", nil), shortUrl, httpGe0Url]];
[messageVC setBody:[NSString stringWithFormat:L(@"my_position_share_sms"), shortUrl, httpGe0Url]];
else
[messageVC setBody:[NSString stringWithFormat:NSLocalizedString(@"bookmark_share_sms", nil), shortUrl, httpGe0Url]];
[messageVC setBody:[NSString stringWithFormat:L(@"bookmark_share_sms"), shortUrl, httpGe0Url]];
messageVC.messageComposeDelegate = self;
[self.viewController presentModalViewController:messageVC animated:YES];
}

View file

@ -16,14 +16,14 @@
{
[super viewDidLoad];
self.title = NSLocalizedString(@"maps_me_community", nil);
self.title = L(@"maps_me_community");
self.items = @[@{@"Title" : @"",
@"Items" : @[@{@"Id" : @"Facebook", @"Title" : NSLocalizedString(@"like_on_facebook", nil), @"Icon" : @"IconFacebook"},
@{@"Id" : @"Twitter", @"Title" : NSLocalizedString(@"follow_on_twitter", nil), @"Icon" : @"IconTwitter"},
@{@"Id" : @"Subscribe", @"Title" : NSLocalizedString(@"subscribe_to_news", nil), @"Icon" : @"IconSubscribe"}]},
@"Items" : @[@{@"Id" : @"Facebook", @"Title" : L(@"like_on_facebook"), @"Icon" : @"IconFacebook"},
@{@"Id" : @"Twitter", @"Title" : L(@"follow_on_twitter"), @"Icon" : @"IconTwitter"},
@{@"Id" : @"Subscribe", @"Title" : L(@"subscribe_to_news"), @"Icon" : @"IconSubscribe"}]},
@{@"Title" : @"",
@"Items" : @[@{@"Id" : @"Contact", @"Title" : NSLocalizedString(@"contact_us", nil), @"Icon" : @"IconReportABug"}]}];
@"Items" : @[@{@"Id" : @"Contact", @"Title" : L(@"contact_us"), @"Icon" : @"IconReportABug"}]}];
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
@ -89,7 +89,7 @@
- (void)subscribe
{
[self sendEmailWithText:NSLocalizedString(@"subscribe_me_body", nil) subject:NSLocalizedString(@"subscribe_me_subject", nil) toRecipient:@"subscribe@maps.me"];
[self sendEmailWithText:L(@"subscribe_me_body") subject:L(@"subscribe_me_subject") toRecipient:@"subscribe@maps.me"];
}
- (void)sendEmailWithText:(NSString *)text subject:(NSString *)subject toRecipient:(NSString *)email
@ -105,8 +105,8 @@
}
else
{
NSString * text = [NSString stringWithFormat:NSLocalizedString(@"email_error_body", nil), email];
[[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"email_error_title", nil) message:text delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil] show];
NSString * text = [NSString stringWithFormat:L(@"email_error_body"), email];
[[[UIAlertView alloc] initWithTitle:L(@"email_error_title") message:text delegate:nil cancelButtonTitle:L(@"ok") otherButtonTitles:nil] show];
}
}

View file

@ -16,7 +16,7 @@
{
m_locationManager = [[CLLocationManager alloc] init];
m_locationManager.delegate = self;
m_locationManager.purpose = NSLocalizedString(@"location_services_are_needed_desc", @"Location purpose text description");
m_locationManager.purpose = L(@"location_services_are_needed_desc");
[UIDevice currentDevice].batteryMonitoringEnabled = YES;
[self refreshAccuracy];
m_locationManager.headingFilter = 3.0;

View file

@ -31,7 +31,7 @@ typedef NS_ENUM(NSUInteger, Section)
- (void)viewDidLoad
{
[super viewDidLoad];
self.title = NSLocalizedString(@"settings", nil);
self.title = L(@"settings");
self.tableView.backgroundView = nil;
self.tableView.backgroundColor = [UIColor applicationBackgroundColor];
}
@ -43,8 +43,8 @@ typedef NS_ENUM(NSUInteger, Section)
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
GetFramework().Invalidate(true);
[super viewWillDisappear:animated];
GetFramework().Invalidate(true);
}
#pragma mark - Table view data source
@ -74,7 +74,7 @@ typedef NS_ENUM(NSUInteger, Section)
SelectableCell * customCell = (SelectableCell *)cell;
customCell.accessoryType = selected ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
customCell.titleLabel.text = indexPath.row == 0 ? NSLocalizedString(@"kilometres", nil) : NSLocalizedString(@"miles", nil);
customCell.titleLabel.text = indexPath.row == 0 ? L(@"kilometres") : L(@"miles");
}
else if (indexPath.section == SectionStatistics)
{
@ -83,7 +83,7 @@ typedef NS_ENUM(NSUInteger, Section)
bool on = true;
(void)Settings::Get("StatisticsEnabled", on);
customCell.switchButton.on = on;
customCell.titleLabel.text = NSLocalizedString(@"allow_statistics", nil);
customCell.titleLabel.text = L(@"allow_statistics");
customCell.delegate = self;
}
else if (indexPath.section == SectionZoomButtons)
@ -93,7 +93,7 @@ typedef NS_ENUM(NSUInteger, Section)
bool on = false;
(void)Settings::Get("ZoomButtonsEnabled", on);
customCell.switchButton.on = on;
customCell.titleLabel.text = NSLocalizedString(@"pref_zoom_title", nil);
customCell.titleLabel.text = L(@"pref_zoom_title");
customCell.delegate = self;
}
else if (indexPath.section == SectionCalibration)
@ -103,7 +103,7 @@ typedef NS_ENUM(NSUInteger, Section)
bool on = false;
(void)Settings::Get("CompassCalibrationEnabled", on);
customCell.switchButton.on = on;
customCell.titleLabel.text = NSLocalizedString(@"pref_calibration_title", nil);
customCell.titleLabel.text = L(@"pref_calibration_title");
customCell.delegate = self;
}
@ -113,9 +113,9 @@ typedef NS_ENUM(NSUInteger, Section)
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
{
if (section == SectionStatistics)
return NSLocalizedString(@"allow_statistics_hint", nil);
return L(@"allow_statistics_hint");
else if (section == SectionZoomButtons)
return NSLocalizedString(@"pref_zoom_summary", nil);
return L(@"pref_zoom_summary");
return nil;
}
@ -157,7 +157,7 @@ Settings::Units unitsForIndex(NSInteger index)
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
if (section == SectionMetrics)
return NSLocalizedString(@"measurement_units", nil);
return L(@"measurement_units");
else
return nil;
}

View file

@ -24,7 +24,7 @@
{
[super viewDidLoad];
self.title = NSLocalizedString(@"settings_and_more", nil);
self.title = L(@"settings_and_more");
self.deviceNames = @{@"x86_64" : @"Simulator",
@"i386" : @"Simulator",
@ -68,15 +68,15 @@
@"iPad4,6" : @"iPad Mini 2nd gen. CDMA"};
self.items = @[@{@"Title" : @"",
@"Items" : @[@{@"Id" : @"Settings", @"Title" : NSLocalizedString(@"settings", nil), @"Icon" : @"IconAppSettings"},
@{@"Id" : @"Help", @"Title" : NSLocalizedString(@"help", nil), @"Icon" : @"IconHelp"},
@{@"Id" : @"ReportBug", @"Title" : NSLocalizedString(@"report_a_bug", nil), @"Icon" : @"IconReportABug"}]},
@"Items" : @[@{@"Id" : @"Settings", @"Title" : L(@"settings"), @"Icon" : @"IconAppSettings"},
@{@"Id" : @"Help", @"Title" : L(@"help"), @"Icon" : @"IconHelp"},
@{@"Id" : @"ReportBug", @"Title" : L(@"report_a_bug"), @"Icon" : @"IconReportABug"}]},
@{@"Title" : @"",
@"Items" : @[@{@"Id" : @"Community", @"Title" : NSLocalizedString(@"maps_me_community", nil), @"Icon" : @"IconSocial"},
@{@"Id" : @"RateApp", @"Title" : NSLocalizedString(@"rate_the_app", nil), @"Icon" : @"IconRate"}]},
@"Items" : @[@{@"Id" : @"Community", @"Title" : L(@"maps_me_community"), @"Icon" : @"IconSocial"},
@{@"Id" : @"RateApp", @"Title" : L(@"rate_the_app"), @"Icon" : @"IconRate"}]},
@{@"Title" : @"",
@"Items" : @[@{@"Id" : @"About", @"Title" : NSLocalizedString(@"about_menu_title", nil), @"Icon" : @"IconAbout"},
@{@"Id" : @"Copyright", @"Title" : NSLocalizedString(@"copyright", nil), @"Icon" : @"IconCopyright"}]}];
@"Items" : @[@{@"Id" : @"About", @"Title" : L(@"about_menu_title"), @"Icon" : @"IconAbout"},
@{@"Id" : @"Copyright", @"Title" : L(@"copyright"), @"Icon" : @"IconCopyright"}]}];
}
#pragma mark - TableView
@ -161,15 +161,15 @@
{
NSString * path = [[NSBundle mainBundle] pathForResource:@"faq" ofType:@"html"];
NSString * html = [[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
WebViewController * aboutViewController = [[WebViewController alloc] initWithHtml:html baseUrl:nil andTitleOrNil:NSLocalizedString(@"help", nil)];
WebViewController * aboutViewController = [[WebViewController alloc] initWithHtml:html baseUrl:nil andTitleOrNil:L(@"help")];
aboutViewController.openInSafari = YES;
[self.navigationController pushViewController:aboutViewController animated:YES];
}
- (void)about
{
RichTextVC * vc = [[RichTextVC alloc] initWithText:NSLocalizedString(@"about_text", nil)];
vc.title = NSLocalizedString(@"about_menu_title", nil);
RichTextVC * vc = [[RichTextVC alloc] initWithText:L(@"about_text")];
vc.title = L(@"about_menu_title");
[self.navigationController pushViewController:vc animated:YES];
}
@ -178,7 +178,7 @@
string s; GetPlatform().GetReader("copyright.html")->ReadAsString(s);
NSString * str = [NSString stringWithFormat:@"Version: %@ \n", [[NSBundle mainBundle] infoDictionary][@"CFBundleVersion"]];
NSString * text = [NSString stringWithFormat:@"%@%@", str, [NSString stringWithUTF8String:s.c_str()]];
WebViewController * aboutViewController = [[WebViewController alloc] initWithHtml:text baseUrl:nil andTitleOrNil:NSLocalizedString(@"copyright", nil)];
WebViewController * aboutViewController = [[WebViewController alloc] initWithHtml:text baseUrl:nil andTitleOrNil:L(@"copyright")];
aboutViewController.openInSafari = YES;
[self.navigationController pushViewController:aboutViewController animated:YES];
}
@ -218,8 +218,8 @@
}
else
{
NSString * text = [NSString stringWithFormat:NSLocalizedString(@"email_error_body", nil), email];
[[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"email_error_title", nil) message:text delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) otherButtonTitles:nil] show];
NSString * text = [NSString stringWithFormat:L(@"email_error_body"), email];
[[[UIAlertView alloc] initWithTitle:L(@"email_error_title") message:text delegate:nil cancelButtonTitle:L(@"ok") otherButtonTitles:nil] show];
}
}