Localization support. Change many names in NJKeyInputField to standard keyboard short...
[enjoyable.git] / Classes / NJMappingMenuController.m
index 0fa6183..03ce31d 100644 (file)
@@ -52,8 +52,8 @@
 }
 
 - (void)mappingsListDidChange:(NSNotification *)note {
-    NSArray *mappings = note.userInfo[@"mappings"];
-    NJMapping *currentMapping = note.userInfo[@"mapping"];
+    NSArray *mappings = note.userInfo[NJMappingListKey];
+    NJMapping *currentMapping = note.userInfo[NJMappingKey];
     NSMenuItem *toRemove;
     while (self.menu.numberOfItems > self.firstMappingIndex
            && (toRemove = [self.menu itemAtIndex:self.firstMappingIndex])
@@ -76,7 +76,8 @@
         [self.menu insertItem:item atIndex:index++];
         if (added == MAXIMUM_MAPPINGS_IN_MENU
             && mappings.count > MAXIMUM_MAPPINGS_IN_MENU + 1) {
-            NSString *msg = [NSString stringWithFormat:@"(and %lu moreā€¦)",
+            NSString *msg = [NSString stringWithFormat:NSLocalizedString(@"mapping overflow %lu",
+                                                                         @"menu item when mappings list overflows"),
                              mappings.count - MAXIMUM_MAPPINGS_IN_MENU];
             NSMenuItem *end = [[NSMenuItem alloc] initWithTitle:msg
                                                          action:@selector(_mappingListWasChosen:)
 }
 
 - (void)mappingDidChange:(NSNotification *)note {
-    NJMapping *mapping = note.userInfo[@"mapping"];
+    NJMapping *mapping = note.userInfo[NJMappingKey];
     for (NSMenuItem *item in self.menu.itemArray)
         if ([item.representedObject isKindOfClass:NJMapping.class])
             item.state = mapping == item.representedObject;
 }
 
 - (void)eventTranslationActivated:(NSNotification *)note {
-    self.eventTranslationToggle.title = @"Disable";
+    self.eventTranslationToggle.title = NSLocalizedString(@"Disable",
+                                                          @"menu item text to disable event translation");
 }
 
 - (void)eventTranslationDeactivated:(NSNotification *)note {
-    self.eventTranslationToggle.title = @"Enable";    
+    self.eventTranslationToggle.title = NSLocalizedString(@"Enable",
+                                                          @"menu item text to enable event translation");
 }
 
-
-
 @end