project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m
branchios-revival
changeset 11200 08c6ccc28007
parent 11141 01e8e5a6a8c1
child 11219 c51ecb9bcf05
--- a/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m	Mon Oct 05 19:17:40 2015 +0200
+++ b/project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m	Mon Oct 05 20:31:46 2015 +0200
@@ -37,7 +37,9 @@
     [super viewDidLoad];
 
     self.trPath = [NSString stringWithFormat:@"%@", LOCALE_DIRECTORY()];
-    self.trFileName = [NSString stringWithFormat:@"%@.txt", [[NSLocale preferredLanguages] firstObject]];
+    NSString *firstLanguage = [[NSLocale preferredLanguages] firstObject];
+    NSString *language = [[firstLanguage componentsSeparatedByString:@"-"] firstObject];
+    self.trFileName = [NSString stringWithFormat:@"%@.txt", language];
     // fill the data structure that we are going to read
     LoadLocaleWrapper([self.trPath UTF8String], [self.trFileName UTF8String]);