[ios] Updated English strings in UI

This commit is contained in:
Alex Zolotarev 2011-12-06 03:42:35 +03:00 committed by Alex Zolotarev
parent 467fd47108
commit eb3ddc9a60
6 changed files with 73 additions and 62 deletions

View file

@ -56,6 +56,10 @@ static bool ShouldCheckAgain()
{
searchButton.hidden = NO;
// Display banner
// @TODO Paid version is available one-time banner dialog for free version
// NSLocalizedString(@"A paid version of MapsWithMe, featuring search, is available for download. Would you like to get it now?", @"Paid version has become available one-time dialog title in the free version")
// NSLocalizedString(@"Get it now", @"Paid version has become available one-time dialog Positive button in the free version")
// NSLocalizedString(@"Cancel", @"Paid version has become available one-time dialog Negative button in the free version")
}
}

View file

@ -3,7 +3,8 @@
#include "../../../storage/storage.hpp"
@interface CountriesViewController
: UIViewController <UINavigationBarDelegate, UITableViewDelegate, UITableViewDataSource, UIActionSheetDelegate>
: UIViewController <UINavigationBarDelegate, UITableViewDelegate, UITableViewDataSource,
UIActionSheetDelegate, UIAlertViewDelegate>
{
storage::Storage * m_storage;
storage::TIndex m_index;

View file

@ -264,6 +264,44 @@ UITableViewCell * g_clickedCell = nil;
}
}
- (void) showDownloadCountryConfirmation:(NSString *)countryName withSize:(LocalAndRemoteSizeT::first_type)size fromRect:(CGRect)rect
{
// display confirmation popup with country size
// convert size to human readable values
NSString * strDownload = nil;
if (size > MB)
{
size /= MB;
strDownload = [NSString stringWithFormat:NSLocalizedString(@"Download %qu MB", @"Settings/Downloader - Download confirmation button"), size];
}
else
{
size = (size + 999) / 1000;
strDownload = [NSString stringWithFormat:NSLocalizedString(@"Download %qu kB", @"Settings/Downloader - Download confirmation button"), size];
}
UIActionSheet * popupQuery = [[UIActionSheet alloc]
initWithTitle: countryName
delegate: self
cancelButtonTitle: NSLocalizedString(@"Cancel", @"Settings/Downloader - Download confirmation Cancel button")
destructiveButtonTitle: nil
otherButtonTitles: strDownload, nil];
[popupQuery showFromRect: rect inView: self.view animated: YES];
[popupQuery release];
}
// 3G warning confirmation handler
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
{
if (buttonIndex != alertView.cancelButtonIndex)
{
LocalAndRemoteSizeT const sizePair = m_storage->CountrySizeInBytes(g_clickedIndex);
LocalAndRemoteSizeT::first_type const size = sizePair.second - sizePair.first;
[self showDownloadCountryConfirmation:[[g_clickedCell textLabel] text] withSize:size fromRect:[g_clickedCell frame]];
}
}
- (void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath
{
// deselect the current row (don't keep the table selection persistent)
@ -281,7 +319,7 @@ UITableViewCell * g_clickedCell = nil;
{
NSString * countryName = [[cell textLabel] text];
// pass parameters to dialog handler
// pass parameters to dialog handlers
g_clickedIndex = index;
g_clickedCell = cell;
@ -291,11 +329,11 @@ UITableViewCell * g_clickedCell = nil;
{
// display confirmation popup
UIActionSheet * popupQuery = [[[UIActionSheet alloc]
initWithTitle: countryName
delegate: self
cancelButtonTitle: NSLocalizedString(@"Cancel", @"Settings/Downloader - Delete country dialog - Cancel deletion button")
destructiveButtonTitle: NSLocalizedString(@"Delete", @"Settings/Downloader - Delete country dialog - Confirm deletion button")
otherButtonTitles: nil] autorelease];
initWithTitle: countryName
delegate: self
cancelButtonTitle: NSLocalizedString(@"Cancel", @"Settings/Downloader - Delete country dialog - Cancel deletion button")
destructiveButtonTitle: NSLocalizedString(@"Delete", @"Settings/Downloader - Delete country dialog - Confirm deletion button")
otherButtonTitles: nil] autorelease];
[popupQuery showFromRect: [cell frame] inView: tableView animated: YES];
}
break;
@ -303,7 +341,7 @@ UITableViewCell * g_clickedCell = nil;
case EDownloadFailed:
{
LocalAndRemoteSizeT const sizePair = m_storage->CountrySizeInBytes(index);
LocalAndRemoteSizeT::first_type size = sizePair.second - sizePair.first;
LocalAndRemoteSizeT::first_type const size = sizePair.second - sizePair.first;
// check for disk free space first
if (FreeDiskSpaceInBytes() < (size + 1024*1024))
@ -311,7 +349,7 @@ UITableViewCell * g_clickedCell = nil;
[[[[CustomAlertView alloc] initWithTitle:NSLocalizedString(@"There is not enough free disk space", @"Settings/Downloader - No free space dialog title")
message:[NSString stringWithFormat:NSLocalizedString(@"Please free some space on your device first in order to download %@", @"Settings/Downloader - No free space dialog message"), countryName]
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Ok", @"Settings/Downloader - No free space dialog close button")
cancelButtonTitle:NSLocalizedString(@"OK", @"Settings/Downloader - No free space dialog close button")
otherButtonTitles:nil] autorelease] show];
break;
}
@ -320,46 +358,23 @@ UITableViewCell * g_clickedCell = nil;
if (connType == ENotConnected)
{ // do not initiate any download
[[[[CustomAlertView alloc] initWithTitle:NSLocalizedString(@"No Internet connection detected", @"Settings/Downloader - No internet connection dialog title")
message:NSLocalizedString(@"We recommend using WiFi to download larger countries", @"Settings/Downloader - No internet connection dialog message")
message:NSLocalizedString(@"We recommend using WiFi to download large maps", @"Settings/Downloader - No internet connection dialog message")
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Ok", @"Settings/Downloader - No internet connection dialog close button")
cancelButtonTitle:NSLocalizedString(@"OK", @"Settings/Downloader - No internet connection dialog close button")
otherButtonTitles:nil] autorelease] show];
}
else
{
if (connType == EConnectedBy3G && size > MAX_3G_MEGABYTES * MB)
{ // If user uses 3G, do not allow him to download large countries
[[[[CustomAlertView alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@"%@ is too large to download over 3G", @"Settings/Downloader - 3G download warning dialog title"), countryName]
message:NSLocalizedString(@"Please use WiFi connection to download larger countries", @"Settings/Downloader - 3G download warning dialog message")
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Ok", @"Settings/Downloader - 3G download warning dialog close button")
otherButtonTitles:nil] autorelease] show];
{ // If user uses 3G, show warning to him before downloading country
[[[[CustomAlertView alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@"No WiFi connection detected. Would you like to use cellular data (GPRS, EDGE or 3G) to download %@?", @"Settings/Downloader - 3G download warning dialog title"), countryName]
message:nil
delegate:self
cancelButtonTitle:NSLocalizedString(@"Cancel", @"Settings/Downloader - 3G download warning dialog cancel button")
otherButtonTitles:NSLocalizedString(@"Use cellular data", @"Settings/Downloader - 3G download warning dialog confirm button"), nil] autorelease] show];
}
else
{
// display confirmation popup with country size
// convert size to human readable values
NSString * strDownload = nil;
if (size > MB)
{
size /= MB;
strDownload = [NSString stringWithFormat:NSLocalizedString(@"Download %qu MB", @"Settings/Downloader - Download confirmation button"), size];
}
else
{
size = (size + 999) / 1000;
strDownload = [NSString stringWithFormat:NSLocalizedString(@"Download %qu kB", @"Settings/Downloader - Download confirmation button"), size];
}
UIActionSheet * popupQuery = [[UIActionSheet alloc]
initWithTitle: countryName
delegate: self
cancelButtonTitle: NSLocalizedString(@"Cancel", @"Settings/Downloader - Download confirmation Cancel button")
destructiveButtonTitle: nil
otherButtonTitles: strDownload, nil];
[popupQuery showFromRect: [cell frame] inView: tableView animated: YES];
[popupQuery release];
}
[self showDownloadCountryConfirmation:countryName withSize:size fromRect:[cell frame]];
}
}
break;

