- Fix for locale string in SingleWeaponViewController
- Init of vars in LoadLocaleWrapper in order to get right ammo names
--- a/hedgewars/uLocale.pas Mon Oct 05 19:17:40 2015 +0200
+++ b/hedgewars/uLocale.pas Mon Oct 05 20:31:46 2015 +0200
@@ -138,11 +138,13 @@
PathPrefix := Strpas(path);
uUtils.initModule(false);
+ uVariables.initModule;
uPhysFSLayer.initModule;
LoadLocale(Strpas(filename));
uPhysFSLayer.freeModule;
+ uVariables.freeModule;
uUtils.freeModule;
end;
{$ENDIF}
--- 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]);