| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- //
- // LocalizationSystem.h
- // Battle of Puppets
- //
- // Created by Juan Albero Sanchis on 27/02/10.
- // Copyright Aggressive Mediocrity 2010. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- //#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
|