project_files/HedgewarsMobile/Classes/SingleWeaponViewController.m
branchios-revival
changeset 11219 c51ecb9bcf05
parent 11200 08c6ccc28007
child 11790 ac93cfc17365
equal deleted inserted replaced
11218:08f20ffa5801 11219:c51ecb9bcf05
    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     NSString *firstLanguage = [[NSLocale preferredLanguages] firstObject];
    40     self.trFileName = [NSString stringWithFormat:@"%@.txt", [HWUtils languageID]];
    41     NSString *language = [[firstLanguage componentsSeparatedByString:@"-"] firstObject];
       
    42     self.trFileName = [NSString stringWithFormat:@"%@.txt", language];
       
    43     // fill the data structure that we are going to read
    41     // fill the data structure that we are going to read
    44     LoadLocaleWrapper([self.trPath UTF8String], [self.trFileName UTF8String]);
    42     LoadLocaleWrapper([self.trPath UTF8String], [self.trFileName UTF8String]);
    45 
    43 
    46     quantity = (char *)malloc(sizeof(char)*(HW_getNumberOfWeapons()+1));
    44     quantity = (char *)malloc(sizeof(char)*(HW_getNumberOfWeapons()+1));
    47     probability = (char *)malloc(sizeof(char)*(HW_getNumberOfWeapons()+1));
    45     probability = (char *)malloc(sizeof(char)*(HW_getNumberOfWeapons()+1));