이 포럼에서 NSLocalizedString을 NSDictionary의 키로 사용할 수 있습니다. NSDictionary의 키로 NSLocalizedString
이
내있는 NSDictionary입니다 :이 코드는 NSDictionary에 액세스하려고LABELS = [[NSDictionary alloc] initWithObjectsAndKeys:
NSLocalizedString(@"Threshold 0", @"Description for threshold 0") , @"threshold_0",
NSLocalizedString(@"Threshold 1", @"Description for threshold 1"), @"threshold_1",
NSLocalizedString(@"Threshold 2", @"Description for threshold 2"), @"threshold_2",
NSLocalizedString(@"Threshold 3", @"Description for threshold 3"), @"threshold_3",
NSLocalizedString(@"Threshold 4", @"Description for threshold 4"), @"threshold_4",
nil];
:
NSString *key = [NSString stringWithFormat: @"threshold_%d",{MY_VARIABLE}];
NSString *text = [LABELS objectForKey: key];
경우 4.
I 0의 값을 가질 수 {MY_VARIABLE} 세 가지 언어가 있습니다 (이탈리아어, 프랑스어, 스페인어). 모든 "Localizable.strings"파일 (it.lproj, fr.lproj 및 es.lproj 폴더에 있음)을 생성 및 변환했지만 응용 프로그램이 실행될 때 주 번역본 만 봅니다 (예 : Threshold 0, Threshold 1,. ..
내가 잘못하고있는 곳은 어디입니까?
답장을 보내 주셔서 감사합니다. 문제는 실제로 Localizable.strings 파일을 프로젝트에 추가하는 것을 잊었습니다. 다음 번엔 더 똑똑해질거야 :). – MarcoSciamanna