project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m
branchios-revival
changeset 11200 08c6ccc28007
parent 11141 01e8e5a6a8c1
child 11219 c51ecb9bcf05
equal deleted inserted replaced
11199:3465047397da 11200:08c6ccc28007
    35 #pragma mark View lifecycle
    35 #pragma mark View lifecycle
    36 -(void) viewDidLoad {
    36 -(void) viewDidLoad {
    37     [super viewDidLoad];
    37     [super viewDidLoad];
    38 
    38 
    39     self.trPath = [NSString stringWithFormat:@"%@", LOCALE_DIRECTORY()];
    39     self.trPath = [NSString stringWithFormat:@"%@", LOCALE_DIRECTORY()];
    40     self.trFileName = [NSString stringWithFormat:@"%@.txt", [[NSLocale preferredLanguages] firstObject]];
    40     NSString *firstLanguage = [[NSLocale preferredLanguages] firstObject];
       
    41     NSString *language = [[firstLanguage componentsSeparatedByString:@"-"] firstObject];
       
    42     self.trFileName = [NSString stringWithFormat:@"%@.txt", language];
    41     // fill the data structure that we are going to read
    43     // fill the data structure that we are going to read
    42     LoadLocaleWrapper([self.trPath UTF8String], [self.trFileName UTF8String]);
    44     LoadLocaleWrapper([self.trPath UTF8String], [self.trFileName UTF8String]);
    43 
    45 
    44     quantity = (char *)malloc(sizeof(char)*(HW_getNumberOfWeapons()+1));
    46     quantity = (char *)malloc(sizeof(char)*(HW_getNumberOfWeapons()+1));
    45     probability = (char *)malloc(sizeof(char)*(HW_getNumberOfWeapons()+1));
    47     probability = (char *)malloc(sizeof(char)*(HW_getNumberOfWeapons()+1));