Use English strings as the default strings & update build number

pull/1023/head
Ryan ZHAO 7 months ago
parent b8b8419fdb
commit b9beb7aec4

@ -7797,7 +7797,7 @@
CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 490;
CURRENT_PROJECT_VERSION = 491;
DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@ -7869,7 +7869,7 @@
CODE_SIGN_ENTITLEMENTS = Session/Meta/Signal.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 490;
CURRENT_PROJECT_VERSION = 491;
DEVELOPMENT_TEAM = SUQ8J2PCT7;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",

@ -30,8 +30,17 @@ final public class LocalizationHelper: CustomStringConvertible {
}
public func localized() -> String {
// Use English as the default string if the translation is empty
let defaultString: String = {
if let englishPath = Bundle.main.path(forResource: "en", ofType: "lproj"), let englishBundle = Bundle(path: englishPath) {
return englishBundle.localizedString(forKey: template, value: nil, table: nil)
} else {
return ""
}
}()
// If the localized string matches the key provided then the localisation failed
var localizedString: String = NSLocalizedString(template, comment: "")
var localizedString: String = NSLocalizedString(template, value: defaultString, comment: "")
// Deal with plurals
// Note: We have to deal with plurals first, so we can get the correct string

Loading…
Cancel
Save