finally hook the engine localization on ios
authorkoda
Mon, 12 Dec 2011 00:10:11 +0100
changeset 6527 d19c6af9fa48
parent 6526 6ed9d2acf1a5
child 6528 fb2918089225
finally hook the engine localization on ios
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/FrontendDataUtils.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/GameMode.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Grave.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Map.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Scheme.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Team.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/Datastructures/Weapon.java
project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/UserInput/TouchInterface.java
project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m
share/hedgewars/Data/Scripts/plist/Racer.plist
--- a/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m	Sun Dec 11 23:20:59 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m	Mon Dec 12 00:10:11 2011 +0100
@@ -120,7 +120,7 @@
     NSInteger enginePort = self.proto.enginePort;
     CGFloat screenScale = [[UIScreen mainScreen] safeScale];
     NSString *ipcString = [[NSString alloc] initWithFormat:@"%d",enginePort];
-    NSString *localeString = [[NSString alloc] initWithFormat:@"%@.txt",[[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode]];
+    NSString *localeString = [[NSString alloc] initWithFormat:@"%@.txt",[[NSLocale preferredLanguages] objectAtIndex:0]];
     NSUserDefaults *settings = [NSUserDefaults standardUserDefaults];
 
     if (IS_DUALHEAD()) {
@@ -163,7 +163,7 @@
     gameArgs[ 1] = [horizontalSize UTF8String];                                                 //cScreenWidth
     gameArgs[ 2] = [verticalSize UTF8String];                                                   //cScreenHeight
     gameArgs[ 3] = [[NSString stringWithFormat:@"%d",tmpQuality] UTF8String];                   //quality
-    gameArgs[ 4] = "en.txt";//[localeString UTF8String];                                        //cLocaleFName
+    gameArgs[ 4] = [localeString UTF8String];                                                   //cLocaleFName
     gameArgs[ 5] = [username UTF8String];                                                       //UserNick
     gameArgs[ 6] = [[[settings objectForKey:@"sound"] stringValue] UTF8String];                 //isSoundEnabled
     gameArgs[ 7] = [[[settings objectForKey:@"music"] stringValue] UTF8String];                 //isMusicEnabled