project_files/HedgewarsMobile/Classes/AboutViewController.m
branchios-revival
changeset 11308 92b023095153
parent 11307 72c46b4923c4
child 11549 893722a2a1f9
--- a/project_files/HedgewarsMobile/Classes/AboutViewController.m	Thu Nov 05 05:33:24 2015 +0100
+++ b/project_files/HedgewarsMobile/Classes/AboutViewController.m	Thu Nov 05 21:54:19 2015 +0100
@@ -27,7 +27,10 @@
     return rotationManager(interfaceOrientation);
 }
 
--(void) viewDidLoad {
+-(void) viewDidLoad
+{
+    [super viewDidLoad];
+    
     [self.tableView setBackgroundColorForAnyTable:[UIColor clearColor]];
     self.tableView.allowsSelection = NO;
 
@@ -48,7 +51,7 @@
     [self.view insertSubview:background atIndex:0];
     [background release];
 
-    [super viewDidLoad];
+    [self localizeSegmentedControl];
 }
 
 -(IBAction) buttonPressed:(id) sender {
@@ -56,6 +59,17 @@
     [self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
 }
 
+#pragma mark - Segmented Control
+
+- (void)localizeSegmentedControl
+{
+    for (NSUInteger i = 0; i < self.segmentedControl.numberOfSegments; i++)
+    {
+        NSString *oldTitle = [self.segmentedControl titleForSegmentAtIndex:i];
+        [self.segmentedControl setTitle:NSLocalizedStringFromTable(oldTitle, @"About", nil) forSegmentAtIndex:i];
+    }
+}
+
 -(IBAction) segmentedControlChanged:(id) sender {
     [[AudioManagerController mainManager] playClickSound];
     [self.tableView setContentOffset:CGPointMake(0, 0) animated:NO];