// // LocalizationSystem.h // Battle of Puppets // // Created by Juan Albero Sanchis on 27/02/10. // Copyright Aggressive Mediocrity 2010. All rights reserved. // #import //#define AMLocalizedString(key, comment) \ //[[LocalizationSystem sharedLocalSystem] localizedStringForKey:(key) value:(comment)] //#define LocalizationGetLanguage \ //[[LocalizationSystem sharedLocalSystem] getLanguage] //#define LocalizationReset \ //[[LocalizationSystem sharedLocalSystem] resetLocalization] #define ASLocalizedString(key) [NSString stringWithFormat:@"%@", [[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"appLanguage"]] ofType:@"lproj"]] localizedStringForKey:(key) value:nil table:@"ASLocalized"]] @interface LocalizationSystem : NSObject { NSString *language; } // you really shouldn't care about this functions and use the MACROS + (LocalizationSystem *)sharedLocalSystem; //gets the string localized - (NSString *)localizedStringForKey:(NSString *)key value:(NSString *)comment; //sets the language - (void) setLanguage:(NSString*) language; //gets the current language //- (NSString*) getLanguage; //resets this system. //- (void) resetLocalization; +(void)checkXibString:(NSString *)string; @end