- Localization for missed strings in StatsPage (for both eng and rus) ios-revival
authorantonc27 <antonc27@mail.ru>
Fri, 23 Oct 2015 00:45:57 +0200
branchios-revival
changeset 11235 bb3e57426a07
parent 11234 4499aa8570fb
child 11236 0425d60cd046
- Localization for missed strings in StatsPage (for both eng and rus) Note 1: Some strings here are contains format characters, translators must not change their! Note 2: Conjugation with numbers not really handled here.
project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m
project_files/HedgewarsMobile/Classes/StatsPageViewController.m
project_files/HedgewarsMobile/Locale/English.lproj/Localizable.strings
project_files/HedgewarsMobile/Locale/ru.lproj/Localizable.strings
--- a/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m	Fri Oct 23 00:06:35 2015 +0200
+++ b/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m	Fri Oct 23 00:45:57 2015 +0200
@@ -347,13 +347,13 @@
                         [statsArray insertObject:[NSString stringWithUTF8String:&buffer[2]] atIndex:1];
                         break;
                     case 'D':           // best shot
-                        [statsArray addObject:[NSString stringWithFormat:@"The best shot award won by %s (with %@ points)", &buffer[index], arg]];
+                        [statsArray addObject:[NSString stringWithFormat:NSLocalizedString(@"The best shot award won by %s (with %@ points)", nil), &buffer[index], arg]];
                         break;
                     case 'k':           // best hedgehog
-                        [statsArray addObject:[NSString stringWithFormat:@"The best killer is %s with %@ kill(s) in a turn", &buffer[index], arg]];
+                        [statsArray addObject:[NSString stringWithFormat:NSLocalizedString(@"The best killer is %s with %@ kill(s) in a turn", nil), &buffer[index], arg]];
                         break;
                     case 'K':           // number of hogs killed
-                        [statsArray addObject:[NSString stringWithFormat:@"%@ hedgehog(s) were killed during this round", arg]];
+                        [statsArray addObject:[NSString stringWithFormat:NSLocalizedString(@"%@ hedgehog(s) were killed during this round", nil), arg]];
                         break;
                     case 'H':           // team health/graph
                         break;
@@ -364,13 +364,13 @@
                         [[statsArray objectAtIndex:0] addObject:tempStr];
                         break;
                     case 's':           // self damage
-                        [statsArray addObject:[NSString stringWithFormat:@"%s thought it's good to shoot his own hedgehogs with %@ points", &buffer[index], arg]];
+                        [statsArray addObject:[NSString stringWithFormat:NSLocalizedString(@"%s thought it's good to shoot his own hedgehogs with %@ points", nil), &buffer[index], arg]];
                         break;
                     case 'S':           // friendly fire
-                        [statsArray addObject:[NSString stringWithFormat:@"%s killed %@ of his own hedgehogs", &buffer[index], arg]];
+                        [statsArray addObject:[NSString stringWithFormat:NSLocalizedString(@"%s killed %@ of his own hedgehogs", nil), &buffer[index], arg]];
                         break;
                     case 'B':           // turn skipped
-                        [statsArray addObject:[NSString stringWithFormat:@"%s was scared and skipped turn %@ times", &buffer[index], arg]];
+                        [statsArray addObject:[NSString stringWithFormat:NSLocalizedString(@"%s was scared and skipped turn %@ times", nil), &buffer[index], arg]];
                         break;
                     default:
                         DLog(@"Unhandled stat message, see statsPage.cpp");
--- a/project_files/HedgewarsMobile/Classes/StatsPageViewController.m	Fri Oct 23 00:06:35 2015 +0200
+++ b/project_files/HedgewarsMobile/Classes/StatsPageViewController.m	Fri Oct 23 00:45:57 2015 +0200
@@ -107,7 +107,7 @@
                                                    green:((color >> 8) & 0xFF)/255.0f
                                                     blue:(color & 0xFF)/255.0f
                                                    alpha:1.0f];
-        cell.textLabel.text = [NSString stringWithFormat:@"%d. %@ (%@ kills)", row+1, [self teamNameFromInfo:info], [info objectAtIndex:1]];
+        cell.textLabel.text = [NSString stringWithFormat:@"%d. %@ (%@ %@)", row+1, [self teamNameFromInfo:info], [info objectAtIndex:1], NSLocalizedString(@"kills", nil)];
         imgName = [NSString stringWithFormat:@"StatsMedal%d",row+1];
     } else if (section == 2) {  // general info
         imgName = @"iconDamage";
Binary file project_files/HedgewarsMobile/Locale/English.lproj/Localizable.strings has changed
Binary file project_files/HedgewarsMobile/Locale/ru.lproj/Localizable.strings has changed