Permalink
Browse files

Various localization improvements

Added localization comments
Removed localization shorthands, replaced with full English sentences
  • Loading branch information...
0xe1f committed Oct 22, 2013
1 parent a944762 commit 9117692b3b6a5267c9139794cf4784f0348de7ef
View
@@ -83,7 +83,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath
- (void)disableScreenSaver
{
- CFStringRef reasonForActivity = (__bridge CFStringRef)CMLoc(@"CocoaMSX is running");
+ CFStringRef reasonForActivity = (__bridge CFStringRef)CMLoc(@"CocoaMSX is running", @"");
if (self->preventSleepAssertionID != kIOPMNullAssertionID)
return;
View
@@ -134,23 +134,23 @@ + (CMMSXJoystick *)twoButtonJoystick
[joystick mapButtonWithPortOneVirtualCode:EC_JOY1_BUTTON1
portTwoVirtualCode:EC_JOY2_BUTTON1
- label:CMLoc(@"JoyButtonOne")];
+ label:CMLoc(@"Button 1", @"Joystick button")];
[joystick mapButtonWithPortOneVirtualCode:EC_JOY1_BUTTON2
portTwoVirtualCode:EC_JOY2_BUTTON2
- label:CMLoc(@"JoyButtonTwo")];
+ label:CMLoc(@"Button 2", @"Joystick button")];
[joystick mapButtonWithPortOneVirtualCode:EC_JOY1_UP
portTwoVirtualCode:EC_JOY2_UP
- label:CMLoc(@"JoyUp")];
+ label:CMLoc(@"Up", @"Joystick button")];
[joystick mapButtonWithPortOneVirtualCode:EC_JOY1_DOWN
portTwoVirtualCode:EC_JOY2_DOWN
- label:CMLoc(@"JoyDown")];
+ label:CMLoc(@"Down", @"Joystick button")];
[joystick mapButtonWithPortOneVirtualCode:EC_JOY1_LEFT
portTwoVirtualCode:EC_JOY2_LEFT
- label:CMLoc(@"JoyLeft")];
+ label:CMLoc(@"Left", @"Joystick button")];
[joystick mapButtonWithPortOneVirtualCode:EC_JOY1_RIGHT
portTwoVirtualCode:EC_JOY2_RIGHT
- label:CMLoc(@"JoyRight")];
+ label:CMLoc(@"Right", @"Joystick button")];
return [joystick autorelease];
}
View
@@ -194,7 +194,7 @@ + (void)initialize
forKey:layoutName];
// Localization labels...
- [layoutLabels setObject:CMLoc([layoutData objectForKey:@"nameLocalization"])
+ [layoutLabels setObject:CMLoc([layoutData objectForKey:@"name"], @"")
forKey:layoutName];
// Build a dictionary of each machine's layout
@@ -370,7 +370,7 @@ + (NSString *)categoryLabelForVirtualCode:(NSInteger)keyCode
return nil;
NSString *localizationId = [NSString stringWithFormat:@"KeyCategory%@", categoryName];
- return CMLoc(localizationId);
+ return CMLoc(localizationId, @"");
}
+ (NSArray *)availableLayoutNames
@@ -88,7 +88,7 @@ - (void)main
success = NO;
error = [NSError errorWithDomain:@"org.akop.CocoaMSX"
code:CMErrorCritical
- userInfo:[NSMutableDictionary dictionaryWithObject:@"ErrorDownloadCritical"
+ userInfo:[NSMutableDictionary dictionaryWithObject:@"Could not complete download - an unexpected error occurred."
forKey:NSLocalizedDescriptionKey]];
}
@@ -121,7 +121,7 @@ - (BOOL)downloadAndInstallMachine:(NSError **)error
{
*error = [NSError errorWithDomain:@"org.akop.CocoaMSX"
code:CMErrorDownloading
- userInfo:[NSMutableDictionary dictionaryWithObject:@"ErrorDownloadingMachine"
+ userInfo:[NSMutableDictionary dictionaryWithObject:@"An error occurred during download."
forKey:NSLocalizedDescriptionKey]];
}
@@ -155,7 +155,7 @@ - (BOOL)downloadAndInstallMachine:(NSError **)error
{
*error = [NSError errorWithDomain:@"org.akop.CocoaMSX"
code:CMErrorDownloading
- userInfo:[NSMutableDictionary dictionaryWithObject:@"ErrorDownloadingMachine"
+ userInfo:[NSMutableDictionary dictionaryWithObject:@"An error occurred during download."
forKey:NSLocalizedDescriptionKey]];
}
@@ -176,7 +176,7 @@ - (BOOL)downloadAndInstallMachine:(NSError **)error
#endif
*error = [NSError errorWithDomain:@"org.akop.CocoaMSX"
code:CMErrorVerifyingHash
- userInfo:[NSMutableDictionary dictionaryWithObject:@"ErrorVerifyingHash"
+ userInfo:[NSMutableDictionary dictionaryWithObject:@"Could not verify download."
forKey:NSLocalizedDescriptionKey]];
}
@@ -195,7 +195,7 @@ - (BOOL)downloadAndInstallMachine:(NSError **)error
{
*error = [NSError errorWithDomain:@"org.akop.CocoaMSX"
code:CMErrorWriting
- userInfo:[NSMutableDictionary dictionaryWithObject:@"ErrorWritingMachine"
+ userInfo:[NSMutableDictionary dictionaryWithObject:@"An error occurred while writing the downloaded machine."
forKey:NSLocalizedDescriptionKey]];
}
View
@@ -6,7 +6,7 @@
#import <Cocoa/Cocoa.h>
#endif
-#define CMLoc(x) NSLocalizedString((x), nil)
+#define CMLoc(sentence, comment) NSLocalizedString(sentence, comment)
#define CMGetIntPref(key) [[NSUserDefaults standardUserDefaults] integerForKey:key]
#define CMSetIntPref(key, value) [[NSUserDefaults standardUserDefaults] setInteger:value forKey:key]
#define CMGetObjPref(key) [[NSUserDefaults standardUserDefaults] objectForKey:key]
@@ -123,7 +123,7 @@ - (void)windowDidLoad
NSDictionary* infoDict = [[NSBundle mainBundle] infoDictionary];
NSString* version = [infoDict objectForKey:@"CFBundleShortVersionString"];
- versionNumberField.stringValue = [NSString stringWithFormat:CMLoc(@"VersionAbout"),
+ versionNumberField.stringValue = [NSString stringWithFormat:CMLoc(@"Version %@", @""),
version];
NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
@@ -219,31 +219,31 @@ - (void)updateStateVisuals
switch(currentState)
{
case STATE_CENTER:
- [directionField setStringValue:CMLoc(@"Release the directional controls then press any button")];
+ [directionField setStringValue:CMLoc(@"Release the directional controls then press any button", @"")];
break;
case STATE_PRESS_UP:
- [directionField setStringValue:CMLoc(@"Press Up")];
+ [directionField setStringValue:CMLoc(@"Press Up", @"")];
break;
case STATE_PRESS_DOWN:
- [directionField setStringValue:CMLoc(@"Press Down")];
+ [directionField setStringValue:CMLoc(@"Press Down", @"")];
break;
case STATE_PRESS_LEFT:
- [directionField setStringValue:CMLoc(@"Press Left")];
+ [directionField setStringValue:CMLoc(@"Press Left", @"")];
break;
case STATE_PRESS_RIGHT:
- [directionField setStringValue:CMLoc(@"Press Right")];
+ [directionField setStringValue:CMLoc(@"Press Right", @"")];
break;
case STATE_PRESS_BUTTON_A:
- [directionField setStringValue:CMLoc(@"Press button A")];
+ [directionField setStringValue:CMLoc(@"Press Button A", @"")];
break;
case STATE_PRESS_BUTTON_B:
- [directionField setStringValue:CMLoc(@"Press button B")];
+ [directionField setStringValue:CMLoc(@"Press Button B", @"")];
break;
case STATE_INVALID:
- [directionField setStringValue:CMLoc(@"Configuration canceled.")];
+ [directionField setStringValue:CMLoc(@"Configuration canceled.", @"")];
break;
case STATE_DONE:
- [directionField setStringValue:CMLoc(@"Configuration complete.")];
+ [directionField setStringValue:CMLoc(@"Configuration complete.", @"")];
break;
}
@@ -614,9 +614,9 @@ - (NSArray *)inputDeviceLayouts
- (void)updateFps:(CGFloat)fps
{
if (emulatorGetState() == EMU_PAUSED)
- self.fpsDisplay = CMLoc(@"MsxIsPaused");
+ [self setFpsDisplay:CMLoc(@"MSX Paused", @"")];
else
- self.fpsDisplay = [NSString stringWithFormat:CMLoc(@"Fps_f"), fps];
+ [self setFpsDisplay:[NSString stringWithFormat:CMLoc(@"FPS: %.02f", @""), fps]];
}
- (void)setScanlines:(NSInteger)value
@@ -1008,7 +1008,7 @@ - (void)insertCartridgeIntoSlot:(NSInteger)slot
NSOpenPanel* panel = [NSOpenPanel openPanel];
- [panel setTitle:CMLoc(@"InsertCartridge")];
+ [panel setTitle:CMLoc(@"Insert Cartridge", @"")];
[panel setCanChooseFiles:YES];
[panel setCanChooseDirectories:NO];
[panel setCanCreateDirectories:YES];
@@ -1122,13 +1122,13 @@ - (BOOL)toggleEjectCartridgeMenuItemStatus:(NSMenuItem*)menuItem
if (displayName)
{
- menuItem.title = [NSString stringWithFormat:CMLoc(@"EjectMedia_f"),
- displayName];
+ [menuItem setTitle:[NSString stringWithFormat:CMLoc(@"Eject %@", @""), displayName]];
return YES;
}
}
- menuItem.title = CMLoc(@"EjectCartridge");
+ [menuItem setTitle:CMLoc(@"Eject Cartridge", @"")];
+
return NO;
}
@@ -1258,13 +1258,12 @@ - (BOOL)toggleEjectDiskMenuItemStatus:(NSMenuItem*)menuItem
if (displayName)
{
- menuItem.title = [NSString stringWithFormat:CMLoc(@"EjectMedia_f"),
- displayName];
+ [menuItem setTitle:[NSString stringWithFormat:CMLoc(@"Eject %@", @""), displayName]];
return YES;
}
}
- menuItem.title = CMLoc(@"EjectDisk");
+ menuItem.title = CMLoc(@"Eject Disk", @"");
return NO;
}
@@ -1276,14 +1275,12 @@ - (BOOL)toggleEjectCassetteMenuItemStatus:(NSMenuItem*)menuItem
if (displayName)
{
- menuItem.title = [NSString stringWithFormat:CMLoc(@"EjectMedia_f"),
- displayName];
-
+ [menuItem setTitle:[NSString stringWithFormat:CMLoc(@"Eject %@", @""), displayName]];
return YES;
}
}
- menuItem.title = CMLoc(@"EjectCassette");
+ menuItem.title = CMLoc(@"Eject Cassette", @"");
return NO;
}
@@ -1615,7 +1612,7 @@ - (void)insertDiskSlot1:(id)sender
if (![self isInitialized])
return;
- [self showOpenFileDialogWithTitle:CMLoc(@"InsertDisk")
+ [self showOpenFileDialogWithTitle:CMLoc(@"Insert Disk", @"Dialog title")
allowedFileTypes:openDiskFileTypes
openInDirectory:[[CMPreferences preferences] diskDirectory]
canChooseDirectories:YES
@@ -1634,7 +1631,7 @@ - (void)insertDiskSlot2:(id)sender
if (![self isInitialized])
return;
- [self showOpenFileDialogWithTitle:CMLoc(@"InsertDisk")
+ [self showOpenFileDialogWithTitle:CMLoc(@"Insert Disk", @"Dialog title")
allowedFileTypes:openDiskFileTypes
openInDirectory:[[CMPreferences preferences] diskDirectory]
canChooseDirectories:YES
@@ -1669,7 +1666,7 @@ - (void)insertCassette:(id)sender
if (![self isInitialized])
return;
- [self showOpenFileDialogWithTitle:CMLoc(@"InsertCassette")
+ [self showOpenFileDialogWithTitle:CMLoc(@"Insert Cassette", @"Dialog title")
allowedFileTypes:openCassetteFileTypes
openInDirectory:[[CMPreferences preferences] cassetteDirectory]
canChooseDirectories:NO
@@ -1791,7 +1788,7 @@ - (void)loadState:(id)sender
if (emulatorState != EMU_RUNNING && emulatorState != EMU_PAUSED)
return;
- [self showOpenFileDialogWithTitle:CMLoc(@"LoadSnapshot")
+ [self showOpenFileDialogWithTitle:CMLoc(@"Load Snapshot", @"Dialog title")
allowedFileTypes:stateFileTypes
openInDirectory:[[CMPreferences preferences] snapshotDirectory]
completionHandler:^(NSString *file, NSString *path)
@@ -1814,7 +1811,7 @@ - (void)saveState:(id)sender
emulatorSuspend();
- [self showSaveFileDialogWithTitle:CMLoc(@"SaveSnapshot")
+ [self showSaveFileDialogWithTitle:CMLoc(@"Save Snapshot", @"Dialog title")
allowedFileTypes:stateFileTypes
openInDirectory:[[CMPreferences preferences] snapshotDirectory]
completionHandler:^(NSString *file, NSString *path)
@@ -1837,7 +1834,7 @@ - (void)saveScreenshot:(id)sender
emulatorSuspend();
- [self showSaveFileDialogWithTitle:CMLoc(@"SaveScreenshot")
+ [self showSaveFileDialogWithTitle:CMLoc(@"Save Screenshot", @"Dialog title")
allowedFileTypes:[NSArray arrayWithObjects:@"png", nil]
completionHandler:^(NSString *file, NSString *path)
{
@@ -1868,7 +1865,7 @@ - (void)recordAudio:(id)sender
{
emulatorSuspend();
- [self showSaveFileDialogWithTitle:CMLoc(@"CaptureAudio")
+ [self showSaveFileDialogWithTitle:CMLoc(@"Record Audio", @"Dialog title")
allowedFileTypes:captureAudioTypes
openInDirectory:[CMPreferences preferences].audioCaptureDirectory
completionHandler:^(NSString *file, NSString *path)
@@ -1920,7 +1917,7 @@ - (void)openGameplayRecording:(id)sender
emulatorSuspend();
- [self showOpenFileDialogWithTitle:CMLoc(@"LoadGameplayRecording")
+ [self showOpenFileDialogWithTitle:CMLoc(@"Load Gameplay Recording", @"Dialog title")
allowedFileTypes:captureGameplayTypes
openInDirectory:[CMPreferences preferences].videoCaptureDirectory
completionHandler:^(NSString *file, NSString *path)
@@ -1954,7 +1951,7 @@ - (void)saveGameplayRecording:(id)sender
{
emulatorSuspend();
- [self showSaveFileDialogWithTitle:CMLoc(@"SaveGameplayRecording")
+ [self showSaveFileDialogWithTitle:CMLoc(@"Save Gameplay Recording", @"Dialog title")
allowedFileTypes:captureGameplayTypes
openInDirectory:[CMPreferences preferences].videoCaptureDirectory
completionHandler:^(NSString *file, NSString *path)
@@ -1970,11 +1967,11 @@ - (void)saveGameplayRecording:(id)sender
if (error)
{
- NSString *message = [NSString stringWithFormat:CMLoc(@"CouldNotSaveFileToDisk_f"),
+ NSString *message = [NSString stringWithFormat:CMLoc(@"An error occurred while attempting to save to \"%@\".", @""),
file];
NSAlert *alert = [NSAlert alertWithMessageText:message
- defaultButton:CMLoc(@"OK")
+ defaultButton:CMLoc(@"OK", @"")
alternateButton:nil
otherButton:nil
informativeTextWithFormat:@""];
@@ -2539,9 +2536,9 @@ - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
else if (item.action == @selector(toggleFullScreen:))
{
if ([self isInFullScreenMode])
- menuItem.title = CMLoc(@"ExitFullscreen");
+ [menuItem setTitle:CMLoc(@"Exit Full Screen", @"")];
else
- menuItem.title = CMLoc(@"EnterFullscreen");
+ [menuItem setTitle:CMLoc(@"Enter Full Screen", @"")];
}
else if (item.action == @selector(loadState:))
{
@@ -2554,15 +2551,15 @@ - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
else if (item.action == @selector(statusMsx:))
{
if (machineState == EMU_RUNNING)
- menuItem.title = CMLoc(@"MsxIsRunning");
+ [menuItem setTitle:CMLoc(@"MSX Running", @"Menu item title")];
else if (machineState == EMU_PAUSED)
- menuItem.title = CMLoc(@"MsxIsPaused");
+ [menuItem setTitle:CMLoc(@"MSX Paused", @"Menu item title")];
else if (machineState == EMU_SUSPENDED)
- menuItem.title = CMLoc(@"MsxIsSuspended");
+ [menuItem setTitle:CMLoc(@"MSX Suspended", @"Menu item title")];
else if (machineState == EMU_STOPPED)
- menuItem.title = CMLoc(@"MsxIsOff");
+ [menuItem setTitle:CMLoc(@"MSX Powered Off", @"Menu item title")];
else
- menuItem.title = CMLoc(@"MsxIsUnknown");
+ [menuItem setTitle:CMLoc(@"MSX State Unknown", @"Menu item title")];
return NO; // always disabled
}
@@ -2575,16 +2572,16 @@ - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
else if (item.action == @selector(shutDownMsx:))
{
if (isRunning)
- menuItem.title = CMLoc(@"ShutDown");
+ [menuItem setTitle:CMLoc(@"Shut Down", @"Menu item title")];
else
- menuItem.title = CMLoc(@"StartUp");
+ [menuItem setTitle:CMLoc(@"Start Up", @"Menu item title")];
}
else if (item.action == @selector(pauseMsx:))
{
if (machineState == EMU_PAUSED)
- menuItem.title = CMLoc(@"Resume");
+ [menuItem setTitle:CMLoc(@"Resume", @"Menu item title")];
else
- menuItem.title = CMLoc(@"Pause");
+ [menuItem setTitle:CMLoc(@"Pause", @"Menu item title")];
return isRunning;
}
@@ -2599,9 +2596,9 @@ - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
else if (item.action == @selector(recordAudio:))
{
if (!mixerIsLogging(mixer))
- menuItem.title = CMLoc(@"RecordAudioEll");
+ [menuItem setTitle:CMLoc(@"Record Audio…", @"Menu item title")];
else
- menuItem.title = CMLoc(@"StopRecording");
+ [menuItem setTitle:CMLoc(@"Stop Recording", @"Menu item title")];
return isRunning;
}
Oops, something went wrong.

0 comments on commit 9117692

Please sign in to comment.