providing redirect
This commit is contained in:
parent
e13530f5b4
commit
7581c6609f
@ -19,6 +19,9 @@
|
|||||||
// Returns the hardcoded string from the string file.
|
// Returns the hardcoded string from the string file.
|
||||||
+ (nullable NSString *)hardcodedStringWithKey:(nonnull NSString *)key;
|
+ (nullable NSString *)hardcodedStringWithKey:(nonnull NSString *)key;
|
||||||
|
|
||||||
|
// Returns the hardcoded string from the string file based on module.
|
||||||
|
+ (nullable NSString *)hardcodedStringWithKey:(nonnull NSString *)key bundle:(nullable NSBundle *)bundle;
|
||||||
|
|
||||||
// Return current system language
|
// Return current system language
|
||||||
+ (nullable NSString *)getSystemLanguage;
|
+ (nullable NSString *)getSystemLanguage;
|
||||||
|
|
||||||
|
|||||||
@ -35,19 +35,22 @@
|
|||||||
return [[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0];
|
return [[[NSBundle mainBundle] preferredLocalizations] objectAtIndex:0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns the preferred language set system wide.
|
||||||
+ (NSString *)getSystemLanguage {
|
+ (NSString *)getSystemLanguage {
|
||||||
|
|
||||||
return [[NSLocale preferredLanguages] objectAtIndex:0];
|
return [[NSLocale preferredLanguages] objectAtIndex:0];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nullable NSString *)hardcodedStringWithKey:(nonnull NSString *)key {
|
+ (nullable NSString *)hardcodedStringWithKey:(nonnull NSString *)key {
|
||||||
|
// Redirect key with relevant module.
|
||||||
|
return [MVMCoreGetterUtility hardcodedStringWithKey:key bundle:[MVMCoreGetterUtility bundleForMVMCore]];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (nullable NSString *)hardcodedStringWithKey:(nonnull NSString *)key bundle:(nullable NSBundle *)bundle {
|
||||||
|
|
||||||
// If the app language is not english... force load from the english file anyway.
|
// If the app language is not english... force load from the english file anyway.
|
||||||
if ([MVMCoreGetterUtility userPrefersSpanish]) {
|
NSString *languageCode = [MVMCoreGetterUtility userPrefersSpanish] ? @"es" : @"en";
|
||||||
return [[NSBundle bundleWithPath:[[MVMCoreGetterUtility bundleForMVMCore] pathForResource:@"es" ofType:@"lproj"]] localizedStringForKey:key value:@"" table:nil];
|
return [[NSBundle bundleWithPath:[bundle pathForResource:languageCode ofType:@"lproj"]] localizedStringForKey:key value:@"" table:nil];
|
||||||
|
|
||||||
} else {
|
|
||||||
return [[NSBundle bundleWithPath:[[MVMCoreGetterUtility bundleForMVMCore] pathForResource:@"en" ofType:@"lproj"]] localizedStringForKey:key value:@"" table:nil];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (nonnull UIColor *)getColorForHexString:(nonnull NSString *)hexString {
|
+ (nonnull UIColor *)getColorForHexString:(nonnull NSString *)hexString {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user