- SegmentedControl is localizable now in MapConfig ios-revival
authorantonc27 <antonc27@mail.ru>
Thu, 22 Oct 2015 03:00:22 +0200
branchios-revival
changeset 11226 628ac6f8a41e
parent 11225 eb600ab27fb9
child 11227 0dd98551e3f8
- SegmentedControl is localizable now in MapConfig
project_files/HedgewarsMobile/Classes/MapConfigViewController.m
project_files/HedgewarsMobile/Locale/English.lproj/Localizable.strings
--- a/project_files/HedgewarsMobile/Classes/MapConfigViewController.m	Thu Oct 22 00:46:45 2015 +0200
+++ b/project_files/HedgewarsMobile/Classes/MapConfigViewController.m	Thu Oct 22 03:00:22 2015 +0200
@@ -352,6 +352,15 @@
     oldPage = newPage;
 }
 
+- (void)localizeSegmentedControl
+{
+    for (NSUInteger i = 0; i < self.segmentedControl.numberOfSegments; i++)
+    {
+        NSString *oldTitle = [self.segmentedControl titleForSegmentAtIndex:i];
+        [self.segmentedControl setTitle:NSLocalizedString(oldTitle, nil) forSegmentAtIndex:i];
+    }
+}
+
 #pragma mark -
 #pragma mark view management
 -(NSArray *) dataSourceArray {
@@ -403,7 +412,9 @@
 
 -(void) viewDidLoad {
     [super viewDidLoad];
-
+    
+    [self localizeSegmentedControl];
+    
     // initialize some "default" values
     self.slider.value = 0.05f;
     self.slider.enabled = NO;
Binary file project_files/HedgewarsMobile/Locale/English.lproj/Localizable.strings has changed