View file

@ -47,8 +47,8 @@
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Which measurement system do you prefer?", @"Choose measurement on first launch alert - title")
message:nil
delegate:d cancelButtonTitle:nil
otherButtonTitles:NSLocalizedString(@"US (ft/mi)", @"Choose measurement on first launch alert - choose metric system button"),
NSLocalizedString(@"Metric (m/km)", @"Choose measurement on first launch alert - choose metric system button"), nil];
otherButtonTitles:NSLocalizedString(@"Miles", @"Choose measurement on first launch alert - choose imperial system button"),
NSLocalizedString(@"Kilometres", @"Choose measurement on first launch alert - choose metric system button"), nil];
[alert show];
[alert release];
}

View file

@ -10,12 +10,11 @@
using namespace storage;
// @TODO Write Review dialog
// NSLocalizedString(@"Leave a review", @"Leave Review dialog title")
// NSLocalizedString(@"If you like MapsWithMe, please support us with a review. If you want to complain then please visit our support site", @"Leave Review dialog message")
// NSLocalizedString(@"Write a review", @"Leave Review dialog - Review button")
// NSLocalizedString(@"Complain", @"Leave Review dialog - Complain button (goes to support site)")
// NSLocalizedString(@"Not now", @"Leave Review dialog - Not now button (remond me later)")
// NSLocalizedString(@"Dismiss", @"Leave Review dialog - Dismiss forever button")
// NSLocalizedString(@"If you like MapsWithMe, please support us by writing a review. If you face any issues, please let us know by filling in a speacial form.", @"Leave Review dialog title")
// NSLocalizedString(@"Leave a review", @"Leave Review dialog - Review button")
// NSLocalizedString(@"Report an issue", @"Leave Review dialog - Complain button (goes to support site)")
// NSLocalizedString(@"Remind me later", @"Leave Review dialog - Not now button (remond me later)")
// NSLocalizedString(@"Do not ask me again", @"Leave Review dialog - Dismiss forever button")
// @TODO Buttons in main maps view
// NSLocalizedString(@"Maps", @"View and button titles for accessibility")
@ -27,18 +26,10 @@ using namespace storage;
// NSLocalizedString(@"Zoom to the country", @"View and button titles for accessibility")
// @TODO Search button banner dialog for free version
// NSLocalizedString(@"Search feature", @"Search button pressed dialog title in the free version")
// NSLocalizedString(@"Search is available in the paid version of MapsWithMe. Upgrade now!", @"Search button pressed dialog message in the free version")
// NSLocalizedString(@"Go to the AppStore", @"Search button pressed dialog Positive button in the free version")
// NSLocalizedString(@"Search is only available in the full version of MapsWithMe. Would you like to get it now?", @"Search button pressed dialog title in the free version")
// NSLocalizedString(@"Get it now", @"Search button pressed dialog Positive button in the free version")
// NSLocalizedString(@"Cancel", @"Search button pressed dialog Negative button in the free version")
// @TODO Paid version is available one-time banner dialog for free version
// NSLocalizedString(@"MapsWithMe now with Search capabilities", @"Paid version has become available one-time dialog title in the free version")
// NSLocalizedString(@"Now you can install MapsWithMe with Search!", @"Paid version has become available one-time dialog message in the free version")
// NSLocalizedString(@"Visit AppStore", @"Paid version has become available one-time dialog Positive button in the free version")
// NSLocalizedString(@"Not Now", @"Paid version has become available one-time dialog Negative button in the free version")
// Settings are always present globally
@implementation SettingsManager
@ -104,10 +95,10 @@ using namespace storage;
if (framework->NeedToDeleteOldMaps())
{
UIActionSheet * dialog = [[UIActionSheet alloc]
initWithTitle:NSLocalizedString(@"MapsWithMe have enhanced the map data and made it far more accessible. For example, with larger countries, you can now choose to download only the region/state that you need. However, to use the new maps you should delete any older map data previously downloaded.", @"Downloader/Upgrade dialog message")
initWithTitle:NSLocalizedString(@"We've updated the map data and made it smaller. With larger countries, you can now choose to download only the region/state that you need. However, to use the new maps you should delete any older map data previously downloaded.", @"Downloader/Upgrade dialog title")
delegate:self
cancelButtonTitle:NSLocalizedString(@"Do nothing at the moment", @"Downloader/Upgrade Cancel button")
destructiveButtonTitle:NSLocalizedString(@"Delete old and download new maps", @"Downloader/Upgrade OK button")
cancelButtonTitle:NSLocalizedString(@"Cancel", @"Downloader/Upgrade Cancel button")
destructiveButtonTitle:NSLocalizedString(@"Delete old maps and proceed", @"Downloader/Upgrade OK button")
otherButtonTitles:nil];
[dialog showInView:m_navigationController.view];
[dialog release];