Last active
July 19, 2018 09:16
-
-
Save yauhenidrobau/a327423153683929124eea3a63c992f4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*Im Macros*/ | |
| #define LocalizedString(key, comment) [LanguageUtils getLocalizedStringForKey:(key)] | |
| /*In Language Utils class*/ | |
| + (NSString *)getLocalizedStringForKey:(NSString *)key { | |
| NSString *oldLocalization = [NSBundle.mainBundle localizedStringForKey:(key) value:@"" table:nil]; | |
| if (oldLocalization.length > 0) { | |
| return oldLocalization; | |
| } | |
| NSString *newLocalization = [[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"en" ofType:@"lproj"]] localizedStringForKey:(key) value:@"" table:nil]; | |
| return newLocalization; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment