LocalizationSystem.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // LocalizationSystem.h
  3. // Battle of Puppets
  4. //
  5. // Created by Juan Albero Sanchis on 27/02/10.
  6. // Copyright Aggressive Mediocrity 2010. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. //#define AMLocalizedString(key, comment) \
  10. //[[LocalizationSystem sharedLocalSystem] localizedStringForKey:(key) value:(comment)]
  11. //#define LocalizationGetLanguage \
  12. //[[LocalizationSystem sharedLocalSystem] getLanguage]
  13. //#define LocalizationReset \
  14. //[[LocalizationSystem sharedLocalSystem] resetLocalization]
  15. #define ASLocalizedString(key) [NSString stringWithFormat:@"%@", [[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"appLanguage"]] ofType:@"lproj"]] localizedStringForKey:(key) value:nil table:@"ASLocalized"]]
  16. @interface LocalizationSystem : NSObject {
  17. NSString *language;
  18. }
  19. // you really shouldn't care about this functions and use the MACROS
  20. + (LocalizationSystem *)sharedLocalSystem;
  21. //gets the string localized
  22. - (NSString *)localizedStringForKey:(NSString *)key value:(NSString *)comment;
  23. //sets the language
  24. - (void) setLanguage:(NSString*) language;
  25. //gets the current language
  26. //- (NSString*) getLanguage;
  27. //resets this system.
  28. //- (void) resetLocalization;
  29. +(void)checkXibString:(NSString *)string;
  30. @end