This commit is contained in:
giuseppenuc committed 2016-12-20 16:02:27 +01:00
1 parent 1bf4b9ef1d
commit 4e66c377fd
664 files changed
+14818 -10172

No files matched your search

@@ -8,14 +8,19 @@
#import <Foundation/Foundation.h>
#define DJLocalizedString(key, comment) \
[DJLocalizationSystem.shared localizedStringForKey:(key) value: @"" table: nil]
#define DJLocalizedStringFromTable(key, tbl, comment) \
[DJLocalizationSystem.shared localizedStringForKey:(key) value: @"" table:(tbl)]
// replace Apple's macros with our own
#undef NSLocalizedString
#define NSLocalizedString(key, comment) \
[DJLocalizationSystem.shared localizedStringForKey:(key) value: @"" table: nil]
DJLocalizedString(key, comment)
#undef NSLocalizedStringFromTable
#define NSLocalizedStringFromTable(key, tbl, comment) \
[DJLocalizationSystem.shared localizedStringForKey:(key) value:@"" table:(tbl)]
DJLocalizedStringFromTable(key, tbl, comment)
@interface DJLocalizationSystem : NSObject
@@ -24,7 +29,7 @@
*
* @return A localization system instance
*/
+ (instancetype)shared;
@property (class, nonnull, readonly) DJLocalizationSystem *shared;
/*!
* Get the localized string for a given key/value
@@ -34,7 +39,7 @@
* @param tableName The localization table name
* @return The localized string
*/
- (NSString *)localizedStringForKey:(NSString *)key value:(NSString *)comment table:(NSString *)tableName;
- (nonnull NSString *)localizedStringForKey:(nullable NSString *)key value:(nullable NSString *)comment table:(nullable NSString *)tableName;
/*!
* Get the localized string for a given key/value in the specified bundle
@@ -44,7 +49,7 @@
* @param bundle The bundle to search in
* @return The localized string
*/
- (NSString *)localizedStringForKey:(NSString *)key value:(NSString *)comment table:(NSString *)tableName bundle:(NSBundle *)bundle;
- (nonnull NSString *)localizedStringForKey:(nullable NSString *)key value:(nullable NSString *)comment table:(nullable NSString *)tableName bundle:(nonnull NSBundle *)bundle;
/*!
* Reset the localization to the system's default language
@@ -54,11 +59,11 @@
/*!
* The bundle for the currently active language
*/
@property (nonatomic, readonly) NSBundle *bundle;
@property (nonatomic, readonly, nonnull) NSBundle *bundle;
/*!
* The currently active language
*/
@property (nonatomic, strong) NSString *language;
@property (nonatomic, strong, nonnull) NSString *language;
@end