From a2752481e4074cab02b37d4444236c683f32eaa1 Mon Sep 17 00:00:00 2001 From: Chris Ballinger Date: Thu, 12 Jan 2017 17:37:54 -0800 Subject: [PATCH] Migrate OTRStrings from defines to Swift-compatible global C functions --- ChatSecure.xcodeproj/project.pbxproj | 30 +- .../UIActivityViewController+ChatSecure.m | 4 +- .../Categories/UIApplication+ChatSecure.swift | 7 +- ChatSecure/Classes/Controllers/Errors.swift | 6 +- .../Classes/Controllers/OTRAttachmentPicker.m | 8 +- .../Classes/Controllers/OTRDatabaseManager.m | 4 +- .../Controllers/OTREncryptionManager.m | 34 +- .../Controllers/OTRNotificationController.m | 4 +- .../Classes/Controllers/OTRSettingsManager.m | 30 +- .../Classes/Controllers/ShareController.swift | 5 +- .../XMPP/OTRYapDatabaseRosterStorage.m | 14 +- .../Classes/Model/OTRActivityItemProvider.m | 6 +- .../Classes/Model/OTROpenInFacebookActivity.m | 4 +- .../Classes/Model/OTROpenInTwitterActivity.m | 4 +- ChatSecure/Classes/Model/OTRQRCodeActivity.m | 4 +- .../Model/Settings/OTRLanguageSetting.h | 2 +- .../Model/Settings/OTRLanguageSetting.m | 2 +- .../Accounts/OTRGoogleOAuthXMPPAccount.m | 4 +- .../Yap Storage/Accounts/OTRXMPPAccount.m | 4 +- .../Yap Storage/Accounts/OTRXMPPTorAccount.m | 4 +- .../Model/Yap Storage/OTRBaseMessage.m | 2 +- ChatSecure/Classes/OTRAppDelegate.m | 18 +- ChatSecure/Classes/Utilities/OTRXMPPError.m | 104 +- .../OTRBaseLoginViewController.m | 26 +- .../Login View Controllers/OTRXLFormCreator.m | 54 +- .../OTRXMPPServerListViewController.m | 6 +- .../View Controllers/OTRAboutViewController.m | 12 +- .../View Controllers/OTRBuddyViewController.m | 18 +- .../OTRCertificateDomainViewController.m | 4 +- .../OTRChooseAccountViewController.m | 4 +- .../OTRComposeViewController.m | 14 +- .../OTRConversationViewController.m | 10 +- .../OTRDatabaseUnlockViewController.m | 8 +- .../OTRDoubleSettingViewController.m | 4 +- .../OTRIntSettingViewController.m | 4 +- .../OTRInviteViewController.m | 10 +- .../OTRMessagesHoldTalkViewController.m | 18 +- .../OTRMessagesViewController.m | 46 +- .../OTRNewBuddyViewController.m | 16 +- .../OTRQRCodeViewController.m | 6 +- .../OTRSettingDetailViewController.m | 6 +- .../OTRSettingsViewController.m | 30 +- .../Onboarding/EnablePushViewController.swift | 11 +- .../OTRAddBuddyQRCodeViewController.m | 6 +- .../Onboarding/OTRWelcomeViewController.swift | 7 +- .../UserProfileViewController.swift | 17 +- .../Cells/OMEMODeviceFingerprintCell.swift | 10 +- .../Views/Cells/OTRAccountTableViewCell.m | 6 +- .../Views/Cells/OTRBuddyApprovalCell.m | 4 +- .../Classes/Views/Cells/OTRBuddyInfoCell.m | 4 +- .../Classes/Views/OTRRememberPasswordView.m | 6 +- .../Classes/Views/OTRSocialButtonsView.m | 8 +- ChatSecureCore/ChatSecureCore.h | 2 +- OTRAssets/OTRAssets.h | 4 + OTRAssets/OTRAssets.m | 5 +- .../OTRLanguageManager.h | 12 +- .../OTRLanguageManager.m | 7 +- OTRAssets/OTRLanguageManager_Private.h | 17 + OTRAssets/Strings/OTRStrings.h | 907 ++++++++++++------ OTRAssets/Strings/OTRStrings.m | 609 ++++++++++++ OTRAssets/Strings/StringsConverter.py | 76 +- OTRAssets/Strings/strings.json | 14 +- .../Base.lproj/Localizable.strings | Bin 63536 -> 63888 bytes 63 files changed, 1670 insertions(+), 662 deletions(-) rename {ChatSecure/Classes/Controllers => OTRAssets}/OTRLanguageManager.h (53%) rename {ChatSecure/Classes/Controllers => OTRAssets}/OTRLanguageManager.m (90%) create mode 100644 OTRAssets/OTRLanguageManager_Private.h create mode 100644 OTRAssets/Strings/OTRStrings.m diff --git a/ChatSecure.xcodeproj/project.pbxproj b/ChatSecure.xcodeproj/project.pbxproj index 1972b6fb3..50f18e103 100644 --- a/ChatSecure.xcodeproj/project.pbxproj +++ b/ChatSecure.xcodeproj/project.pbxproj @@ -392,6 +392,8 @@ D93DDBE21BA7A06A00CD8331 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6396AF9F1A169D54009F3E6C /* main.m */; }; D94ACBA41DFA206500B8C0F5 /* OTRBuddyCache.h in Headers */ = {isa = PBXBuildFile; fileRef = D94ACBA21DFA206500B8C0F5 /* OTRBuddyCache.h */; }; D94ACBA51DFA206500B8C0F5 /* OTRBuddyCache.m in Sources */ = {isa = PBXBuildFile; fileRef = D94ACBA31DFA206500B8C0F5 /* OTRBuddyCache.m */; }; + D9599BBC1E28578D006A4450 /* OTRStrings.m in Sources */ = {isa = PBXBuildFile; fileRef = D9599BBB1E28578D006A4450 /* OTRStrings.m */; }; + D9599BBE1E285ECD006A4450 /* OTRLanguageManager_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = D9599BBD1E285EC3006A4450 /* OTRLanguageManager_Private.h */; settings = {ATTRIBUTES = (Private, ); }; }; D95AD2291B684AE1007DEBC3 /* xmpp-server-list in Resources */ = {isa = PBXBuildFile; fileRef = D95AD2281B684AE1007DEBC3 /* xmpp-server-list */; }; D978BC921BABE0F4009246CF /* OTRTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = D978BC901BABE0F4009246CF /* OTRTheme.h */; settings = {ATTRIBUTES = (Public, ); }; }; D978BC931BABE0F4009246CF /* OTRTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = D978BC911BABE0F4009246CF /* OTRTheme.m */; }; @@ -416,13 +418,13 @@ D9AE3A311BA8D84500255537 /* OTRBranding.m in Sources */ = {isa = PBXBuildFile; fileRef = D9AE3A2F1BA8D84500255537 /* OTRBranding.m */; }; D9AE3A321BA8D9AB00255537 /* OTRConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 633105EE1A16D1A300C17BAE /* OTRConstants.h */; settings = {ATTRIBUTES = (Public, ); }; }; D9AE3A331BA8D9AB00255537 /* OTRConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 633105EF1A16D1A300C17BAE /* OTRConstants.m */; }; - D9AE3A341BA8DAB600255537 /* OTRLanguageManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6331051B1A16D1A300C17BAE /* OTRLanguageManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; - D9AE3A351BA8DAB600255537 /* OTRLanguageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6331051C1A16D1A300C17BAE /* OTRLanguageManager.m */; }; D9B9B1331DC7F3AC0007F5A7 /* UserInfoProfileCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9B9B1311DC7F3AC0007F5A7 /* UserInfoProfileCell.swift */; }; D9B9B1351DC7F3BF0007F5A7 /* UserInfoProfileCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D9B9B1321DC7F3AC0007F5A7 /* UserInfoProfileCell.xib */; }; D9B9B1371DC802480007F5A7 /* OTRUserInfoProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = D9B9B1361DC802480007F5A7 /* OTRUserInfoProfile.h */; settings = {ATTRIBUTES = (Public, ); }; }; D9BEF8E01DCE6E12009945D1 /* OTRXMPPManager_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = D9BEF8DF1DCE6E12009945D1 /* OTRXMPPManager_Private.h */; }; D9CBBC581C642BAA005CD715 /* EnablePushViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9CBBC571C642BAA005CD715 /* EnablePushViewController.swift */; }; + D9E8277E1E28222D0071F40D /* OTRLanguageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6331051C1A16D1A300C17BAE /* OTRLanguageManager.m */; }; + D9E8277F1E28222F0071F40D /* OTRLanguageManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6331051B1A16D1A300C17BAE /* OTRLanguageManager.h */; settings = {ATTRIBUTES = (Public, ); }; }; D9EEEDD31D2739A800B8BC54 /* OTRvCard.h in Headers */ = {isa = PBXBuildFile; fileRef = D9EEEDD11D27388600B8BC54 /* OTRvCard.h */; settings = {ATTRIBUTES = (Public, ); }; }; DDE1CAF4312DE1C724A33B72 /* Pods_ChatSecureCorePods_ChatSecureCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 31610826406FD0CB714045AD /* Pods_ChatSecureCorePods_ChatSecureCore.framework */; }; /* End PBXBuildFile section */ @@ -560,8 +562,8 @@ 633105161A16D1A300C17BAE /* OTRDatabaseView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTRDatabaseView.m; sourceTree = ""; }; 633105171A16D1A300C17BAE /* OTREncryptionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTREncryptionManager.h; sourceTree = ""; }; 633105181A16D1A300C17BAE /* OTREncryptionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTREncryptionManager.m; sourceTree = ""; }; - 6331051B1A16D1A300C17BAE /* OTRLanguageManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OTRLanguageManager.h; path = ../Controllers/OTRLanguageManager.h; sourceTree = ""; }; - 6331051C1A16D1A300C17BAE /* OTRLanguageManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OTRLanguageManager.m; path = ../Controllers/OTRLanguageManager.m; sourceTree = ""; }; + 6331051B1A16D1A300C17BAE /* OTRLanguageManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTRLanguageManager.h; sourceTree = ""; }; + 6331051C1A16D1A300C17BAE /* OTRLanguageManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTRLanguageManager.m; sourceTree = ""; }; 6331051D1A16D1A300C17BAE /* OTROAuthRefresher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTROAuthRefresher.h; sourceTree = ""; }; 6331051E1A16D1A300C17BAE /* OTROAuthRefresher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTROAuthRefresher.m; sourceTree = ""; }; 633105211A16D1A300C17BAE /* OTRProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTRProtocol.h; sourceTree = ""; }; @@ -921,6 +923,10 @@ D94ACBA21DFA206500B8C0F5 /* OTRBuddyCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTRBuddyCache.h; sourceTree = ""; }; D94ACBA31DFA206500B8C0F5 /* OTRBuddyCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTRBuddyCache.m; sourceTree = ""; }; D95553D71C4F16730019667A /* ChatSecure.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = ChatSecure.entitlements; sourceTree = ""; }; + D9599BB91E284BCA006A4450 /* StringsConverter.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; name = StringsConverter.py; path = Strings/StringsConverter.py; sourceTree = ""; }; + D9599BBA1E284BCA006A4450 /* StringsUnused.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; name = StringsUnused.py; path = Strings/StringsUnused.py; sourceTree = ""; }; + D9599BBB1E28578D006A4450 /* OTRStrings.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OTRStrings.m; path = Strings/OTRStrings.m; sourceTree = ""; }; + D9599BBD1E285EC3006A4450 /* OTRLanguageManager_Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OTRLanguageManager_Private.h; sourceTree = ""; }; D95AD2221B67FD6A007DEBC3 /* OTRCircleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OTRCircleView.h; sourceTree = ""; }; D95AD2231B67FD6A007DEBC3 /* OTRCircleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OTRCircleView.m; sourceTree = ""; }; D95AD2281B684AE1007DEBC3 /* xmpp-server-list */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "xmpp-server-list"; path = "Submodules/xmpp-server-list"; sourceTree = SOURCE_ROOT; }; @@ -1311,8 +1317,6 @@ 633105FB1A16D1A300C17BAE /* OTRUtilities.m */, 633105FC1A16D1A300C17BAE /* OTRXMPPError.h */, 633105FD1A16D1A300C17BAE /* OTRXMPPError.m */, - 6331051B1A16D1A300C17BAE /* OTRLanguageManager.h */, - 6331051C1A16D1A300C17BAE /* OTRLanguageManager.m */, ); path = Utilities; sourceTree = ""; @@ -1544,7 +1548,6 @@ 6396AF9C1A169D54009F3E6C /* ChatSecure */ = { isa = PBXGroup; children = ( - D9E8277D1E2819F20071F40D /* strings.json */, D95553D71C4F16730019667A /* ChatSecure.entitlements */, 633104D71A169EE600C17BAE /* Resources */, 6396AF9D1A169D54009F3E6C /* Supporting Files */, @@ -1742,11 +1745,15 @@ D9AE3A1D1BA8CCAA00255537 /* Classes */ = { isa = PBXGroup; children = ( + D9599BBD1E285EC3006A4450 /* OTRLanguageManager_Private.h */, + 6331051B1A16D1A300C17BAE /* OTRLanguageManager.h */, + 6331051C1A16D1A300C17BAE /* OTRLanguageManager.m */, D9AE3A2E1BA8D84500255537 /* OTRBranding.h */, D9AE3A2F1BA8D84500255537 /* OTRBranding.m */, D9AE3A101BA8CBFA00255537 /* OTRAssets.h */, D9AE3A261BA8D0DB00255537 /* OTRAssets.m */, 633104FF1A16AEA800C17BAE /* OTRStrings.h */, + D9599BBB1E28578D006A4450 /* OTRStrings.m */, 633105F81A16D1A300C17BAE /* OTRSecrets.h */, 633105F91A16D1A300C17BAE /* OTRSecrets.m */, ); @@ -1756,6 +1763,9 @@ D9AE3A2B1BA8D2AD00255537 /* Resources */ = { isa = PBXGroup; children = ( + D9599BB91E284BCA006A4450 /* StringsConverter.py */, + D9599BBA1E284BCA006A4450 /* StringsUnused.py */, + D9E8277D1E2819F20071F40D /* strings.json */, ); name = Resources; sourceTree = ""; @@ -1799,7 +1809,6 @@ D93DDB431BA79A7200CD8331 /* OTRMediaFileManager.h in Headers */, D93DDB441BA79A7200CD8331 /* OTRMediaServer.h in Headers */, 63BA43DF1D418F14007FAF7F /* OTRAccountSignalIdentity.h in Headers */, - D9AE3A341BA8DAB600255537 /* OTRLanguageManager.h in Headers */, D93DDB731BA79A7F00CD8331 /* OTRQRCodeActivity.h in Headers */, 637ABBC41DD52ABB00B18DD2 /* OTRMessageEncryptionInfo.h in Headers */, 63D150FB1D8A0C9C006FB2E2 /* OTROMEMODevice.h in Headers */, @@ -1951,6 +1960,8 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + D9599BBE1E285ECD006A4450 /* OTRLanguageManager_Private.h in Headers */, + D9E8277F1E28222F0071F40D /* OTRLanguageManager.h in Headers */, D9AE3A111BA8CBFA00255537 /* OTRAssets.h in Headers */, D9AE3A211BA8CF4400255537 /* OTRStrings.h in Headers */, D9AE3A1C1BA8CC8E00255537 /* OTRSecrets.h in Headers */, @@ -2492,7 +2503,6 @@ D93DDA981BA79A2400CD8331 /* OTRYapDatabaseRosterStorage.m in Sources */, D93DDA991BA79A2400CD8331 /* OTRXMPPServerInfo.m in Sources */, 638045681BB4BDED002D8BAE /* PushSerializer.swift in Sources */, - D9AE3A351BA8DAB600255537 /* OTRLanguageManager.m in Sources */, 6369855B1BC875110083FC53 /* OTRXMPPRoomManager.m in Sources */, 63636D6E1C1F78A6009F5FCD /* UINavigationController+ChatSecure.swift in Sources */, 634364231CC192F1009E169F /* YapDatabaseConstants.swift in Sources */, @@ -2659,6 +2669,8 @@ D9AE3A311BA8D84500255537 /* OTRBranding.m in Sources */, D9AE3A271BA8D0DB00255537 /* OTRAssets.m in Sources */, D9AE3A1B1BA8CC8600255537 /* OTRSecrets.m in Sources */, + D9599BBC1E28578D006A4450 /* OTRStrings.m in Sources */, + D9E8277E1E28222D0071F40D /* OTRLanguageManager.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/ChatSecure/Classes/Categories/UIActivityViewController+ChatSecure.m b/ChatSecure/Classes/Categories/UIActivityViewController+ChatSecure.m index 9050226f1..d6c38ff2c 100644 --- a/ChatSecure/Classes/Categories/UIActivityViewController+ChatSecure.m +++ b/ChatSecure/Classes/Categories/UIActivityViewController+ChatSecure.m @@ -12,7 +12,7 @@ #import "OTROpenInFacebookActivity.h" #import "OTROpenInTwitterActivity.h" @import OTRAssets; -#import "OTRLanguageManager.h" + @implementation UIActivityViewController (ChatSecure) @@ -21,7 +21,7 @@ + (instancetype)otr_linkActivityViewControllerWithURLs:(NSArray *)urlArray if ([urlArray count]) { TUSafariActivity *safariActivity = [TUSafariActivity new]; ARChromeActivity *chromeActivity = [ARChromeActivity new]; - chromeActivity.activityTitle = OPEN_IN_CHROME; + chromeActivity.activityTitle = OPEN_IN_CHROME(); chromeActivity.callbackURL = [NSURL URLWithString:@"chatsecure://"]; OTROpenInTwitterActivity *twitterActivity = [OTROpenInTwitterActivity new]; OTROpenInFacebookActivity *facebookActivity = [OTROpenInFacebookActivity new]; diff --git a/ChatSecure/Classes/Categories/UIApplication+ChatSecure.swift b/ChatSecure/Classes/Categories/UIApplication+ChatSecure.swift index 2f29becc8..7132e7f5b 100644 --- a/ChatSecure/Classes/Categories/UIApplication+ChatSecure.swift +++ b/ChatSecure/Classes/Categories/UIApplication+ChatSecure.swift @@ -9,6 +9,7 @@ import Foundation import MWFeedParser import UserNotifications +import OTRAssets public extension UIApplication { @@ -39,12 +40,12 @@ public extension UIApplication { } public func showLocalNotificationForKnockFrom(thread:OTRThreadOwner?) { - var name = OTRLanguageManager.translatedString("Someone") + var name = SOMEONE_STRING() if let threadName = thread?.threadName() { name = threadName } - let chatString = OTRLanguageManager.translatedString("wants to chat.") + let chatString = WANTS_TO_CHAT_STRING() let text = "\(name) \(chatString)" let unreadCount = self.applicationIconBadgeNumber + 1 self.showLocalNotificationFor(thread, text: text, unreadCount: unreadCount) @@ -72,7 +73,7 @@ public extension UIApplication { }) } else if(self.applicationState != .Active) { let localNotification = UILocalNotification() - localNotification.alertAction = OTRLanguageManager.translatedString("Reply") + localNotification.alertAction = REPLY_STRING() localNotification.soundName = UILocalNotificationDefaultSoundName localNotification.applicationIconBadgeNumber = unreadCount ?? 0 localNotification.alertBody = text diff --git a/ChatSecure/Classes/Controllers/Errors.swift b/ChatSecure/Classes/Controllers/Errors.swift index ae0988efb..2bcf411ff 100644 --- a/ChatSecure/Classes/Controllers/Errors.swift +++ b/ChatSecure/Classes/Controllers/Errors.swift @@ -146,11 +146,11 @@ extension OTROMEMOError: ChatSecureErrorProtocol { public func localizedDescription() -> String { switch self { case .UnknownError: - return OTRLanguageManager.translatedString("Unknown Error") + return UNKNOWN_ERROR_STRING() case .NoDevicesForBuddy: - return OTRLanguageManager.translatedString("We could not find any trusted devices for this contact.") + return NO_DEVICES_BUDDY_ERROR_STRING() case .NoDevices: - return OTRLanguageManager.translatedString("We could not find any trusted devices for this account.") + return NO_DEVICES_ACCOUNT_ERROR_STRING() } } diff --git a/ChatSecure/Classes/Controllers/OTRAttachmentPicker.m b/ChatSecure/Classes/Controllers/OTRAttachmentPicker.m index 72142cd37..95a40b5f3 100644 --- a/ChatSecure/Classes/Controllers/OTRAttachmentPicker.m +++ b/ChatSecure/Classes/Controllers/OTRAttachmentPicker.m @@ -12,7 +12,7 @@ @import OTRAssets; #import "OTRUtilities.h" #import "UIActionSheet+ChatSecure.h" -#import "OTRLanguageManager.h" + @interface OTRAttachmentPicker () @@ -36,7 +36,7 @@ - (void)showAlertControllerWithCompletion:(void (^)(void))completion UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet]; if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { - UIAlertAction *takePhotoAction = [UIAlertAction actionWithTitle:USE_CAMERA_STRING style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { + UIAlertAction *takePhotoAction = [UIAlertAction actionWithTitle:USE_CAMERA_STRING() style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]; [self showImagePickerForSourceType:UIImagePickerControllerSourceTypeCamera]; }]; @@ -44,7 +44,7 @@ - (void)showAlertControllerWithCompletion:(void (^)(void))completion } if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { - UIAlertAction *openLibraryAction = [UIAlertAction actionWithTitle:PHOTO_LIBRARY_STRING style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { + UIAlertAction *openLibraryAction = [UIAlertAction actionWithTitle:PHOTO_LIBRARY_STRING() style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { [self showImagePickerForSourceType:UIImagePickerControllerSourceTypePhotoLibrary]; }]; [alertController addAction:openLibraryAction]; @@ -54,7 +54,7 @@ - (void)showAlertControllerWithCompletion:(void (^)(void))completion [self.delegate attachmentPicker:self addAdditionalOptions:alertController]; } - UIAlertAction *cancelAlertAction = [UIAlertAction actionWithTitle:CANCEL_STRING style:UIAlertActionStyleCancel handler:nil]; + UIAlertAction *cancelAlertAction = [UIAlertAction actionWithTitle:CANCEL_STRING() style:UIAlertActionStyleCancel handler:nil]; [alertController addAction:cancelAlertAction]; diff --git a/ChatSecure/Classes/Controllers/OTRDatabaseManager.m b/ChatSecure/Classes/Controllers/OTRDatabaseManager.m index 678e84ead..41285d061 100644 --- a/ChatSecure/Classes/Controllers/OTRDatabaseManager.m +++ b/ChatSecure/Classes/Controllers/OTRDatabaseManager.m @@ -25,7 +25,7 @@ @import OTRAssets; @import YapDatabase; @import YapTaskQueue; -#import "OTRLanguageManager.h" + #import "OTRSignalSession.h" #import @@ -199,7 +199,7 @@ - (BOOL)setupYapDatabaseWithName:(NSString *)name return YES; } else { - UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[OTRLanguageManager translatedString:@"Database Error"] message:[OTRLanguageManager translatedString:@"Could not decrypt database. If the app is not working properly, you may need to delete and reinstall."] delegate:nil cancelButtonTitle:OK_STRING otherButtonTitles:nil]; + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:Database_Error_String() message:Could_Not_Decrypt_Database() delegate:nil cancelButtonTitle:OK_STRING() otherButtonTitles:nil]; [alert show]; return NO; } diff --git a/ChatSecure/Classes/Controllers/OTREncryptionManager.m b/ChatSecure/Classes/Controllers/OTREncryptionManager.m index af6154520..0115362bb 100644 --- a/ChatSecure/Classes/Controllers/OTREncryptionManager.m +++ b/ChatSecure/Classes/Controllers/OTREncryptionManager.m @@ -37,7 +37,7 @@ #import "OTRVideoItem.h" #import "OTRMediaFileManager.h" #import "OTRMediaServer.h" -#import "OTRLanguageManager.h" + #import "OTRLog.h" #import "OTRPushTLVHandler.h" #import "OTRXMPPManager.h" @@ -472,7 +472,7 @@ + (NSError *)errorForMessageEvent:(OTRKitMessageEvent)event string:(NSString*)st NSString *eventString = [OTREncryptionManager stringForEvent:event]; NSInteger code = 200 + event; - NSMutableString *description = [NSMutableString stringWithString:ENCRYPTION_ERROR_STRING]; + NSMutableString *description = [NSMutableString stringWithString:ENCRYPTION_ERROR_STRING()]; if (string.length) { [description appendFormat:@"\n\n%@: %@", string, eventString]; } @@ -491,49 +491,49 @@ + (NSString *)stringForEvent:(OTRKitMessageEvent)event NSString *string = nil; switch (event) { case OTRKitMessageEventEncryptionRequired: - string = OTRL_MSGEVENT_ENCRYPTION_REQUIRED_STRING; + string = OTRL_MSGEVENT_ENCRYPTION_REQUIRED_STRING(); break; case OTRKitMessageEventEncryptionError: - string = OTRL_MSGEVENT_ENCRYPTION_ERROR_STRING; + string = OTRL_MSGEVENT_ENCRYPTION_ERROR_STRING(); break; case OTRKitMessageEventConnectionEnded: - string = OTRL_MSGEVENT_CONNECTION_ENDED_STRING; + string = OTRL_MSGEVENT_CONNECTION_ENDED_STRING(); break; case OTRKitMessageEventSetupError: - string = OTRL_MSGEVENT_SETUP_ERROR_STRING; + string = OTRL_MSGEVENT_SETUP_ERROR_STRING(); break; case OTRKitMessageEventMessageReflected: - string = OTRL_MSGEVENT_MSG_REFLECTED_STRING; + string = OTRL_MSGEVENT_MSG_REFLECTED_STRING(); break; case OTRKitMessageEventMessageResent: - string = OTRL_MSGEVENT_MSG_RESENT_STRING; + string = OTRL_MSGEVENT_MSG_RESENT_STRING(); break; case OTRKitMessageEventReceivedMessageNotInPrivate: - string = OTRL_MSGEVENT_RCVDMSG_NOT_IN_PRIVATE_STRING; + string = OTRL_MSGEVENT_RCVDMSG_NOT_IN_PRIVATE_STRING(); break; case OTRKitMessageEventReceivedMessageUnreadable: - string = OTRL_MSGEVENT_RCVDMSG_UNREADABLE_STRING; + string = OTRL_MSGEVENT_RCVDMSG_UNREADABLE_STRING(); break; case OTRKitMessageEventReceivedMessageMalformed: - string = OTRL_MSGEVENT_RCVDMSG_MALFORMED_STRING; + string = OTRL_MSGEVENT_RCVDMSG_MALFORMED_STRING(); break; case OTRKitMessageEventLogHeartbeatReceived: - string = OTRL_MSGEVENT_LOG_HEARTBEAT_RCVD_STRING; + string = OTRL_MSGEVENT_LOG_HEARTBEAT_RCVD_STRING(); break; case OTRKitMessageEventLogHeartbeatSent: - string = OTRL_MSGEVENT_LOG_HEARTBEAT_SENT_STRING; + string = OTRL_MSGEVENT_LOG_HEARTBEAT_SENT_STRING(); break; case OTRKitMessageEventReceivedMessageGeneralError: - string = OTRL_MSGEVENT_RCVDMSG_GENERAL_ERR_STRING; + string = OTRL_MSGEVENT_RCVDMSG_GENERAL_ERR_STRING(); break; case OTRKitMessageEventReceivedMessageUnencrypted: - string = OTRL_MSGEVENT_RCVDMSG_UNENCRYPTED_STRING; + string = OTRL_MSGEVENT_RCVDMSG_UNENCRYPTED_STRING(); break; case OTRKitMessageEventReceivedMessageUnrecognized: - string = OTRL_MSGEVENT_RCVDMSG_UNRECOGNIZED_STRING; + string = OTRL_MSGEVENT_RCVDMSG_UNRECOGNIZED_STRING(); break; case OTRKitMessageEventReceivedMessageForOtherInstance: - string = OTRL_MSGEVENT_RCVDMSG_FOR_OTHER_INSTANCE_STRING; + string = OTRL_MSGEVENT_RCVDMSG_FOR_OTHER_INSTANCE_STRING(); break; default: break; diff --git a/ChatSecure/Classes/Controllers/OTRNotificationController.m b/ChatSecure/Classes/Controllers/OTRNotificationController.m index 59d97ec13..d7613ebb4 100644 --- a/ChatSecure/Classes/Controllers/OTRNotificationController.m +++ b/ChatSecure/Classes/Controllers/OTRNotificationController.m @@ -14,7 +14,7 @@ #import "OTRImages.h" #import "UIImage+ChatSecure.h" #import "OTRBaseLoginViewController.h" -#import "OTRLanguageManager.h" + @import OTRAssets; @@ -119,7 +119,7 @@ - (void)showAccountConnectingNotificationWithAccountName:(NSString *)accountName if (!self.enabled) { return; } - OTRToastOptions *options = [OTRToastOptions optionsWithText:CONNECTING_STRING subtitleText:accountName]; + OTRToastOptions *options = [OTRToastOptions optionsWithText:CONNECTING_STRING() subtitleText:accountName]; options.image = [UIImage otr_imageWithImage:[OTRImages wifiWithColor:[UIColor whiteColor]] scaledToSize:kOTRDefaultNotificationImageSize]; //[CRToastManager showNotificationWithOptions:[options dictionary] completionBlock:nil]; } diff --git a/ChatSecure/Classes/Controllers/OTRSettingsManager.m b/ChatSecure/Classes/Controllers/OTRSettingsManager.m index f17e06c84..c980b15a8 100644 --- a/ChatSecure/Classes/Controllers/OTRSettingsManager.m +++ b/ChatSecure/Classes/Controllers/OTRSettingsManager.m @@ -59,49 +59,49 @@ - (void) populateSettings NSMutableArray *settingsGroups = [NSMutableArray array]; NSMutableDictionary *newSettingsDictionary = [NSMutableDictionary dictionary]; // Leave this in for now - OTRViewSetting *accountsViewSetting = [[OTRViewSetting alloc] initWithTitle:ACCOUNTS_STRING description:nil viewControllerClass:nil]; - OTRSettingsGroup *accountsGroup = [[OTRSettingsGroup alloc] initWithTitle:ACCOUNTS_STRING settings:@[accountsViewSetting]]; + OTRViewSetting *accountsViewSetting = [[OTRViewSetting alloc] initWithTitle:ACCOUNTS_STRING() description:nil viewControllerClass:nil]; + OTRSettingsGroup *accountsGroup = [[OTRSettingsGroup alloc] initWithTitle:ACCOUNTS_STRING() settings:@[accountsViewSetting]]; [settingsGroups addObject:accountsGroup]; - OTRBoolSetting *deletedDisconnectedConversations = [[OTRBoolSetting alloc] initWithTitle:DELETE_CONVERSATIONS_ON_DISCONNECT_TITLE_STRING - description:DELETE_CONVERSATIONS_ON_DISCONNECT_DESCRIPTION_STRING + OTRBoolSetting *deletedDisconnectedConversations = [[OTRBoolSetting alloc] initWithTitle:DELETE_CONVERSATIONS_ON_DISCONNECT_TITLE_STRING() + description:DELETE_CONVERSATIONS_ON_DISCONNECT_DESCRIPTION_STRING() settingsKey:kOTRSettingKeyDeleteOnDisconnect]; [newSettingsDictionary setObject:deletedDisconnectedConversations forKey:kOTRSettingKeyDeleteOnDisconnect]; - OTRCertificateSetting * certSetting = [[OTRCertificateSetting alloc] initWithTitle:PINNED_CERTIFICATES_STRING - description:PINNED_CERTIFICATES_DESCRIPTION_STRING]; + OTRCertificateSetting * certSetting = [[OTRCertificateSetting alloc] initWithTitle:PINNED_CERTIFICATES_STRING() + description:PINNED_CERTIFICATES_DESCRIPTION_STRING()]; certSetting.accessoryType = UITableViewCellAccessoryDisclosureIndicator; if (![PushController canReceivePushNotifications] || [PushController getPushPreference] != PushPreferenceEnabled) { - OTRViewSetting *pushViewSetting = [[OTRViewSetting alloc] initWithTitle:CHATSECURE_PUSH_STRING description:nil viewControllerClass:[EnablePushViewController class]]; + OTRViewSetting *pushViewSetting = [[OTRViewSetting alloc] initWithTitle:CHATSECURE_PUSH_STRING() description:nil viewControllerClass:[EnablePushViewController class]]; pushViewSetting.accessoryType = UITableViewCellAccessoryDisclosureIndicator; - OTRSettingsGroup *pushGroup = [[OTRSettingsGroup alloc] initWithTitle:PUSH_TITLE_STRING settings:@[pushViewSetting]]; + OTRSettingsGroup *pushGroup = [[OTRSettingsGroup alloc] initWithTitle:PUSH_TITLE_STRING() settings:@[pushViewSetting]]; [settingsGroups addObject:pushGroup]; } NSArray *chatSettings = @[deletedDisconnectedConversations]; - OTRSettingsGroup *chatSettingsGroup = [[OTRSettingsGroup alloc] initWithTitle:CHAT_STRING settings:chatSettings]; + OTRSettingsGroup *chatSettingsGroup = [[OTRSettingsGroup alloc] initWithTitle:CHAT_STRING() settings:chatSettings]; [settingsGroups addObject:chatSettingsGroup]; NSArray * securitySettings = @[certSetting]; - OTRSettingsGroup *securitySettingsGroup = [[OTRSettingsGroup alloc] initWithTitle:SECURITY_STRING settings:securitySettings]; + OTRSettingsGroup *securitySettingsGroup = [[OTRSettingsGroup alloc] initWithTitle:SECURITY_STRING() settings:securitySettings]; [settingsGroups addObject:securitySettingsGroup]; - OTRFeedbackSetting * feedbackViewSetting = [[OTRFeedbackSetting alloc] initWithTitle:SEND_FEEDBACK_STRING description:nil]; + OTRFeedbackSetting * feedbackViewSetting = [[OTRFeedbackSetting alloc] initWithTitle:SEND_FEEDBACK_STRING() description:nil]; feedbackViewSetting.imageName = @"18-envelope.png"; - OTRShareSetting * shareViewSetting = [[OTRShareSetting alloc] initWithTitle:SHARE_STRING description:nil]; + OTRShareSetting * shareViewSetting = [[OTRShareSetting alloc] initWithTitle:SHARE_STRING() description:nil]; shareViewSetting.imageName = @"275-broadcast.png"; - OTRLanguageSetting * languageSetting = [[OTRLanguageSetting alloc]initWithTitle:LANGUAGE_STRING description:nil settingsKey:kOTRSettingKeyLanguage]; + OTRLanguageSetting * languageSetting = [[OTRLanguageSetting alloc]initWithTitle:LANGUAGE_STRING() description:nil settingsKey:kOTRSettingKeyLanguage]; languageSetting.imageName = @"globe.png"; [newSettingsDictionary setObject:languageSetting forKey:kOTRSettingKeyLanguage]; - OTRDonateSetting *donateSetting = [[OTRDonateSetting alloc] initWithTitle:DONATE_STRING description:nil]; + OTRDonateSetting *donateSetting = [[OTRDonateSetting alloc] initWithTitle:DONATE_STRING() description:nil]; donateSetting.imageName = @"29-heart.png"; @@ -114,7 +114,7 @@ - (void) populateSettings viewControllerClass:[OTRLogListViewController class]]; [otherSettings addObject:logsSetting]; #endif - OTRSettingsGroup *otherGroup = [[OTRSettingsGroup alloc] initWithTitle:OTHER_STRING settings:otherSettings]; + OTRSettingsGroup *otherGroup = [[OTRSettingsGroup alloc] initWithTitle:OTHER_STRING() settings:otherSettings]; [settingsGroups addObject:otherGroup]; _settingsDictionary = newSettingsDictionary; _settingsGroups = settingsGroups; diff --git a/ChatSecure/Classes/Controllers/ShareController.swift b/ChatSecure/Classes/Controllers/ShareController.swift index 8b57746d1..ab152da13 100644 --- a/ChatSecure/Classes/Controllers/ShareController.swift +++ b/ChatSecure/Classes/Controllers/ShareController.swift @@ -7,6 +7,7 @@ // import UIKit +import OTRAssets public class ShareControllerURLSource: NSObject, UIActivityItemSource { public var account: OTRAccount? @@ -26,11 +27,11 @@ public class ShareControllerURLSource: NSObject, UIActivityItemSource { } public func activityViewController(activityViewController: UIActivityViewController, subjectForActivityType activityType: String?) -> String { - var name = OTRLanguageManager.translatedString("Someone") + var name = SOMEONE_STRING() if let displayName = account?.username { name = displayName } - let chatString = OTRLanguageManager.translatedString("wants to chat.") + let chatString = WANTS_TO_CHAT_STRING() let text = "\(name) \(chatString)" return text } diff --git a/ChatSecure/Classes/Controllers/XMPP/OTRYapDatabaseRosterStorage.m b/ChatSecure/Classes/Controllers/XMPP/OTRYapDatabaseRosterStorage.m index fb84d44b7..193b3a0e6 100644 --- a/ChatSecure/Classes/Controllers/XMPP/OTRYapDatabaseRosterStorage.m +++ b/ChatSecure/Classes/Controllers/XMPP/OTRYapDatabaseRosterStorage.m @@ -13,7 +13,7 @@ #import "OTRLog.h" #import "OTRXMPPBuddy.h" #import "OTRXMPPAccount.h" -#import "OTRLanguageManager.h" + #import "OTRBuddyCache.h" @import OTRAssets; @@ -216,27 +216,27 @@ - (void)handlePresence:(XMPPPresence *)presence xmppStream:(XMPPStream *)stream NSString *resource = [presence from].resource; OTRThreadStatus newStatus = OTRThreadStatusOffline; - NSString *newStatusMessage = OFFLINE_STRING; + NSString *newStatusMessage = OFFLINE_STRING(); if (buddy && !([[presence type] isEqualToString:@"unavailable"] || [presence isErrorPresence])) { - NSString *defaultMessage = OFFLINE_STRING; + NSString *defaultMessage = OFFLINE_STRING(); switch (presence.intShow) { case 0 : newStatus = OTRThreadStatusDoNotDisturb; - newStatusMessage = DO_NOT_DISTURB_STRING; + newStatusMessage = DO_NOT_DISTURB_STRING(); break; case 1 : newStatus = OTRThreadStatusExtendedAway; - newStatusMessage = EXTENDED_AWAY_STRING; + newStatusMessage = EXTENDED_AWAY_STRING(); break; case 2 : newStatus = OTRThreadStatusAway; - newStatusMessage = AWAY_STRING; + newStatusMessage = AWAY_STRING(); break; case 3 : case 4 : newStatus =OTRThreadStatusAvailable; - newStatusMessage = AVAILABLE_STRING; + newStatusMessage = AVAILABLE_STRING(); break; default : break; diff --git a/ChatSecure/Classes/Model/OTRActivityItemProvider.m b/ChatSecure/Classes/Model/OTRActivityItemProvider.m index c2db3484c..b2c3ac721 100644 --- a/ChatSecure/Classes/Model/OTRActivityItemProvider.m +++ b/ChatSecure/Classes/Model/OTRActivityItemProvider.m @@ -9,9 +9,9 @@ #import "OTRActivityItemProvider.h" @import OTRAssets; #import "OTRQRCodeActivity.h" -#import "OTRLanguageManager.h" -static NSString *const kShareURL = @"https://get.chatsecure.org"; + +static NSString *const kShareURL = @"https://chatsecure.org"; @implementation OTRActivityItemProvider @@ -34,7 +34,7 @@ -(id)activityViewController:(UIActivityViewController *)activityViewController i } - (NSString*) shareString { - return [NSString stringWithFormat:@"%@: %@", SHARE_MESSAGE_STRING, kShareURL]; + return [NSString stringWithFormat:@"%@: %@", SHARE_MESSAGE_STRING(), kShareURL]; } - (NSString*) twitterShareString { diff --git a/ChatSecure/Classes/Model/OTROpenInFacebookActivity.m b/ChatSecure/Classes/Model/OTROpenInFacebookActivity.m index 5030fe6a0..9485652fc 100644 --- a/ChatSecure/Classes/Model/OTROpenInFacebookActivity.m +++ b/ChatSecure/Classes/Model/OTROpenInFacebookActivity.m @@ -11,7 +11,7 @@ #import "UIImage+ChatSecure.h" #import "UIActivity+ChatSecure.h" @import OTRAssets; -#import "OTRLanguageManager.h" + @interface OTROpenInFacebookActivity () @@ -40,7 +40,7 @@ - (NSURL *)urlFromActivities:(NSArray *)activityItems - (NSString *)activityTitle { - return OPEN_IN_FACEBOOK_STRING; + return OPEN_IN_FACEBOOK_STRING(); } - (NSString *)activityType diff --git a/ChatSecure/Classes/Model/OTROpenInTwitterActivity.m b/ChatSecure/Classes/Model/OTROpenInTwitterActivity.m index d5a5aa7ce..a7b2badb0 100644 --- a/ChatSecure/Classes/Model/OTROpenInTwitterActivity.m +++ b/ChatSecure/Classes/Model/OTROpenInTwitterActivity.m @@ -11,7 +11,7 @@ #import "UIImage+ChatSecure.h" #import "UIActivity+ChatSecure.h" @import OTRAssets; -#import "OTRLanguageManager.h" + @interface OTROpenInTwitterActivity () @@ -40,7 +40,7 @@ - (NSURL *)urlFromActivities:(NSArray *)activityItems - (NSString *)activityTitle { - return OPEN_IN_TWITTER_STRING; + return OPEN_IN_TWITTER_STRING(); } - (NSString *)activityType diff --git a/ChatSecure/Classes/Model/OTRQRCodeActivity.m b/ChatSecure/Classes/Model/OTRQRCodeActivity.m index a19f77d70..bf097c45a 100644 --- a/ChatSecure/Classes/Model/OTRQRCodeActivity.m +++ b/ChatSecure/Classes/Model/OTRQRCodeActivity.m @@ -9,7 +9,7 @@ #import "OTRQRCodeActivity.h" #import "UIImage+ChatSecure.h" #import "UIActivity+ChatSecure.h" -#import "OTRLanguageManager.h" + @import OTRAssets; NSString *const kOTRActivityTypeQRCode = @"OTRActivityTypeQRCode"; @@ -23,7 +23,7 @@ @implementation OTRQRCodeActivity -(NSString *)activityTitle { - return QR_CODE_STRING; + return QR_CODE_STRING(); } -(NSString *)activityType diff --git a/ChatSecure/Classes/Model/Settings/OTRLanguageSetting.h b/ChatSecure/Classes/Model/Settings/OTRLanguageSetting.h index d8aa167db..bb6f83093 100644 --- a/ChatSecure/Classes/Model/Settings/OTRLanguageSetting.h +++ b/ChatSecure/Classes/Model/Settings/OTRLanguageSetting.h @@ -7,7 +7,7 @@ // #import "OTRListSetting.h" -#import "OTRLanguageManager.h" + @interface OTRLanguageSetting : OTRListSetting diff --git a/ChatSecure/Classes/Model/Settings/OTRLanguageSetting.m b/ChatSecure/Classes/Model/Settings/OTRLanguageSetting.m index e09285f20..86dd962cb 100644 --- a/ChatSecure/Classes/Model/Settings/OTRLanguageSetting.m +++ b/ChatSecure/Classes/Model/Settings/OTRLanguageSetting.m @@ -52,7 +52,7 @@ - (void)generatePossibleValues:(NSArray *)languageCodes return NSOrderedSame; }]; - OTRListSettingValue *defaultValue = [[OTRListSettingValue alloc] initWithTitle:DEFAULT_LANGUAGE_STRING detail:nil value:kOTRDefaultLanguageLocale]; + OTRListSettingValue *defaultValue = [[OTRListSettingValue alloc] initWithTitle:DEFAULT_LANGUAGE_STRING() detail:nil value:kOTRDefaultLanguageLocale]; [tempPossibleValues insertObject:defaultValue atIndex:0]; diff --git a/ChatSecure/Classes/Model/Yap Storage/Accounts/OTRGoogleOAuthXMPPAccount.m b/ChatSecure/Classes/Model/Yap Storage/Accounts/OTRGoogleOAuthXMPPAccount.m index 22a028ed6..fad63aa6e 100644 --- a/ChatSecure/Classes/Model/Yap Storage/Accounts/OTRGoogleOAuthXMPPAccount.m +++ b/ChatSecure/Classes/Model/Yap Storage/Accounts/OTRGoogleOAuthXMPPAccount.m @@ -10,7 +10,7 @@ @import gtm_oauth2; @import OTRAssets; #import "OTRConstants.h" -#import "OTRLanguageManager.h" + NSString *const kOTRExpirationDateKey = @"kOTRExpirationDateKey"; NSString *const kOTRExpiresInKey = @"expires_in"; @@ -24,7 +24,7 @@ - (UIImage *)accountImage } - (NSString *)accountDisplayName { - return GOOGLE_TALK_STRING; + return GOOGLE_TALK_STRING(); } -(NSString *)accessTokenString { diff --git a/ChatSecure/Classes/Model/Yap Storage/Accounts/OTRXMPPAccount.m b/ChatSecure/Classes/Model/Yap Storage/Accounts/OTRXMPPAccount.m index 2394a35e2..3397ec310 100644 --- a/ChatSecure/Classes/Model/Yap Storage/Accounts/OTRXMPPAccount.m +++ b/ChatSecure/Classes/Model/Yap Storage/Accounts/OTRXMPPAccount.m @@ -10,7 +10,7 @@ #import "OTRXMPPManager.h" #import "OTRConstants.h" @import OTRAssets; -#import "OTRLanguageManager.h" + @import XMPPFramework; static NSUInteger const OTRDefaultPortNumber = 5222; @@ -48,7 +48,7 @@ - (UIImage *)accountImage } - (NSString *)accountDisplayName { - return JABBER_STRING; + return JABBER_STRING(); } - (Class)protocolClass { diff --git a/ChatSecure/Classes/Model/Yap Storage/Accounts/OTRXMPPTorAccount.m b/ChatSecure/Classes/Model/Yap Storage/Accounts/OTRXMPPTorAccount.m index 95be02ebc..988d987c7 100644 --- a/ChatSecure/Classes/Model/Yap Storage/Accounts/OTRXMPPTorAccount.m +++ b/ChatSecure/Classes/Model/Yap Storage/Accounts/OTRXMPPTorAccount.m @@ -9,7 +9,7 @@ #import "OTRXMPPTorAccount.h" #import "OTRXMPPTorManager.h" -#import "OTRLanguageManager.h" + @import OTRAssets; @@ -22,7 +22,7 @@ - (UIImage *)accountImage - (NSString *)accountDisplayName { - return XMPP_TOR_STRING; + return XMPP_TOR_STRING(); } - (Class)protocolClass{ diff --git a/ChatSecure/Classes/Model/Yap Storage/OTRBaseMessage.m b/ChatSecure/Classes/Model/Yap Storage/OTRBaseMessage.m index 10f85af12..b3bd88f58 100644 --- a/ChatSecure/Classes/Model/Yap Storage/OTRBaseMessage.m +++ b/ChatSecure/Classes/Model/Yap Storage/OTRBaseMessage.m @@ -15,7 +15,7 @@ @import OTRAssets; #import "OTRConstants.h" #import "OTRMediaItem.h" -#import "OTRLanguageManager.h" + #import "OTRMessageEncryptionInfo.h" #import diff --git a/ChatSecure/Classes/OTRAppDelegate.m b/ChatSecure/Classes/OTRAppDelegate.m index 8e2ad4402..8e555f433 100644 --- a/ChatSecure/Classes/OTRAppDelegate.m +++ b/ChatSecure/Classes/OTRAppDelegate.m @@ -30,7 +30,7 @@ @import Appirater; #import "OTRConstants.h" -#import "OTRLanguageManager.h" + #import "OTRUtilities.h" #import "OTRAccountsManager.h" #import "OTRSettingsManager.h" @@ -196,10 +196,10 @@ - (void) setupCrashReporting { // Setup Crash Reporting KSCrashInstallationHockey* installation = [KSCrashInstallationHockey sharedInstance]; - [installation addConditionalAlertWithTitle:[OTRLanguageManager translatedString:@"Crash Detected"] - message:[OTRLanguageManager translatedString:@"The app crashed last time it was launched. Send a crash report?"] - yesAnswer:OK_STRING - noAnswer:CANCEL_STRING]; + [installation addConditionalAlertWithTitle:Crash_Detected_Title() + message:Crash_Detected_Message() + yesAnswer:OK_STRING() + noAnswer:CANCEL_STRING()]; installation.appIdentifier = [OTRSecrets hockeyLiveIdentifier]; @@ -238,7 +238,7 @@ - (UISplitViewController *)setupDefaultSplitViewControllerWithLeadingViewControl UISplitViewController *splitViewController = [[UISplitViewController alloc] init]; splitViewController.viewControllers = @[leadingViewController,messagesNavigationController]; splitViewController.delegate = self.splitViewControllerDelegate; - splitViewController.title = CHAT_STRING; + splitViewController.title = CHAT_STRING(); //setup 'back' button in nav bar messagesNavigationController.topViewController.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem; @@ -465,7 +465,7 @@ - (void)handleInvite:(NSString *)jidString fingerprint:(NSString *)otrFingerprin if (otrFingerprint.length == 40) { message = [message stringByAppendingFormat:@"\n%@", otrFingerprint]; } - UIAlertController *alert = [UIAlertController alertControllerWithTitle:ADD_BUDDY_STRING message:message preferredStyle:(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) ? UIAlertControllerStyleActionSheet : UIAlertControllerStyleAlert]; + UIAlertController *alert = [UIAlertController alertControllerWithTitle:ADD_BUDDY_STRING() message:message preferredStyle:(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) ? UIAlertControllerStyleActionSheet : UIAlertControllerStyleAlert]; __block NSArray *accounts = nil; [[OTRDatabaseManager sharedInstance].readOnlyDatabaseConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) { accounts = [OTRAccount allAccountsWithTransaction:transaction]; @@ -475,7 +475,7 @@ - (void)handleInvite:(NSString *)jidString fingerprint:(NSString *)otrFingerprin // Not the best way to do this, but only show "Add" if you have a single account, otherwise show the account name to add it to. NSString *title = nil; if (accounts.count == 1) { - title = ADD_STRING; + title = ADD_STRING(); } else { title = account.username; } @@ -495,7 +495,7 @@ - (void)handleInvite:(NSString *)jidString fingerprint:(NSString *)otrFingerprin }]; if (alert.actions.count > 0) { // No need to show anything if only option is "cancel" - UIAlertAction *cancel = [UIAlertAction actionWithTitle:CANCEL_STRING style:UIAlertActionStyleCancel handler:nil]; + UIAlertAction *cancel = [UIAlertAction actionWithTitle:CANCEL_STRING() style:UIAlertActionStyleCancel handler:nil]; [alert addAction:cancel]; [self.window.rootViewController presentViewController:alert animated:YES completion:nil]; } diff --git a/ChatSecure/Classes/Utilities/OTRXMPPError.m b/ChatSecure/Classes/Utilities/OTRXMPPError.m index 721170f0d..243a46d1c 100644 --- a/ChatSecure/Classes/Utilities/OTRXMPPError.m +++ b/ChatSecure/Classes/Utilities/OTRXMPPError.m @@ -10,7 +10,7 @@ @import XMPPFramework; @import OTRAssets; -#import "OTRLanguageManager.h" + #import NSString *const OTRXMPPErrorDomain = @"OTRXMPPErrorDomain"; @@ -98,57 +98,57 @@ + (NSString *)errorStringWithTrustResultType:(SecTrustResultType)resultType + (NSString *)errorStringWithSSLStatus:(OSStatus)status { switch (status) { - case noErr : return noErrString; - case errSSLProtocol : return errSSLProtocolString; - case errSSLNegotiation : return errSSLNegotiationString; - case errSSLFatalAlert : return errSSLFatalAlertString; - case errSSLWouldBlock : return errSSLWouldBlockString; - case errSSLSessionNotFound : return errSSLSessionNotFoundString; - case errSSLClosedGraceful : return errSSLClosedGracefulString; - case errSSLClosedAbort : return errSSLClosedAbortString; - case errSSLXCertChainInvalid : return errSSLXCertChainInvalidString; - case errSSLBadCert : return errSSLBadCertString; - case errSSLCrypto : return errSSLCryptoString; - case errSSLInternal : return errSSLInternalString; - case errSSLModuleAttach : return errSSLModuleAttachString; - case errSSLUnknownRootCert : return errSSLUnknownRootCertString; - case errSSLNoRootCert : return errSSLNoRootCertString; - case errSSLCertExpired : return errSSLCertExpiredString; - case errSSLCertNotYetValid : return errSSLCertNotYetValidString; - case errSSLClosedNoNotify : return errSSLClosedNoNotifyString; - case errSSLBufferOverflow : return errSSLBufferOverflowString; - case errSSLBadCipherSuite : return errSSLBadCipherSuiteString; - case errSSLPeerUnexpectedMsg : return errSSLPeerUnexpectedMsgString; - case errSSLPeerBadRecordMac : return errSSLPeerBadRecordMacString; - case errSSLPeerDecryptionFail : return errSSLPeerDecryptionFailString; - case errSSLPeerRecordOverflow : return errSSLPeerRecordOverflowString; - case errSSLPeerDecompressFail : return errSSLPeerDecompressFailString; - case errSSLPeerHandshakeFail : return errSSLPeerHandshakeFailString; - case errSSLPeerBadCert : return errSSLPeerBadCertString; - case errSSLPeerUnsupportedCert : return errSSLPeerUnsupportedCertString; - case errSSLPeerCertRevoked : return errSSLPeerCertRevokedString; - case errSSLPeerCertExpired : return errSSLPeerCertExpiredString; - case errSSLPeerCertUnknown : return errSSLPeerCertUnknownString; - case errSSLIllegalParam : return errSSLIllegalParamString; - case errSSLPeerUnknownCA : return errSSLPeerUnknownCAString; - case errSSLPeerAccessDenied : return errSSLPeerAccessDeniedString; - case errSSLPeerDecodeError : return errSSLPeerDecodeErrorString; - case errSSLPeerDecryptError : return errSSLPeerDecryptErrorString; - case errSSLPeerExportRestriction : return errSSLPeerExportRestrictionString; - case errSSLPeerProtocolVersion : return errSSLPeerProtocolVersionString; - case errSSLPeerInsufficientSecurity : return errSSLPeerInsufficientSecurityString; - case errSSLPeerInternalError : return errSSLPeerInternalErrorString; - case errSSLPeerUserCancelled : return errSSLPeerUserCancelledString; - case errSSLPeerNoRenegotiation : return errSSLPeerNoRenegotiationString; - case errSSLPeerAuthCompleted : return errSSLPeerAuthCompletedString; - case errSSLClientCertRequested : return errSSLClientCertRequestedString; - case errSSLHostNameMismatch : return errSSLHostNameMismatchString; - case errSSLConnectionRefused : return errSSLConnectionRefusedString; - case errSSLDecryptionFail : return errSSLDecryptionFailString; - case errSSLBadRecordMac : return errSSLBadRecordMacString; - case errSSLRecordOverflow : return errSSLRecordOverflowString; - case errSSLBadConfiguration : return errSSLBadConfigurationString; - case errSSLUnexpectedRecord : return errSSLUnexpectedRecordString; + case noErr : return noErrString(); + case errSSLProtocol : return errSSLProtocolString(); + case errSSLNegotiation : return errSSLNegotiationString(); + case errSSLFatalAlert : return errSSLFatalAlertString(); + case errSSLWouldBlock : return errSSLWouldBlockString(); + case errSSLSessionNotFound : return errSSLSessionNotFoundString(); + case errSSLClosedGraceful : return errSSLClosedGracefulString(); + case errSSLClosedAbort : return errSSLClosedAbortString(); + case errSSLXCertChainInvalid : return errSSLXCertChainInvalidString(); + case errSSLBadCert : return errSSLBadCertString(); + case errSSLCrypto : return errSSLCryptoString(); + case errSSLInternal : return errSSLInternalString(); + case errSSLModuleAttach : return errSSLModuleAttachString(); + case errSSLUnknownRootCert : return errSSLUnknownRootCertString(); + case errSSLNoRootCert : return errSSLNoRootCertString(); + case errSSLCertExpired : return errSSLCertExpiredString(); + case errSSLCertNotYetValid : return errSSLCertNotYetValidString(); + case errSSLClosedNoNotify : return errSSLClosedNoNotifyString(); + case errSSLBufferOverflow : return errSSLBufferOverflowString(); + case errSSLBadCipherSuite : return errSSLBadCipherSuiteString(); + case errSSLPeerUnexpectedMsg : return errSSLPeerUnexpectedMsgString(); + case errSSLPeerBadRecordMac : return errSSLPeerBadRecordMacString(); + case errSSLPeerDecryptionFail : return errSSLPeerDecryptionFailString(); + case errSSLPeerRecordOverflow : return errSSLPeerRecordOverflowString(); + case errSSLPeerDecompressFail : return errSSLPeerDecompressFailString(); + case errSSLPeerHandshakeFail : return errSSLPeerHandshakeFailString(); + case errSSLPeerBadCert : return errSSLPeerBadCertString(); + case errSSLPeerUnsupportedCert : return errSSLPeerUnsupportedCertString(); + case errSSLPeerCertRevoked : return errSSLPeerCertRevokedString(); + case errSSLPeerCertExpired : return errSSLPeerCertExpiredString(); + case errSSLPeerCertUnknown : return errSSLPeerCertUnknownString(); + case errSSLIllegalParam : return errSSLIllegalParamString(); + case errSSLPeerUnknownCA : return errSSLPeerUnknownCAString(); + case errSSLPeerAccessDenied : return errSSLPeerAccessDeniedString(); + case errSSLPeerDecodeError : return errSSLPeerDecodeErrorString(); + case errSSLPeerDecryptError : return errSSLPeerDecryptErrorString(); + case errSSLPeerExportRestriction : return errSSLPeerExportRestrictionString(); + case errSSLPeerProtocolVersion : return errSSLPeerProtocolVersionString(); + case errSSLPeerInsufficientSecurity : return errSSLPeerInsufficientSecurityString(); + case errSSLPeerInternalError : return errSSLPeerInternalErrorString(); + case errSSLPeerUserCancelled : return errSSLPeerUserCancelledString(); + case errSSLPeerNoRenegotiation : return errSSLPeerNoRenegotiationString(); + case errSSLPeerAuthCompleted : return errSSLPeerAuthCompletedString(); + case errSSLClientCertRequested : return errSSLClientCertRequestedString(); + case errSSLHostNameMismatch : return errSSLHostNameMismatchString(); + case errSSLConnectionRefused : return errSSLConnectionRefusedString(); + case errSSLDecryptionFail : return errSSLDecryptionFailString(); + case errSSLBadRecordMac : return errSSLBadRecordMacString(); + case errSSLRecordOverflow : return errSSLRecordOverflowString(); + case errSSLBadConfiguration : return errSSLBadConfigurationString(); + case errSSLUnexpectedRecord : return errSSLUnexpectedRecordString(); } return nil; } diff --git a/ChatSecure/Classes/View Controllers/Login View Controllers/OTRBaseLoginViewController.m b/ChatSecure/Classes/View Controllers/Login View Controllers/OTRBaseLoginViewController.m index f9e4a2227..08a6d571d 100644 --- a/ChatSecure/Classes/View Controllers/Login View Controllers/OTRBaseLoginViewController.m +++ b/ChatSecure/Classes/View Controllers/Login View Controllers/OTRBaseLoginViewController.m @@ -19,7 +19,7 @@ #import "OTRXMPPServerInfo.h" #import "OTRXMPPAccount.h" @import OTRAssets; -#import "OTRLanguageManager.h" + #import "OTRInviteViewController.h" #import "NSString+ChatSecure.h" @@ -45,7 +45,7 @@ - (void)viewDidLoad { self.navigationItem.rightBarButtonItem = checkButton; if (self.readOnly) { - self.title = ACCOUNT_STRING; + self.title = ACCOUNT_STRING(); } } @@ -272,18 +272,18 @@ - (void)handleXMPPError:(NSError *)error } } - [self showAlertViewWithTitle:ERROR_STRING message:XMPP_FAIL_STRING error:error]; + [self showAlertViewWithTitle:ERROR_STRING() message:XMPP_FAIL_STRING() error:error]; } - (void)showAlertViewWithTitle:(NSString *)title message:(NSString *)message error:(NSError *)error { dispatch_async(dispatch_get_main_queue(), ^{ - UIAlertAction * okButtonItem = [UIAlertAction actionWithTitle:OK_STRING style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + UIAlertAction * okButtonItem = [UIAlertAction actionWithTitle:OK_STRING() style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { }]; UIAlertController * alertController = nil; if (error) { - UIAlertAction * infoButton = [UIAlertAction actionWithTitle:INFO_STRING style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + UIAlertAction * infoButton = [UIAlertAction actionWithTitle:INFO_STRING() style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { NSString * errorDescriptionString = [NSString stringWithFormat:@"%@ : %@",[error domain],[error localizedDescription]]; NSString *xmlErrorString = error.userInfo[OTRXMPPXMLErrorKey]; if (xmlErrorString) { @@ -298,14 +298,14 @@ - (void)showAlertViewWithTitle:(NSString *)title message:(NSString *)message err } - UIAlertAction * copyButtonItem = [UIAlertAction actionWithTitle:COPY_STRING style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + UIAlertAction * copyButtonItem = [UIAlertAction actionWithTitle:COPY_STRING() style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { NSString * copyString = [NSString stringWithFormat:@"Domain: %@\nCode: %ld\nUserInfo: %@",[error domain],(long)[error code],[error userInfo]]; UIPasteboard *pasteBoard = [UIPasteboard generalPasteboard]; [pasteBoard setString:copyString]; }]; - UIAlertController *alert = [UIAlertController alertControllerWithTitle:INFO_STRING message:errorDescriptionString preferredStyle:UIAlertControllerStyleAlert]; + UIAlertController *alert = [UIAlertController alertControllerWithTitle:INFO_STRING() message:errorDescriptionString preferredStyle:UIAlertControllerStyleAlert]; [alert addAction:okButtonItem]; [alert addAction:copyButtonItem]; [self presentViewController:alert animated:YES completion:nil]; @@ -335,31 +335,31 @@ - (void)showCertWarningForCertificateData:(NSData *)certData withHostname:(NSStr NSString * fingerprint = [OTRCertificatePinning sha256FingerprintForCertificate:certificate]; NSString * message = [NSString stringWithFormat:@"%@\n\nSHA256\n%@",hostname,fingerprint]; - UIAlertController *certAlert = [UIAlertController alertControllerWithTitle:NEW_CERTIFICATE_STRING message:nil preferredStyle:UIAlertControllerStyleAlert]; + UIAlertController *certAlert = [UIAlertController alertControllerWithTitle:NEW_CERTIFICATE_STRING() message:nil preferredStyle:UIAlertControllerStyleAlert]; if (![OTRCertificatePinning publicKeyWithCertData:certData]) { //no public key not able to save because won't be able evaluate later - message = [message stringByAppendingString:[NSString stringWithFormat:@"\n\nX %@",PUBLIC_KEY_ERROR_STRING]]; + message = [message stringByAppendingString:[NSString stringWithFormat:@"\n\nX %@",PUBLIC_KEY_ERROR_STRING()]]; - UIAlertAction *action = [UIAlertAction actionWithTitle:OK_STRING style:UIAlertActionStyleCancel handler:nil]; + UIAlertAction *action = [UIAlertAction actionWithTitle:OK_STRING() style:UIAlertActionStyleCancel handler:nil]; [certAlert addAction:action]; } else { if (resultType == kSecTrustResultProceed || resultType == kSecTrustResultUnspecified) { //#52A352 - message = [message stringByAppendingString:[NSString stringWithFormat:@"\n\n✓ %@",VALID_CERTIFICATE_STRING]]; + message = [message stringByAppendingString:[NSString stringWithFormat:@"\n\n✓ %@",VALID_CERTIFICATE_STRING()]]; } else { NSString * sslErrorMessage = [OTRXMPPError errorStringWithTrustResultType:resultType]; message = [message stringByAppendingString:[NSString stringWithFormat:@"\n\nX %@",sslErrorMessage]]; } - UIAlertAction *rejectAction = [UIAlertAction actionWithTitle:REJECT_STRING style:UIAlertActionStyleDestructive handler:nil]; + UIAlertAction *rejectAction = [UIAlertAction actionWithTitle:REJECT_STRING() style:UIAlertActionStyleDestructive handler:nil]; [certAlert addAction:rejectAction]; __weak __typeof__(self) weakSelf = self; - UIAlertAction *saveAction = [UIAlertAction actionWithTitle:SAVE_STRING style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + UIAlertAction *saveAction = [UIAlertAction actionWithTitle:SAVE_STRING() style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { __typeof__(self) strongSelf = weakSelf; [OTRCertificatePinning addCertificate:[OTRCertificatePinning certForData:certData] withHostName:hostname]; [strongSelf loginButtonPressed:nil]; diff --git a/ChatSecure/Classes/View Controllers/Login View Controllers/OTRXLFormCreator.m b/ChatSecure/Classes/View Controllers/Login View Controllers/OTRXLFormCreator.m index fd2cacfc5..12769d4c8 100644 --- a/ChatSecure/Classes/View Controllers/Login View Controllers/OTRXLFormCreator.m +++ b/ChatSecure/Classes/View Controllers/Login View Controllers/OTRXLFormCreator.m @@ -15,7 +15,7 @@ #import "OTRXMPPServerListViewController.h" #import "OTRXMPPServerInfo.h" #import -#import "OTRLanguageManager.h" + #import "OTRXMPPTorAccount.h" NSString *const kOTRXLFormCustomizeUsernameSwitchTag = @"kOTRXLFormCustomizeUsernameSwitchTag"; @@ -72,28 +72,28 @@ + (XLFormDescriptor *)formForAccount:(OTRAccount *)account + (XLFormDescriptor *)formForAccountType:(OTRAccountType)accountType createAccount:(BOOL)createAccount { XLFormDescriptor *descriptor = nil; - XLFormRowDescriptor *nicknameRow = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormNicknameTextFieldTag rowType:XLFormRowDescriptorTypeText title:[OTRLanguageManager translatedString:@"Nickname"]]; + XLFormRowDescriptor *nicknameRow = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormNicknameTextFieldTag rowType:XLFormRowDescriptorTypeText title:Nickname_String()]; if (createAccount) { - descriptor = [XLFormDescriptor formDescriptorWithTitle:SIGN_UP_STRING]; + descriptor = [XLFormDescriptor formDescriptorWithTitle:SIGN_UP_STRING()]; descriptor.assignFirstResponderOnShow = YES; - XLFormSectionDescriptor *basicSection = [XLFormSectionDescriptor formSectionWithTitle:[OTRLanguageManager translatedString:@"Basic Setup"]]; - basicSection.footerTitle = [OTRLanguageManager translatedString:@"Think of a unique nickname that you don't use anywhere else and doesn't contain personal information."]; + XLFormSectionDescriptor *basicSection = [XLFormSectionDescriptor formSectionWithTitle:Basic_Setup()]; + basicSection.footerTitle = Basic_Setup_Hint(); nicknameRow.required = YES; [basicSection addFormRow:nicknameRow]; XLFormSectionDescriptor *showAdvancedSection = [XLFormSectionDescriptor formSectionWithTitle:nil]; - XLFormRowDescriptor *showAdvancedRow = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormShowAdvancedTag rowType:XLFormRowDescriptorTypeBooleanSwitch title:[OTRLanguageManager translatedString:@"Show Advanced Options"]]; + XLFormRowDescriptor *showAdvancedRow = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormShowAdvancedTag rowType:XLFormRowDescriptorTypeBooleanSwitch title:Show_Advanced_Options()]; showAdvancedRow.value = @0; [showAdvancedSection addFormRow:showAdvancedRow]; - XLFormSectionDescriptor *accountSection = [XLFormSectionDescriptor formSectionWithTitle:ACCOUNT_STRING]; - accountSection.footerTitle = [OTRLanguageManager translatedString:@"We can automatically generate you a secure password. If you choose your own, make sure it's a unique password you don't use anywhere else."]; + XLFormSectionDescriptor *accountSection = [XLFormSectionDescriptor formSectionWithTitle:ACCOUNT_STRING()]; + accountSection.footerTitle = Generate_Secure_Password_Hint(); accountSection.hidden = [NSString stringWithFormat:@"$%@==0", kOTRXLFormShowAdvancedTag]; - XLFormRowDescriptor *generatePasswordRow = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormGenerateSecurePasswordTag rowType:XLFormRowDescriptorTypeBooleanSwitch title:[OTRLanguageManager translatedString:@"Generate Secure Password"]]; + XLFormRowDescriptor *generatePasswordRow = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormGenerateSecurePasswordTag rowType:XLFormRowDescriptorTypeBooleanSwitch title:Generate_Secure_Password()]; generatePasswordRow.value = @1; - XLFormRowDescriptor *customizeUsernameRow = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormCustomizeUsernameSwitchTag rowType:XLFormRowDescriptorTypeBooleanSwitch title:[OTRLanguageManager translatedString:@"Customize Username"]]; + XLFormRowDescriptor *customizeUsernameRow = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormCustomizeUsernameSwitchTag rowType:XLFormRowDescriptorTypeBooleanSwitch title:Customize_Username()]; customizeUsernameRow.value = @0; XLFormRowDescriptor *passwordRow = [self passwordTextFieldRowDescriptorWithValue:nil]; passwordRow.hidden = [NSString stringWithFormat:@"$%@==1", kOTRXLFormGenerateSecurePasswordTag]; @@ -104,14 +104,14 @@ + (XLFormDescriptor *)formForAccountType:(OTRAccountType)accountType createAccou [accountSection addFormRow:generatePasswordRow]; [accountSection addFormRow:passwordRow]; - XLFormSectionDescriptor *serverSection = [XLFormSectionDescriptor formSectionWithTitle:[OTRLanguageManager translatedString:@"Server"]]; + XLFormSectionDescriptor *serverSection = [XLFormSectionDescriptor formSectionWithTitle:Server_String()]; serverSection.hidden = [NSString stringWithFormat:@"$%@==0", kOTRXLFormShowAdvancedTag]; - serverSection.footerTitle = [OTRLanguageManager translatedString:@"Choose from our list of trusted servers, or use your own."]; + serverSection.footerTitle = Server_String_Hint(); [serverSection addFormRow:[self serverRowDescriptorWithValue:nil]]; XLFormSectionDescriptor *torSection = [XLFormSectionDescriptor formSectionWithTitle:@"Tor"]; - torSection.footerTitle = TOR_WARNING_MESSAGE_STRING; + torSection.footerTitle = TOR_WARNING_MESSAGE_STRING(); torSection.hidden = [NSString stringWithFormat:@"$%@==0", kOTRXLFormShowAdvancedTag]; [torSection addFormRow:[self torRowDescriptorWithValue:NO]]; @@ -121,11 +121,11 @@ + (XLFormDescriptor *)formForAccountType:(OTRAccountType)accountType createAccou [descriptor addFormSection:torSection]; [descriptor addFormSection:serverSection]; } else { - descriptor = [XLFormDescriptor formDescriptorWithTitle:LOGIN_STRING]; - XLFormSectionDescriptor *basicSection = [XLFormSectionDescriptor formSectionWithTitle:BASIC_STRING]; - XLFormSectionDescriptor *advancedSection = [XLFormSectionDescriptor formSectionWithTitle:ADVANCED_STRING]; + descriptor = [XLFormDescriptor formDescriptorWithTitle:LOGIN_STRING()]; + XLFormSectionDescriptor *basicSection = [XLFormSectionDescriptor formSectionWithTitle:BASIC_STRING()]; + XLFormSectionDescriptor *advancedSection = [XLFormSectionDescriptor formSectionWithTitle:ADVANCED_STRING()]; - [nicknameRow.cellConfigAtConfigure setObject:OPTIONAL_STRING forKey:@"textField.placeholder"]; + [nicknameRow.cellConfigAtConfigure setObject:OPTIONAL_STRING() forKey:@"textField.placeholder"]; [basicSection addFormRow:nicknameRow]; switch (accountType) { @@ -179,7 +179,7 @@ + (XLFormRowDescriptor *)textfieldFormDescriptorType:(NSString *)type withTag:(N + (XLFormRowDescriptor *)jidTextFieldRowDescriptorWithValue:(NSString *)value { - XLFormRowDescriptor *usernameDescriptor = [self textfieldFormDescriptorType:XLFormRowDescriptorTypeEmail withTag:kOTRXLFormUsernameTextFieldTag title:USERNAME_STRING placeHolder:XMPP_USERNAME_EXAMPLE_STRING value:value]; + XLFormRowDescriptor *usernameDescriptor = [self textfieldFormDescriptorType:XLFormRowDescriptorTypeEmail withTag:kOTRXLFormUsernameTextFieldTag title:USERNAME_STRING() placeHolder:XMPP_USERNAME_EXAMPLE_STRING() value:value]; usernameDescriptor.value = value; usernameDescriptor.required = YES; [usernameDescriptor addValidator:[[OTRUsernameValidator alloc] init]]; @@ -188,7 +188,7 @@ + (XLFormRowDescriptor *)jidTextFieldRowDescriptorWithValue:(NSString *)value + (XLFormRowDescriptor *)usernameTextFieldRowDescriptorWithValue:(NSString *)value { - XLFormRowDescriptor *usernameDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormUsernameTextFieldTag rowType:[OTRUsernameCell defaultRowDescriptorType] title:USERNAME_STRING]; + XLFormRowDescriptor *usernameDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormUsernameTextFieldTag rowType:[OTRUsernameCell defaultRowDescriptorType] title:USERNAME_STRING()]; usernameDescriptor.value = value; usernameDescriptor.required = YES; [usernameDescriptor addValidator:[[OTRUsernameValidator alloc] init]]; @@ -197,17 +197,17 @@ + (XLFormRowDescriptor *)usernameTextFieldRowDescriptorWithValue:(NSString *)val + (XLFormRowDescriptor *)passwordTextFieldRowDescriptorWithValue:(NSString *)value { - XLFormRowDescriptor *passwordDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormPasswordTextFieldTag rowType:XLFormRowDescriptorTypePassword title:PASSWORD_STRING]; + XLFormRowDescriptor *passwordDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormPasswordTextFieldTag rowType:XLFormRowDescriptorTypePassword title:PASSWORD_STRING()]; passwordDescriptor.value = value; passwordDescriptor.required = YES; - [passwordDescriptor.cellConfigAtConfigure setObject:REQUIRED_STRING forKey:@"textField.placeholder"]; + [passwordDescriptor.cellConfigAtConfigure setObject:REQUIRED_STRING() forKey:@"textField.placeholder"]; return passwordDescriptor; } + (XLFormRowDescriptor *)rememberPasswordRowDescriptorWithValue:(BOOL)value { - XLFormRowDescriptor *switchDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormRememberPasswordSwitchTag rowType:XLFormRowDescriptorTypeBooleanSwitch title:REMEMBER_PASSWORD_STRING]; + XLFormRowDescriptor *switchDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormRememberPasswordSwitchTag rowType:XLFormRowDescriptorTypeBooleanSwitch title:REMEMBER_PASSWORD_STRING()]; switchDescriptor.value = @(value); return switchDescriptor; @@ -215,7 +215,7 @@ + (XLFormRowDescriptor *)rememberPasswordRowDescriptorWithValue:(BOOL)value + (XLFormRowDescriptor *)loginAutomaticallyRowDescriptorWithValue:(BOOL)value { - XLFormRowDescriptor *loginDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormLoginAutomaticallySwitchTag rowType:XLFormRowDescriptorTypeBooleanSwitch title:LOGIN_AUTOMATICALLY_STRING]; + XLFormRowDescriptor *loginDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormLoginAutomaticallySwitchTag rowType:XLFormRowDescriptorTypeBooleanSwitch title:LOGIN_AUTOMATICALLY_STRING()]; loginDescriptor.value = @(value); return loginDescriptor; @@ -223,14 +223,14 @@ + (XLFormRowDescriptor *)loginAutomaticallyRowDescriptorWithValue:(BOOL)value + (XLFormRowDescriptor *)hostnameRowDescriptorWithValue:(NSString *)value { - return [self textfieldFormDescriptorType:XLFormRowDescriptorTypeURL withTag:kOTRXLFormHostnameTextFieldTag title:HOSTNAME_STRING placeHolder:OPTIONAL_STRING value:value]; + return [self textfieldFormDescriptorType:XLFormRowDescriptorTypeURL withTag:kOTRXLFormHostnameTextFieldTag title:HOSTNAME_STRING() placeHolder:OPTIONAL_STRING() value:value]; } + (XLFormRowDescriptor *)portRowDescriptorWithValue:(NSNumber *)value { NSString *defaultPortNumberString = [NSString stringWithFormat:@"%d",[OTRXMPPAccount defaultPort]]; - XLFormRowDescriptor *portRowDescriptor = [self textfieldFormDescriptorType:XLFormRowDescriptorTypeInteger withTag:kOTRXLFormPortTextFieldTag title:PORT_STRING placeHolder:defaultPortNumberString value:value]; + XLFormRowDescriptor *portRowDescriptor = [self textfieldFormDescriptorType:XLFormRowDescriptorTypeInteger withTag:kOTRXLFormPortTextFieldTag title:PORT_STRING() placeHolder:defaultPortNumberString value:value]; //Regex between 0 and 65536 for valid ports or empty [portRowDescriptor addValidator:[XLFormRegexValidator formRegexValidatorWithMsg:@"Incorect port number" regex:@"^$|^([1-9][0-9]{0,3}|[1-5][0-9]{0,4}|6[0-5]{0,2}[0-3][0-5])$"]]; @@ -239,14 +239,14 @@ + (XLFormRowDescriptor *)portRowDescriptorWithValue:(NSNumber *)value } + (XLFormRowDescriptor*) torRowDescriptorWithValue:(BOOL)value { - XLFormRowDescriptor *torRow = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormUseTorTag rowType:XLFormRowDescriptorTypeBooleanSwitch title:[OTRLanguageManager translatedString:@"Enable Tor"]]; + XLFormRowDescriptor *torRow = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormUseTorTag rowType:XLFormRowDescriptorTypeBooleanSwitch title:Enable_Tor_String()]; torRow.value = @(value); return torRow; } + (XLFormRowDescriptor *)resourceRowDescriptorWithValue:(NSString *)value { - XLFormRowDescriptor *resourceRowDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormResourceTextFieldTag rowType:XLFormRowDescriptorTypeText title:RESOURCE_STRING]; + XLFormRowDescriptor *resourceRowDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kOTRXLFormResourceTextFieldTag rowType:XLFormRowDescriptorTypeText title:RESOURCE_STRING()]; resourceRowDescriptor.value = value; return resourceRowDescriptor; diff --git a/ChatSecure/Classes/View Controllers/Login View Controllers/OTRXMPPServerListViewController.m b/ChatSecure/Classes/View Controllers/Login View Controllers/OTRXMPPServerListViewController.m index f86752f79..5e5a39c35 100644 --- a/ChatSecure/Classes/View Controllers/Login View Controllers/OTRXMPPServerListViewController.m +++ b/ChatSecure/Classes/View Controllers/Login View Controllers/OTRXMPPServerListViewController.m @@ -12,7 +12,7 @@ @import OTRAssets; @import XLForm; #import "OTRXMPPServerInfo.h" -#import "OTRLanguageManager.h" + NSString *const kOTROTRXMPPServerListViewControllerCustomTag = @"kOTROTRXMPPServerListViewControllerCustomTag"; @@ -101,7 +101,7 @@ + (XLFormDescriptor *)defaultServerForm { NSArray *serverList = [OTRXMPPServerInfo defaultServerList]; - XLFormDescriptor *formDescriptor = [XLFormDescriptor formDescriptorWithTitle:[OTRLanguageManager translatedString:@"Choose Server"]]; + XLFormDescriptor *formDescriptor = [XLFormDescriptor formDescriptorWithTitle:Choose_Server_String()]; XLFormSectionDescriptor *sectionDescriptor = [[XLFormSectionDescriptor alloc] init]; [formDescriptor addFormSection:sectionDescriptor]; @@ -111,7 +111,7 @@ + (XLFormDescriptor *)defaultServerForm [sectionDescriptor addFormRow:rowDescriptor]; } - XLFormRowDescriptor *customRowDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kOTROTRXMPPServerListViewControllerCustomTag rowType:XLFormRowDescriptorTypeURL title:CUSTOM_STRING]; + XLFormRowDescriptor *customRowDescriptor = [XLFormRowDescriptor formRowDescriptorWithTag:kOTROTRXMPPServerListViewControllerCustomTag rowType:XLFormRowDescriptorTypeURL title:CUSTOM_STRING()]; [customRowDescriptor.cellConfigAtConfigure setObject:@"example.com" forKey:@"textField.placeholder"]; [sectionDescriptor addFormRow:customRowDescriptor]; diff --git a/ChatSecure/Classes/View Controllers/OTRAboutViewController.m b/ChatSecure/Classes/View Controllers/OTRAboutViewController.m index 1db2fc35c..02048d5d6 100644 --- a/ChatSecure/Classes/View Controllers/OTRAboutViewController.m +++ b/ChatSecure/Classes/View Controllers/OTRAboutViewController.m @@ -33,7 +33,7 @@ #import "UIActivityViewController+ChatSecure.h" @import OTRAssets; @import XLForm; -#import "OTRLanguageManager.h" + static NSString *const kDefaultCellReuseIdentifier = @"kDefaultCellReuseIdentifier"; @@ -64,7 +64,7 @@ @implementation OTRAboutViewController - (id)init { if (self = [super init]) { - self.title = ABOUT_STRING; + self.title = ABOUT_STRING(); self.hasAddedConstraints = NO; } return self; @@ -75,7 +75,7 @@ - (id)init { - (void) setupVersionLabel { self.versionLabel = [[UILabel alloc] init]; NSString *version = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleShortVersionString"]; - self.versionLabel.text = [NSString stringWithFormat:@"%@ %@", VERSION_STRING, version]; + self.versionLabel.text = [NSString stringWithFormat:@"%@ %@", VERSION_STRING(), version]; self.versionLabel.textAlignment = NSTextAlignmentCenter; self.versionLabel.frame = CGRectMake(0, 0, self.view.frame.size.width, 30); } @@ -100,7 +100,7 @@ - (void) setupSocialView { NSURL *chrisballingerURL = [NSURL URLWithString:@"https://github.com/chrisballinger"]; NSString *davidchilesString = @"@davidchiles"; NSURL *davidChilesURL = [NSURL URLWithString:@"https://github.com/davidchiles"]; - NSString *headerText = [NSString stringWithFormat:@"%@ %@ & %@.", CREATED_BY_STRING, chrisballingerString, davidchilesString]; + NSString *headerText = [NSString stringWithFormat:@"%@ %@ & %@.", CREATED_BY_STRING(), chrisballingerString, davidchilesString]; NSRange chrisRange = [headerText rangeOfString:chrisballingerString]; NSRange davidRange = [headerText rangeOfString:davidchilesString]; @@ -161,8 +161,8 @@ - (void)viewDidLoad self.edgesForExtendedLayout = UIRectEdgeNone; [self.navigationController.view setBackgroundColor:[UIColor whiteColor]]; } - OTRAboutTableCellData *translateData = [OTRAboutTableCellData cellDataWithTitle:HELP_TRANSLATE_STRING url:[NSURL otr_transifexURL]]; - OTRAboutTableCellData *aboutThisVersion = [OTRAboutTableCellData cellDataWithTitle:ABOUT_VERSION_STRING url:nil]; + OTRAboutTableCellData *translateData = [OTRAboutTableCellData cellDataWithTitle:HELP_TRANSLATE_STRING() url:[NSURL otr_transifexURL]]; + OTRAboutTableCellData *aboutThisVersion = [OTRAboutTableCellData cellDataWithTitle:ABOUT_VERSION_STRING() url:nil]; self.cellData = @[aboutThisVersion,translateData]; self.view.backgroundColor = [UIColor whiteColor]; diff --git a/ChatSecure/Classes/View Controllers/OTRBuddyViewController.m b/ChatSecure/Classes/View Controllers/OTRBuddyViewController.m index 7bafae123..ce2dea672 100644 --- a/ChatSecure/Classes/View Controllers/OTRBuddyViewController.m +++ b/ChatSecure/Classes/View Controllers/OTRBuddyViewController.m @@ -18,7 +18,7 @@ #import "OTRBuddy.h" #import "OTRDatabaseManager.h" #import "OTRUtilities.h" -#import "OTRLanguageManager.h" + @import OTRAssets; @import XLForm; @@ -43,7 +43,7 @@ -(id)initWithBuddyID:(NSString *)buddyID isXMPPAccount = [[self.account protocolClass] isSubclassOfClass:[OTRXMPPManager class]]; }]; - self.title = BUDDY_INFO_STRING; + self.title = BUDDY_INFO_STRING(); } return self; @@ -63,7 +63,7 @@ - (void)viewDidLoad [self.view addSubview:tableView]; displayNameTextField = [[UITextField alloc]init]; - displayNameTextField.placeholder = OPTIONAL_STRING; + displayNameTextField.placeholder = OPTIONAL_STRING(); displayNameTextField.font = [UIFont systemFontOfSize:15]; displayNameTextField.delegate = self; @@ -73,15 +73,15 @@ - (void)viewDidLoad } removeBuddyButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; - [removeBuddyButton setTitle:REMOVE_STRING forState:UIControlStateNormal]; + [removeBuddyButton setTitle:REMOVE_STRING() forState:UIControlStateNormal]; [removeBuddyButton addTarget:self action:@selector(removeBuddyButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; blockBuddyButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; - [blockBuddyButton setTitle:BLOCK_STRING forState:UIControlStateNormal]; + [blockBuddyButton setTitle:BLOCK_STRING() forState:UIControlStateNormal]; if (!isXMPPAccount) { - [blockBuddyButton setTitle:BLOCK_AND_REMOVE_STRING forState:UIControlStateNormal]; + [blockBuddyButton setTitle:BLOCK_AND_REMOVE_STRING() forState:UIControlStateNormal]; } /*FIXMEif (!self.account.isConnected) { @@ -145,7 +145,7 @@ -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NS if(!cell) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:cellIdentifierLabel]; - cell.textLabel.text = EMAIL_STRING; + cell.textLabel.text = EMAIL_STRING(); cell.detailTextLabel.text = self.buddy.username; } @@ -156,7 +156,7 @@ -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NS if (!cell) { cell =[[OTRInLineTextEditTableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:cellIdentifierText]; } - cell.textLabel.text = NAME_STRING; + cell.textLabel.text = NAME_STRING(); [cell layoutIfNeeded]; ((OTRInLineTextEditTableViewCell *)cell).textField = displayNameTextField; } @@ -170,7 +170,7 @@ -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NS } if (indexPath.row == 0) { - cell.textLabel.text = ACCOUNT_STRING; + cell.textLabel.text = ACCOUNT_STRING(); cell.detailTextLabel.text = self.account.username; } cell.selectionStyle = UITableViewCellSelectionStyleNone; diff --git a/ChatSecure/Classes/View Controllers/OTRCertificateDomainViewController.m b/ChatSecure/Classes/View Controllers/OTRCertificateDomainViewController.m index 6fc29a0fd..18f6803c1 100644 --- a/ChatSecure/Classes/View Controllers/OTRCertificateDomainViewController.m +++ b/ChatSecure/Classes/View Controllers/OTRCertificateDomainViewController.m @@ -10,7 +10,7 @@ #import "OTRCertificatePinning.h" #import "OTRCertificatesViewController.h" @import OTRAssets; -#import "OTRLanguageManager.h" + @interface OTRCertificateDomainViewController () @@ -90,7 +90,7 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - return SAVED_CERTIFICATES_STRING; + return SAVED_CERTIFICATES_STRING(); } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section diff --git a/ChatSecure/Classes/View Controllers/OTRChooseAccountViewController.m b/ChatSecure/Classes/View Controllers/OTRChooseAccountViewController.m index 01192131c..5ef18bb37 100644 --- a/ChatSecure/Classes/View Controllers/OTRChooseAccountViewController.m +++ b/ChatSecure/Classes/View Controllers/OTRChooseAccountViewController.m @@ -13,7 +13,7 @@ @import OTRAssets; #import "OTRAccountsManager.h" #import "OTRAccount.h" -#import "OTRLanguageManager.h" + @interface OTRChooseAccountViewController () @@ -27,7 +27,7 @@ - (void)viewDidLoad { [super viewDidLoad]; - self.title = ACCOUNT_STRING; + self.title = ACCOUNT_STRING(); self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped]; self.tableView.dataSource = self; diff --git a/ChatSecure/Classes/View Controllers/OTRComposeViewController.m b/ChatSecure/Classes/View Controllers/OTRComposeViewController.m index dba6e9235..dba0ad097 100644 --- a/ChatSecure/Classes/View Controllers/OTRComposeViewController.m +++ b/ChatSecure/Classes/View Controllers/OTRComposeViewController.m @@ -21,7 +21,7 @@ #import "OTRBuddyInfoCell.h" #import "OTRNewBuddyViewController.h" #import "OTRChooseAccountViewController.h" -#import "OTRLanguageManager.h" + #import @import OTRAssets; @@ -68,7 +68,7 @@ - (void)viewDidLoad self.view.backgroundColor = [UIColor whiteColor]; /////////// Navigation Bar /////////// - self.title = COMPOSE_STRING; + self.title = COMPOSE_STRING(); UIBarButtonItem * cancelBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelButtonPressed:)]; @@ -193,13 +193,13 @@ - (void)doneButtonPressed:(id)sender if (self.selectedBuddiesIdSet.count > 1) { //Group so need user to select name - UIAlertController *alertController = [UIAlertController alertControllerWithTitle:GROUP_NAME_STRING message:ENTER_GROUP_NAME_STRING preferredStyle:UIAlertControllerStyleAlert]; - UIAlertAction *okAction = [UIAlertAction actionWithTitle:OK_STRING style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + UIAlertController *alertController = [UIAlertController alertControllerWithTitle:GROUP_NAME_STRING() message:ENTER_GROUP_NAME_STRING() preferredStyle:UIAlertControllerStyleAlert]; + UIAlertAction *okAction = [UIAlertAction actionWithTitle:OK_STRING() style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { NSString *name = alertController.textFields.firstObject.text; completion(name); }]; - UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:CANCEL_STRING style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { + UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:CANCEL_STRING() style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { }]; @@ -207,7 +207,7 @@ - (void)doneButtonPressed:(id)sender [alertController addAction:cancelAction]; [alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) { - textField.placeholder = GROUP_NAME_STRING; + textField.placeholder = GROUP_NAME_STRING(); [[NSNotificationCenter defaultCenter] addObserverForName:UITextFieldTextDidChangeNotification object:textField queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull note) { okAction.enabled = textField.text.length > 0; @@ -377,7 +377,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N if (!cell) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:addCellIdentifier]; } - cell.textLabel.text = ADD_BUDDY_STRING; + cell.textLabel.text = ADD_BUDDY_STRING(); cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; return cell; diff --git a/ChatSecure/Classes/View Controllers/OTRConversationViewController.m b/ChatSecure/Classes/View Controllers/OTRConversationViewController.m index 6cff77074..c6f885e40 100644 --- a/ChatSecure/Classes/View Controllers/OTRConversationViewController.m +++ b/ChatSecure/Classes/View Controllers/OTRConversationViewController.m @@ -31,7 +31,7 @@ #import "OTRInviteViewController.h" #import @import OTRAssets; -#import "OTRLanguageManager.h" + #import "OTRMessagesGroupViewController.h" #import "OTRXMPPManager.h" #import "OTRXMPPRoomManager.h" @@ -58,7 +58,7 @@ - (void)viewDidLoad ///////////// Setup Navigation Bar ////////////// - self.title = CHATS_STRING; + self.title = CHATS_STRING(); UIBarButtonItem *settingsBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"OTRSettingsIcon" inBundle:[OTRAssets resourcesBundle] compatibleWithTraitCollection:nil] style:UIBarButtonItemStylePlain target:self action:@selector(settingsButtonPressed:)]; self.navigationItem.rightBarButtonItem = settingsBarButtonItem; @@ -240,14 +240,14 @@ - (void)updateTitle numberUnreadMessages = [transaction numberOfUnreadMessages]; }]; if (numberUnreadMessages > 99) { - self.title = [NSString stringWithFormat:@"%@ (99+)",CHATS_STRING]; + self.title = [NSString stringWithFormat:@"%@ (99+)",CHATS_STRING()]; } else if (numberUnreadMessages > 0) { - self.title = [NSString stringWithFormat:@"%@ (%d)",CHATS_STRING,(int)numberUnreadMessages]; + self.title = [NSString stringWithFormat:@"%@ (%d)",CHATS_STRING(),(int)numberUnreadMessages]; } else { - self.title = CHATS_STRING; + self.title = CHATS_STRING(); } } diff --git a/ChatSecure/Classes/View Controllers/OTRDatabaseUnlockViewController.m b/ChatSecure/Classes/View Controllers/OTRDatabaseUnlockViewController.m index e89e7cf3b..f4e99fb24 100644 --- a/ChatSecure/Classes/View Controllers/OTRDatabaseUnlockViewController.m +++ b/ChatSecure/Classes/View Controllers/OTRDatabaseUnlockViewController.m @@ -11,7 +11,7 @@ #import "OTRConstants.h" #import "OTRAppDelegate.h" @import OTRAssets; -#import "OTRLanguageManager.h" + @interface OTRDatabaseUnlockViewController () @@ -44,7 +44,7 @@ - (void)viewDidLoad [self.view addSubview:self.passphraseTextField]; self.unlockButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; - [self.unlockButton setTitle:UNLOCK_STRING forState:UIControlStateNormal]; + [self.unlockButton setTitle:UNLOCK_STRING() forState:UIControlStateNormal]; self.unlockButton.enabled = NO; [self.unlockButton addTarget:self action:@selector(unlockTapped:) forControlEvents:UIControlEventTouchUpInside]; self.unlockButton.translatesAutoresizingMaskIntoConstraints = NO; @@ -53,7 +53,7 @@ - (void)viewDidLoad self.forgotPassphraseButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; self.forgotPassphraseButton.translatesAutoresizingMaskIntoConstraints = NO; - [self.forgotPassphraseButton setTitle:FORGOT_PASSPHRASE_STRING forState:UIControlStateNormal]; + [self.forgotPassphraseButton setTitle:FORGOT_PASSPHRASE_STRING() forState:UIControlStateNormal]; [self.forgotPassphraseButton addTarget:self action:@selector(forgotTapped:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:self.forgotPassphraseButton]; @@ -130,7 +130,7 @@ - (void)showPasswordError - (void)forgotTapped:(id)sender { - UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:FORGOT_PASSPHRASE_STRING message:FORGOT_PASSPHRASE_INFO_STRING delegate:nil cancelButtonTitle:nil otherButtonTitles:OK_STRING, nil]; + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:FORGOT_PASSPHRASE_STRING() message:FORGOT_PASSPHRASE_INFO_STRING() delegate:nil cancelButtonTitle:nil otherButtonTitles:OK_STRING(), nil]; [alertView show]; } diff --git a/ChatSecure/Classes/View Controllers/OTRDoubleSettingViewController.m b/ChatSecure/Classes/View Controllers/OTRDoubleSettingViewController.m index 60c41eee7..37a0e374d 100644 --- a/ChatSecure/Classes/View Controllers/OTRDoubleSettingViewController.m +++ b/ChatSecure/Classes/View Controllers/OTRDoubleSettingViewController.m @@ -22,7 +22,7 @@ #import "OTRDoubleSettingViewController.h" @import OTRAssets; -#import "OTRLanguageManager.h" + @interface OTRDoubleSettingViewController (Private) - (void) setTextForValueLabel; @@ -115,7 +115,7 @@ - (void) save:(id)sender { } - (void) setTextForValueLabel { - self.valueLabel.text = [NSString stringWithFormat:@"%@: %@\t%@: %@", OLD_STRING, [self stringForValue:otrSetting.doubleValue], NEW_STRING, [self stringForValue:newValue]]; + self.valueLabel.text = [NSString stringWithFormat:@"%@: %@\t%@: %@", OLD_STRING(), [self stringForValue:otrSetting.doubleValue], NEW_STRING(), [self stringForValue:newValue]]; } - (NSString*) stringForValue:(double)value { diff --git a/ChatSecure/Classes/View Controllers/OTRIntSettingViewController.m b/ChatSecure/Classes/View Controllers/OTRIntSettingViewController.m index 21910e739..3140fea8c 100644 --- a/ChatSecure/Classes/View Controllers/OTRIntSettingViewController.m +++ b/ChatSecure/Classes/View Controllers/OTRIntSettingViewController.m @@ -8,7 +8,7 @@ #import "OTRIntSettingViewController.h" @import OTRAssets; -#import "OTRLanguageManager.h" + @interface OTRIntSettingViewController (Private) - (void) setTextForValueLabel; @@ -106,7 +106,7 @@ - (void) save:(id)sender { } - (void) setTextForValueLabel { - self.valueLabel.text = [NSString stringWithFormat:@"%@: %@\t%@: %@", OLD_STRING, [self stringForValue:otrSetting.intValue], NEW_STRING, [self stringForValue:newValue]]; + self.valueLabel.text = [NSString stringWithFormat:@"%@: %@\t%@: %@", OLD_STRING(), [self stringForValue:otrSetting.intValue], NEW_STRING(), [self stringForValue:newValue]]; self.descriptionLabel.font = [UIFont systemFontOfSize:newValue]; [self resizeDescriptionLabel]; } diff --git a/ChatSecure/Classes/View Controllers/OTRInviteViewController.m b/ChatSecure/Classes/View Controllers/OTRInviteViewController.m index 6b8e91748..e23acf730 100644 --- a/ChatSecure/Classes/View Controllers/OTRInviteViewController.m +++ b/ChatSecure/Classes/View Controllers/OTRInviteViewController.m @@ -16,7 +16,7 @@ #import "OTRTheme.h" #import "OTRColors.h" @import OTRAssets; -#import "OTRLanguageManager.h" + #import static CGFloat const kOTRInvitePadding = 10; @@ -55,7 +55,7 @@ - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [OTRAppDelegate appDelegate].theme.mainThemeColor; - self.title = INVITE_LINK_STRING; + self.title = INVITE_LINK_STRING(); self.titleImageView.image = [UIImage imageNamed:@"invite_success" inBundle:[OTRAssets resourcesBundle] compatibleWithTraitCollection:nil]; self.titleImageView.contentMode = UIViewContentModeScaleAspectFit; @@ -69,8 +69,8 @@ - (void)viewDidLoad NSMutableArray *shareButtons = [[NSMutableArray alloc] initWithCapacity:2]; - [shareButtons addObject:[self shareButtonWithIcon:FAEnvelope title:INVITE_LINK_STRING action:@selector(linkShareButtonPressed:)]]; - [shareButtons addObject:[self shareButtonWithIcon:FACamera title:SCAN_QR_STRING action:@selector(qrButtonPressed:)]]; + [shareButtons addObject:[self shareButtonWithIcon:FAEnvelope title:INVITE_LINK_STRING() action:@selector(linkShareButtonPressed:)]]; + [shareButtons addObject:[self shareButtonWithIcon:FACamera title:SCAN_QR_STRING() action:@selector(qrButtonPressed:)]]; self.shareButtons = shareButtons; @@ -121,7 +121,7 @@ - (void)setAccount:(OTRAccount *)account if(![account isEqual:_account]) { _account = account; - self.subtitleLabel.text = [NSString stringWithFormat:@"%@ %@!\n\n%@",ONBOARDING_SUCCESS_STRING,[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"] ,self.account.username]; + self.subtitleLabel.text = [NSString stringWithFormat:@"%@ %@!\n\n%@",ONBOARDING_SUCCESS_STRING(),[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"] ,self.account.username]; } } diff --git a/ChatSecure/Classes/View Controllers/OTRMessagesHoldTalkViewController.m b/ChatSecure/Classes/View Controllers/OTRMessagesHoldTalkViewController.m index a78256682..71d475cec 100644 --- a/ChatSecure/Classes/View Controllers/OTRMessagesHoldTalkViewController.m +++ b/ChatSecure/Classes/View Controllers/OTRMessagesHoldTalkViewController.m @@ -16,7 +16,7 @@ #import "OTRBuddy.h" #import "OTRXMPPManager.h" #import "OTRXMPPAccount.h" -#import "OTRLanguageManager.h" + #import static Float64 kOTRMessagesMinimumAudioTime = .5; @@ -60,7 +60,7 @@ - (void)viewDidLoad forState:UIControlStateNormal]; self.knockButton = [JSQMessagesToolbarButtonFactory defaultSendButtonItem]; - NSString *title = KNOCK_STRING; + NSString *title = KNOCK_STRING(); CGFloat maxHeight = 32.0f; [self.knockButton setTitle:title forState:UIControlStateNormal]; @@ -132,14 +132,14 @@ - (void)addPush2TalkButton - (void)setHold2TalkStatusWaiting { - self.hold2TalkButton.textLabel.text = HOLD_TO_TALK_STRING; + self.hold2TalkButton.textLabel.text = HOLD_TO_TALK_STRING(); self.hold2TalkButton.textLabel.textColor = [UIColor whiteColor]; self.hold2TalkButton.backgroundColor = [UIColor darkGrayColor]; } - (void)setHold2TalkButtonRecording { - self.hold2TalkButton.textLabel.text = RELEASE_TO_SEND_STRING; + self.hold2TalkButton.textLabel.text = RELEASE_TO_SEND_STRING(); self.hold2TalkButton.textLabel.textColor = [UIColor darkGrayColor]; self.hold2TalkButton.backgroundColor = [UIColor whiteColor]; } @@ -289,12 +289,12 @@ - (void)didBeginTouch:(OTRHoldToTalkView *)view [self.audioSessionManager recordAudioToURL:url error:nil]; [self setHold2TalkButtonRecording]; } else { - UIAlertController *alert = [UIAlertController alertControllerWithTitle:[OTRLanguageManager translatedString:@"Microphone Disabled"] message:[OTRLanguageManager translatedString:@"To use this feature you must re-enable microphone permissions."] preferredStyle:UIAlertControllerStyleAlert]; - UIAlertAction *fix = [UIAlertAction actionWithTitle:[OTRLanguageManager translatedString:@"Enable"] style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + UIAlertController *alert = [UIAlertController alertControllerWithTitle:Microphone_Disabled() message:Microphone_Reenable_Please() preferredStyle:UIAlertControllerStyleAlert]; + UIAlertAction *fix = [UIAlertAction actionWithTitle:Enable_String() style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { NSURL *settings = [NSURL URLWithString:UIApplicationOpenSettingsURLString]; [[UIApplication sharedApplication] openURL:settings]; }]; - UIAlertAction *cancel = [UIAlertAction actionWithTitle:CANCEL_STRING style:UIAlertActionStyleCancel handler:nil]; + UIAlertAction *cancel = [UIAlertAction actionWithTitle:CANCEL_STRING() style:UIAlertActionStyleCancel handler:nil]; [alert addAction:fix]; [alert addAction:cancel]; [self presentViewController:alert animated:YES completion:nil]; @@ -328,11 +328,11 @@ - (void)view:(OTRHoldToTalkView *)view touchDidMoveToPointInWindow:(CGPoint)poin if (insideButton) { self.trashView.trashIconLabel.alpha = 1; self.trashView.microphoneIconLabel.alpha = 0; - self.hold2TalkButton.textLabel.text = RELEASE_TO_DELETE_STRING; + self.hold2TalkButton.textLabel.text = RELEASE_TO_DELETE_STRING(); } else { self.trashView.trashIconLabel.alpha = percentDistance; self.trashView.microphoneIconLabel.alpha = 1-percentDistance; - self.hold2TalkButton.textLabel.text = RELEASE_TO_SEND_STRING; + self.hold2TalkButton.textLabel.text = RELEASE_TO_SEND_STRING(); } [self.view setNeedsUpdateConstraints]; diff --git a/ChatSecure/Classes/View Controllers/OTRMessagesViewController.m b/ChatSecure/Classes/View Controllers/OTRMessagesViewController.m index 5a815adc9..e2a78dcd1 100644 --- a/ChatSecure/Classes/View Controllers/OTRMessagesViewController.m +++ b/ChatSecure/Classes/View Controllers/OTRMessagesViewController.m @@ -43,7 +43,7 @@ #import "OTRMediaServer.h" #import "UIImage+ChatSecure.h" #import "OTRBaseLoginViewController.h" -#import "OTRLanguageManager.h" + #import "OTRDataHandler.h" #import #import "OTRYapMessageSendAction.h" @@ -166,13 +166,13 @@ - (void)viewDidLoad NSString * placeHolderString = nil; switch (state.messageSecurity) { case OTRMessageTransportSecurityPlaintext: - placeHolderString = SEND_PLAINTEXT_STRING; + placeHolderString = SEND_PLAINTEXT_STRING(); break; case OTRMessageTransportSecurityOTR: - placeHolderString = [NSString stringWithFormat:SEND_ENCRYPTED_STRING,@"OTR"]; + placeHolderString = [NSString stringWithFormat:SEND_ENCRYPTED_STRING(),@"OTR"]; break; case OTRMessageTransportSecurityOMEMO: - placeHolderString = [NSString stringWithFormat:SEND_ENCRYPTED_STRING,@"OMEMO"];; + placeHolderString = [NSString stringWithFormat:SEND_ENCRYPTED_STRING(),@"OMEMO"];; break; default: @@ -513,13 +513,13 @@ - (UIAlertAction *)resendOutgoingMessageActionForMessageKey:(NSString *)messageK } - (nonnull UIAlertAction *)viewProfileAction { - return [UIAlertAction actionWithTitle:VIEW_PROFILE_STRING style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { + return [UIAlertAction actionWithTitle:VIEW_PROFILE_STRING() style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { [self infoButtonPressed:action]; }]; } - (nonnull UIAlertAction *)cancleAction { - return [UIAlertAction actionWithTitle:CANCEL_STRING + return [UIAlertAction actionWithTitle:CANCEL_STRING() style:UIAlertActionStyleCancel handler:nil]; } @@ -537,7 +537,7 @@ - (nonnull UIAlertAction *)cancleAction { duplicate = NO; } // This is an outgoing message so we can offer to resend - UIAlertAction *resendAction = [self resendOutgoingMessageActionForMessageKey:msg.uniqueId messageCollection:[OTROutgoingMessage collection] readWriteDatabaseConnection:self.readWriteDatabaseConnection duplicateMessage:duplicate title:RESEND_STRING]; + UIAlertAction *resendAction = [self resendOutgoingMessageActionForMessageKey:msg.uniqueId messageCollection:[OTROutgoingMessage collection] readWriteDatabaseConnection:self.readWriteDatabaseConnection duplicateMessage:duplicate title:RESEND_STRING()]; [actions addObject:resendAction]; } @@ -554,7 +554,7 @@ - (void)didTapAvatar:(id)message sender:(id)sender { NSString *title = nil; NSString *alertMessage = nil; - NSString * sendingType = UNENCRYPTED_STRING; + NSString * sendingType = UNENCRYPTED_STRING(); switch (self.state.messageSecurity) { case OTRMessageTransportSecurityOTR: sendingType = @"OTR"; @@ -568,26 +568,26 @@ - (void)didTapAvatar:(id)message sender:(id)sender { } if ([message isKindOfClass:[OTROutgoingMessage class]]) { - title = RESEND_MESSAGE_TITLE; - alertMessage = [NSString stringWithFormat:RESEND_DESCRIPTION_STRING,sendingType]; + title = RESEND_MESSAGE_TITLE(); + alertMessage = [NSString stringWithFormat:RESEND_DESCRIPTION_STRING(),sendingType]; } if (error) { NSUInteger otrFingerprintError = 32872; - title = ERROR_STRING; + title = ERROR_STRING(); alertMessage = error.localizedDescription; if (error.code == otrFingerprintError) { - alertMessage = NO_DEVICES_BUDDY_ERROR_STRING; + alertMessage = NO_DEVICES_BUDDY_ERROR_STRING(); } if([message isKindOfClass:[OTROutgoingMessage class]]) { //If it's an outgoing message the error title should be that we were unable to send the message. - title = UNABLE_TO_SEND_STRING; + title = UNABLE_TO_SEND_STRING(); - NSString *resendDescription = [NSString stringWithFormat:RESEND_DESCRIPTION_STRING,sendingType]; + NSString *resendDescription = [NSString stringWithFormat:RESEND_DESCRIPTION_STRING(),sendingType]; alertMessage = [alertMessage stringByAppendingString:[NSString stringWithFormat:@"\n%@",resendDescription]]; //If this is an error about not having a trusted identity then we should offer to connect to the @@ -595,20 +595,20 @@ - (void)didTapAvatar:(id)message sender:(id)sender { error.code == OTROMEMOErrorNoDevices || error.code == otrFingerprintError) { - alertMessage = [alertMessage stringByAppendingString:[NSString stringWithFormat:@"\n%@",VIEW_PROFILE_DESCRIPTION_STRING]]; + alertMessage = [alertMessage stringByAppendingString:[NSString stringWithFormat:@"\n%@",VIEW_PROFILE_DESCRIPTION_STRING()]]; } } } if (![self isMessageTrusted:message]) { - title = UNTRUSTED_DEVICE_STRING; + title = UNTRUSTED_DEVICE_STRING(); if ([message messageIncoming]) { - alertMessage = UNTRUSTED_DEVICE_REVEIVED_STRING; + alertMessage = UNTRUSTED_DEVICE_REVEIVED_STRING(); } else { - alertMessage = UNTRUSTED_DEVICE_SENT_STRING; + alertMessage = UNTRUSTED_DEVICE_SENT_STRING(); } - alertMessage = [alertMessage stringByAppendingString:[NSString stringWithFormat:@"\n%@",VIEW_PROFILE_DESCRIPTION_STRING]]; + alertMessage = [alertMessage stringByAppendingString:[NSString stringWithFormat:@"\n%@",VIEW_PROFILE_DESCRIPTION_STRING()]]; } NSArray *actions = [self actionForMessage:message]; @@ -1443,7 +1443,7 @@ - (NSAttributedString *)collectionView:(JSQMessagesCollectionView *)collectionVi if ([self isPushMessageAtIndexPath:indexPath]) { JSQMessagesTimestampFormatter *formatter = [JSQMessagesTimestampFormatter sharedFormatter]; - NSString *knockString = KNOCK_SENT_STRING; + NSString *knockString = KNOCK_SENT_STRING(); //Add new line if there is already a date string if ([text length] > 0) { knockString = [@"\n" stringByAppendingString:knockString]; @@ -1532,13 +1532,13 @@ - (NSAttributedString *)collectionView:(JSQMessagesCollectionView *)collectionVi NSUInteger insertIndex = 0; if (mediaItem.isIncoming && mediaItem.transferProgress < 1) { - progressString = [NSString stringWithFormat:@" %@ %.0f%%",INCOMING_STRING,percentProgress]; + progressString = [NSString stringWithFormat:@" %@ %.0f%%",INCOMING_STRING(),percentProgress]; insertIndex = [attributedString length]; } else if (!mediaItem.isIncoming && mediaItem.transferProgress < 1) { if(percentProgress > 0) { - progressString = [NSString stringWithFormat:@"%@ %.0f%% ",SENDING_STRING,percentProgress]; + progressString = [NSString stringWithFormat:@"%@ %.0f%% ",SENDING_STRING(),percentProgress]; } else { - progressString = [NSString stringWithFormat:@"%@ ",WAITING_STRING]; + progressString = [NSString stringWithFormat:@"%@ ",WAITING_STRING()]; } } diff --git a/ChatSecure/Classes/View Controllers/OTRNewBuddyViewController.m b/ChatSecure/Classes/View Controllers/OTRNewBuddyViewController.m index b65f08deb..acc0e8584 100644 --- a/ChatSecure/Classes/View Controllers/OTRNewBuddyViewController.m +++ b/ChatSecure/Classes/View Controllers/OTRNewBuddyViewController.m @@ -21,7 +21,7 @@ @import QRCodeReaderViewController; @import XMPPFramework; -#import "OTRLanguageManager.h" + #import "NSURL+ChatSecure.h" @interface OTRNewBuddyViewController () @@ -63,21 +63,21 @@ - (void)viewDidLoad { [super viewDidLoad]; - self.title = ADD_BUDDY_STRING; + self.title = ADD_BUDDY_STRING(); //self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelButtonPressed:)]; - UIBarButtonItem *qrButton = [[UIBarButtonItem alloc] initWithTitle:QR_CODE_STRING style:UIBarButtonItemStylePlain target:self action:@selector(qrButtonPressed:)]; + UIBarButtonItem *qrButton = [[UIBarButtonItem alloc] initWithTitle:QR_CODE_STRING() style:UIBarButtonItemStylePlain target:self action:@selector(qrButtonPressed:)]; UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(doneButtonPressed:)]; self.navigationItem.rightBarButtonItems = @[doneButton, qrButton]; self.accountNameTextField = [[UITextField alloc] initWithFrame:CGRectZero]; - self.accountNameTextField.placeholder = XMPP_USERNAME_EXAMPLE_STRING; + self.accountNameTextField.placeholder = XMPP_USERNAME_EXAMPLE_STRING(); if (self.isXMPPaccount) { self.displayNameTextField = [[UITextField alloc] initWithFrame:CGRectZero]; - self.displayNameTextField.placeholder = OPTIONAL_STRING; + self.displayNameTextField.placeholder = OPTIONAL_STRING(); self.accountNameTextField.delegate= self.displayNameTextField.delegate = self; self.displayNameTextField.autocapitalizationType = self.accountNameTextField.autocapitalizationType = UITextAutocapitalizationTypeNone; @@ -116,11 +116,11 @@ -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NS if (indexPath.row == 0) { textField = self.accountNameTextField; - cellText = USERNAME_STRING; + cellText = USERNAME_STRING(); } else if(indexPath.row == 1) { textField = self.displayNameTextField; - cellText = NAME_STRING; + cellText = NAME_STRING(); } OTRInLineTextEditTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellType]; @@ -275,7 +275,7 @@ - (void)populateFromQRResult:(NSString *)result #warning TODO: Process OTR fingerprint // this is where you'd add the OTR (or Axolotl) fingerprint to the trusted store } else { - UIAlertController *alert = [UIAlertController alertControllerWithTitle:[OTRLanguageManager translatedString:@"Unrecognized Invite Format"] message:nil preferredStyle:UIAlertControllerStyleAlert]; + UIAlertController *alert = [UIAlertController alertControllerWithTitle:Unrecognized_Invite_Format() message:nil preferredStyle:UIAlertControllerStyleAlert]; [self presentViewController:alert animated:YES completion:nil]; } } diff --git a/ChatSecure/Classes/View Controllers/OTRQRCodeViewController.m b/ChatSecure/Classes/View Controllers/OTRQRCodeViewController.m index 89d6203d7..cdffb0047 100644 --- a/ChatSecure/Classes/View Controllers/OTRQRCodeViewController.m +++ b/ChatSecure/Classes/View Controllers/OTRQRCodeViewController.m @@ -24,7 +24,7 @@ @import ZXingObjC; @import PureLayout; #import -#import "OTRLanguageManager.h" + @import OTRAssets; @interface OTRQRCodeViewController() @@ -36,7 +36,7 @@ @implementation OTRQRCodeViewController - (instancetype) initWithQRString:(NSString*)qrString { if (self = [super init]) { _qrString = qrString; - self.title = QR_CODE_STRING; + self.title = QR_CODE_STRING(); } return self; } @@ -74,7 +74,7 @@ - (void) viewDidLoad { self.instructionsLabel.textAlignment = NSTextAlignmentCenter; [self.view addSubview:self.instructionsLabel]; - self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:DONE_STRING style:UIBarButtonItemStyleDone target:self action:@selector(doneButtonPressed:)]; + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:DONE_STRING() style:UIBarButtonItemStyleDone target:self action:@selector(doneButtonPressed:)]; [self.view setNeedsUpdateConstraints]; } diff --git a/ChatSecure/Classes/View Controllers/OTRSettingDetailViewController.m b/ChatSecure/Classes/View Controllers/OTRSettingDetailViewController.m index 08aa2a8b3..fae3d6e21 100644 --- a/ChatSecure/Classes/View Controllers/OTRSettingDetailViewController.m +++ b/ChatSecure/Classes/View Controllers/OTRSettingDetailViewController.m @@ -22,7 +22,7 @@ #import "OTRSettingDetailViewController.h" @import OTRAssets; -#import "OTRLanguageManager.h" + @implementation OTRSettingDetailViewController @synthesize otrSetting, saveButton, cancelButton; @@ -35,8 +35,8 @@ - (void) dealloc { - (id) init { if (self = [super init]) { - self.saveButton = [[UIBarButtonItem alloc] initWithTitle:SAVE_STRING style:UIBarButtonItemStyleDone target:self action:@selector(save:)]; - self.cancelButton = [[UIBarButtonItem alloc] initWithTitle:CANCEL_STRING style:UIBarButtonItemStylePlain target:self action:@selector(cancel:)]; + self.saveButton = [[UIBarButtonItem alloc] initWithTitle:SAVE_STRING() style:UIBarButtonItemStyleDone target:self action:@selector(save:)]; + self.cancelButton = [[UIBarButtonItem alloc] initWithTitle:CANCEL_STRING() style:UIBarButtonItemStylePlain target:self action:@selector(cancel:)]; } return self; } diff --git a/ChatSecure/Classes/View Controllers/OTRSettingsViewController.m b/ChatSecure/Classes/View Controllers/OTRSettingsViewController.m index 7a380accf..2c1a85902 100644 --- a/ChatSecure/Classes/View Controllers/OTRSettingsViewController.m +++ b/ChatSecure/Classes/View Controllers/OTRSettingsViewController.m @@ -48,7 +48,7 @@ #import "OTRInviteViewController.h" #import @import OTRAssets; -#import "OTRLanguageManager.h" + #import "NSURL+ChatSecure.h" static NSString *const circleImageName = @"31-circle-plus-large.png"; @@ -66,7 +66,7 @@ - (id) init { if (self = [super init]) { - self.title = SETTINGS_STRING; + self.title = SETTINGS_STRING(); self.settingsManager = [[OTRSettingsManager alloc] init]; } return self; @@ -153,7 +153,7 @@ -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSI cell = [tableView dequeueReusableCellWithIdentifier:addAccountCellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:addAccountCellIdentifier]; - cell.textLabel.text = NEW_ACCOUNT_STRING; + cell.textLabel.text = NEW_ACCOUNT_STRING(); cell.imageView.image = [UIImage imageNamed:circleImageName inBundle:[OTRAssets resourcesBundle] compatibleWithTraitCollection:nil]; cell.detailTextLabel.text = nil; } @@ -262,8 +262,8 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd { OTRAccount *account = [self accountAtIndexPath:indexPath]; - UIAlertAction * cancelButtonItem = [UIAlertAction actionWithTitle:CANCEL_STRING style:UIAlertActionStyleCancel handler:nil]; - UIAlertAction * okButtonItem = [UIAlertAction actionWithTitle:OK_STRING style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) { + UIAlertAction * cancelButtonItem = [UIAlertAction actionWithTitle:CANCEL_STRING() style:UIAlertActionStyleCancel handler:nil]; + UIAlertAction * okButtonItem = [UIAlertAction actionWithTitle:OK_STRING() style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) { if( [[OTRProtocolManager sharedInstance] isAccountConnected:account]) { @@ -274,8 +274,8 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd [OTRAccountsManager removeAccount:account]; }]; - NSString * message = [NSString stringWithFormat:@"%@ %@?", DELETE_ACCOUNT_MESSAGE_STRING, account.username]; - UIAlertController *alert = [UIAlertController alertControllerWithTitle:DELETE_ACCOUNT_TITLE_STRING message:message preferredStyle:UIAlertControllerStyleAlert]; + NSString * message = [NSString stringWithFormat:@"%@ %@?", DELETE_ACCOUNT_MESSAGE_STRING(), account.username]; + UIAlertController *alert = [UIAlertController alertControllerWithTitle:DELETE_ACCOUNT_TITLE_STRING() message:message preferredStyle:UIAlertControllerStyleAlert]; [alert addAction:cancelButtonItem]; [alert addAction:okButtonItem]; [self presentViewController:alert animated:YES completion:nil]; @@ -302,13 +302,13 @@ -(void)showAboutScreen - (void)logoutAccount:(OTRAccount *)account sender:(id)sender { UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet]; - UIAlertAction *cancelAlertAction = [UIAlertAction actionWithTitle:CANCEL_STRING style:UIAlertActionStyleCancel handler:nil]; - UIAlertAction *logoutAlertAction = [UIAlertAction actionWithTitle:LOGOUT_STRING style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) { + UIAlertAction *cancelAlertAction = [UIAlertAction actionWithTitle:CANCEL_STRING() style:UIAlertActionStyleCancel handler:nil]; + UIAlertAction *logoutAlertAction = [UIAlertAction actionWithTitle:LOGOUT_STRING() style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) { id protocol = [[OTRProtocolManager sharedInstance] protocolForAccount:account]; [protocol disconnect]; }]; - UIAlertAction *shareAction = [UIAlertAction actionWithTitle:SHARE_STRING style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { + UIAlertAction *shareAction = [UIAlertAction actionWithTitle:SHARE_STRING() style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { [ShareController shareAccount:account sender:sender viewController:self]; }]; @@ -378,7 +378,7 @@ - (void) donateSettingPressed:(OTRDonateSetting *)setting { #warning Hardcoded Whitelabel Value NSURL *bitcoinURL = [NSURL URLWithString:@"https://coinbase.com/checkouts/0a35048913df24e0ec3d586734d456d7"]; - UIAlertController *alertController = [UIAlertController alertControllerWithTitle:DONATE_MESSAGE_STRING message:nil preferredStyle:UIAlertControllerStyleActionSheet]; + UIAlertController *alertController = [UIAlertController alertControllerWithTitle:DONATE_MESSAGE_STRING() message:nil preferredStyle:UIAlertControllerStyleActionSheet]; UIAlertAction *paypalAlertAction = [UIAlertAction actionWithTitle:@"PayPal" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { [[UIApplication sharedApplication] openURL:paypalURL]; @@ -388,7 +388,7 @@ - (void) donateSettingPressed:(OTRDonateSetting *)setting { [[UIApplication sharedApplication] openURL:bitcoinURL]; }]; - UIAlertAction *cancelAlertAction = [UIAlertAction actionWithTitle:CANCEL_STRING style:UIAlertActionStyleCancel handler:nil]; + UIAlertAction *cancelAlertAction = [UIAlertAction actionWithTitle:CANCEL_STRING() style:UIAlertActionStyleCancel handler:nil]; [alertController addAction:paypalAlertAction]; [alertController addAction:bitcoinAlertAction]; @@ -423,9 +423,9 @@ - (void)didSelectShareSetting:(OTRShareSetting *)shareSetting #pragma mark OTRFeedbackSettingDelegate method - (void) presentUserVoiceViewForSetting:(OTRSetting *)setting { - UIAlertController *alertController = [UIAlertController alertControllerWithTitle:SHOW_USERVOICE_STRING message:nil preferredStyle:UIAlertControllerStyleActionSheet]; - UIAlertAction *cancelAlertAction = [UIAlertAction actionWithTitle:CANCEL_STRING style:UIAlertActionStyleCancel handler:nil]; - UIAlertAction *showUserVoiceAlertAction = [UIAlertAction actionWithTitle:OK_STRING style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { + UIAlertController *alertController = [UIAlertController alertControllerWithTitle:SHOW_USERVOICE_STRING() message:nil preferredStyle:UIAlertControllerStyleActionSheet]; + UIAlertAction *cancelAlertAction = [UIAlertAction actionWithTitle:CANCEL_STRING() style:UIAlertActionStyleCancel handler:nil]; + UIAlertAction *showUserVoiceAlertAction = [UIAlertAction actionWithTitle:OK_STRING() style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { #warning Hardcoded Whitelabel Value UVConfig *config = [UVConfig configWithSite:@"chatsecure.uservoice.com"]; [UserVoice presentUserVoiceInterfaceForParentViewController:self andConfig:config]; diff --git a/ChatSecure/Classes/View Controllers/Onboarding/EnablePushViewController.swift b/ChatSecure/Classes/View Controllers/Onboarding/EnablePushViewController.swift index 12b96464e..6f5bade8b 100644 --- a/ChatSecure/Classes/View Controllers/Onboarding/EnablePushViewController.swift +++ b/ChatSecure/Classes/View Controllers/Onboarding/EnablePushViewController.swift @@ -7,6 +7,7 @@ // import UIKit +import OTRAssets public class EnablePushViewController: UIViewController { @@ -40,8 +41,8 @@ public class EnablePushViewController: UIViewController { override public func viewDidLoad() { super.viewDidLoad() NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(EnablePushViewController.didRegisterUserNotificationSettings(_:)), name: OTRUserNotificationsChanged, object: nil) - self.skipButton.setTitle(OTRLanguageManager.translatedString("Skip"), forState: .Normal) - self.enablePushButton.setTitle(OTRLanguageManager.translatedString("Enable Push"), forState: .Normal) + self.skipButton.setTitle(SKIP_STRING(), forState: .Normal) + self.enablePushButton.setTitle(ENABLE_PUSH_STRING(), forState: .Normal) self.skipButton.accessibilityIdentifier = "EnablePushViewSkipButton" } @@ -75,12 +76,12 @@ public class EnablePushViewController: UIViewController { PushController.setPushPreference(.Enabled) showNextScreen() } else { - let alert = UIAlertController(title: OTRLanguageManager.translatedString("Enable Push in Settings"), message: nil, preferredStyle: .Alert) - let settingsAction = UIAlertAction(title: OTRLanguageManager.translatedString("Settings"), style: .Default, handler: { (action: UIAlertAction) -> Void in + let alert = UIAlertController(title: ENABLE_PUSH_IN_SETTINGS_STRING(), message: nil, preferredStyle: .Alert) + let settingsAction = UIAlertAction(title: SETTINGS_STRING(), style: .Default, handler: { (action: UIAlertAction) -> Void in let appSettings = NSURL(string: UIApplicationOpenSettingsURLString) UIApplication.sharedApplication().openURL(appSettings!) }) - let cancelAction = UIAlertAction(title: OTRLanguageManager.translatedString("Cancel"), style: .Cancel, handler: nil) + let cancelAction = UIAlertAction(title: CANCEL_STRING(), style: .Cancel, handler: nil) alert.addAction(settingsAction) alert.addAction(cancelAction) presentViewController(alert, animated: true, completion: nil) diff --git a/ChatSecure/Classes/View Controllers/Onboarding/OTRAddBuddyQRCodeViewController.m b/ChatSecure/Classes/View Controllers/Onboarding/OTRAddBuddyQRCodeViewController.m index a60af231c..7928b1b8e 100644 --- a/ChatSecure/Classes/View Controllers/Onboarding/OTRAddBuddyQRCodeViewController.m +++ b/ChatSecure/Classes/View Controllers/Onboarding/OTRAddBuddyQRCodeViewController.m @@ -15,7 +15,7 @@ #import "OTRAccount.h" #import "OTRDatabaseManager.h" #import "NSURL+ChatSecure.h" -#import "OTRLanguageManager.h" + @interface OTRAddBuddyQRCodeViewController () @@ -28,7 +28,7 @@ @implementation OTRAddBuddyQRCodeViewController - (instancetype)initWithAccount:(OTRAccount *)account completion:(void (^)(void))completion { - if(self = [super initWithCancelButtonTitle:CANCEL_STRING]){ + if(self = [super initWithCancelButtonTitle:CANCEL_STRING()]){ self.account = account; self.qrCodeDelegate = [[OTRQRCodeReaderDelegate alloc] initWithAccount:account]; self.qrCodeDelegate.completion = completion; @@ -43,7 +43,7 @@ - (void)viewDidLoad { UIButton *showOwnQRCodeButton = [UIButton buttonWithType:UIButtonTypeCustom]; showOwnQRCodeButton.translatesAutoresizingMaskIntoConstraints = NO; - [showOwnQRCodeButton setTitle:[OTRLanguageManager translatedString:@"My QR Code"] forState:UIControlStateNormal]; + [showOwnQRCodeButton setTitle:MY_QR_CODE() forState:UIControlStateNormal]; [showOwnQRCodeButton setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted]; [showOwnQRCodeButton addTarget:self action:@selector(showOwnQRCode:) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:showOwnQRCodeButton]; diff --git a/ChatSecure/Classes/View Controllers/Onboarding/OTRWelcomeViewController.swift b/ChatSecure/Classes/View Controllers/Onboarding/OTRWelcomeViewController.swift index cefdf4547..8698edde3 100644 --- a/ChatSecure/Classes/View Controllers/Onboarding/OTRWelcomeViewController.swift +++ b/ChatSecure/Classes/View Controllers/Onboarding/OTRWelcomeViewController.swift @@ -7,6 +7,7 @@ // import UIKit +import OTRAssets public class OTRWelcomeViewController: UIViewController { @@ -29,9 +30,9 @@ public class OTRWelcomeViewController: UIViewController { override public func viewDidLoad() { super.viewDidLoad() - self.createAccountButton.setTitle(OTRLanguageManager.translatedString("Create New Account"), forState: .Normal) - self.skipButton.setTitle(OTRLanguageManager.translatedString("Skip"), forState: .Normal) - self.existingAccountButton.setTitle(OTRLanguageManager.translatedString("Add Existing Account"), forState: .Normal) + self.createAccountButton.setTitle(CREATE_NEW_ACCOUNT_STRING(), forState: .Normal) + self.skipButton.setTitle(SKIP_STRING(), forState: .Normal) + self.existingAccountButton.setTitle(ADD_EXISTING_STRING(), forState: .Normal) } diff --git a/ChatSecure/Classes/View Controllers/UserProfileViewController.swift b/ChatSecure/Classes/View Controllers/UserProfileViewController.swift index 2a9c41777..8287b9088 100644 --- a/ChatSecure/Classes/View Controllers/UserProfileViewController.swift +++ b/ChatSecure/Classes/View Controllers/UserProfileViewController.swift @@ -9,6 +9,7 @@ import UIKit import XLForm import YapDatabase +import OTRAssets public class UserProfileViewController: XLFormViewController { @@ -157,9 +158,9 @@ public class UserProfileViewController: XLFormViewController { public static func cryptoChooserRows(buddy: OTRBuddy, connection: YapDatabaseConnection) -> [XLFormRowDescriptor] { - let bestAvailableRow = XLFormRowDescriptor(tag: DefaultRowTag, rowType: XLFormRowDescriptorTypeBooleanCheck, title: OTRLanguageManager.translatedString("Best Available")) - let plaintextOnlyRow = XLFormRowDescriptor(tag: PlaintextRowTag, rowType: XLFormRowDescriptorTypeBooleanCheck, title: OTRLanguageManager.translatedString("Plaintext Only")) - let plaintextOtrRow = XLFormRowDescriptor(tag: PlaintextRowTag, rowType: XLFormRowDescriptorTypeBooleanCheck, title: OTRLanguageManager.translatedString("Plaintext (Opportunistic OTR)")) + let bestAvailableRow = XLFormRowDescriptor(tag: DefaultRowTag, rowType: XLFormRowDescriptorTypeBooleanCheck, title: Best_Available()) + let plaintextOnlyRow = XLFormRowDescriptor(tag: PlaintextRowTag, rowType: XLFormRowDescriptorTypeBooleanCheck, title: Plaintext_Only()) + let plaintextOtrRow = XLFormRowDescriptor(tag: PlaintextRowTag, rowType: XLFormRowDescriptorTypeBooleanCheck, title: Plaintext_Opportunistic_OTR()) let otrRow = XLFormRowDescriptor(tag: OTRRowTag, rowType: XLFormRowDescriptorTypeBooleanCheck, title: "OTR") let omemoRow = XLFormRowDescriptor(tag: OMEMORowTag, rowType: XLFormRowDescriptorTypeBooleanCheck, title: "OMEMO") let omemoOtrRow = XLFormRowDescriptor(tag: OMEMORowTag, rowType: XLFormRowDescriptorTypeBooleanCheck, title: "OMEMO & OTR") @@ -297,9 +298,9 @@ public class UserProfileViewController: XLFormViewController { public static func profileFormDescriptorForAccount(account: OTRAccount, buddies: [OTRBuddy], connection: YapDatabaseConnection) -> XLFormDescriptor { - let form = XLFormDescriptor(title: OTRLanguageManager.translatedString("Profile")) + let form = XLFormDescriptor(title: Profile_String()) - let yourProfileSection = XLFormSectionDescriptor.formSectionWithTitle(OTRLanguageManager.translatedString("Me")) + let yourProfileSection = XLFormSectionDescriptor.formSectionWithTitle(Me_String()) let yourProfileRow = XLFormRowDescriptor(tag: account.uniqueId, rowType: UserInfoProfileCell.defaultRowDescriptorType()) yourProfileRow.value = account yourProfileSection.addFormRow(yourProfileRow) @@ -400,9 +401,9 @@ public class UserProfileViewController: XLFormViewController { // cryptoChooserRows is only meaningful for 1:1 conversations at the moment if buddies.count == 1 { let buddy = buddies.first! - let cryptoSection = XLFormSectionDescriptor.formSectionWithTitle( OTRLanguageManager.translatedString("Advanced Encryption Settings")) - cryptoSection.footerTitle = OTRLanguageManager.translatedString("Don't change these unless you really know what you're doing. By default we will always select the best available encryption method.") - let showAdvancedSwitch = XLFormRowDescriptor.init(tag: self.ShowAdvancedCryptoSettingsTag, rowType: XLFormRowDescriptorTypeBooleanSwitch, title: OTRLanguageManager.translatedString("Show Advanced Encryption Settings")) + let cryptoSection = XLFormSectionDescriptor.formSectionWithTitle(Advanced_Encryption_Settings()) + cryptoSection.footerTitle = Advanced_Crypto_Warning() + let showAdvancedSwitch = XLFormRowDescriptor.init(tag: self.ShowAdvancedCryptoSettingsTag, rowType: XLFormRowDescriptorTypeBooleanSwitch, title: Show_Advanced_Encryption_Settings()) showAdvancedSwitch.value = NSNumber(bool: false) let cryptoChooser = cryptoChooserRows(buddy, connection: connection) for row in cryptoChooser { diff --git a/ChatSecure/Classes/Views/Cells/OMEMODeviceFingerprintCell.swift b/ChatSecure/Classes/Views/Cells/OMEMODeviceFingerprintCell.swift index aaf3f959c..53b83e0e6 100644 --- a/ChatSecure/Classes/Views/Cells/OMEMODeviceFingerprintCell.swift +++ b/ChatSecure/Classes/Views/Cells/OMEMODeviceFingerprintCell.swift @@ -101,11 +101,11 @@ public class OMEMODeviceFingerprintCell: XLFormBaseCell { if (device.trustLevel == .TrustedTofu) { trustLevelLabel.text = "TOFU" } else if (device.trustLevel == .TrustedUser) { - trustLevelLabel.text = OTRLanguageManager.translatedString("Verified") + trustLevelLabel.text = VERIFIED_STRING() } else if (device.trustLevel == .Removed) { - trustLevelLabel.text = OTRLanguageManager.translatedString("Removed By Server") + trustLevelLabel.text = Removed_By_Server() } else { - trustLevelLabel.text = OTRLanguageManager.translatedString("Untrusted Device") + trustLevelLabel.text = UNTRUSTED_DEVICE_STRING() } } @@ -134,9 +134,9 @@ public class OMEMODeviceFingerprintCell: XLFormBaseCell { if (fingerprint.trustLevel == .TrustedTofu) { trustLevelLabel.text = "TOFU" } else if (fingerprint.trustLevel == .TrustedUser) { - trustLevelLabel.text = OTRLanguageManager.translatedString("Verified") + trustLevelLabel.text = VERIFIED_STRING() } else { - trustLevelLabel.text = OTRLanguageManager.translatedString("Untrusted Device") + trustLevelLabel.text = UNTRUSTED_DEVICE_STRING() } } diff --git a/ChatSecure/Classes/Views/Cells/OTRAccountTableViewCell.m b/ChatSecure/Classes/Views/Cells/OTRAccountTableViewCell.m index 1baccbeb1..c3c86f89d 100644 --- a/ChatSecure/Classes/Views/Cells/OTRAccountTableViewCell.m +++ b/ChatSecure/Classes/Views/Cells/OTRAccountTableViewCell.m @@ -10,7 +10,7 @@ #import "OTRAccount.h" #import "OTRImages.h" -#import "OTRLanguageManager.h" + @import OTRAssets; @implementation OTRAccountTableViewCell @@ -40,11 +40,11 @@ - (void)setAccount:(OTRAccount *)account - (void)setConnectedText:(OTRProtocolConnectionStatus)connectionStatus { if (connectionStatus == OTRProtocolConnectionStatusConnected) { - self.detailTextLabel.text = CONNECTED_STRING; + self.detailTextLabel.text = CONNECTED_STRING(); } else if (connectionStatus == OTRProtocolConnectionStatusConnecting) { - self.detailTextLabel.text = CONNECTING_STRING; + self.detailTextLabel.text = CONNECTING_STRING(); } else { self.detailTextLabel.text = nil; diff --git a/ChatSecure/Classes/Views/Cells/OTRBuddyApprovalCell.m b/ChatSecure/Classes/Views/Cells/OTRBuddyApprovalCell.m index 46d19feea..f80f20476 100644 --- a/ChatSecure/Classes/Views/Cells/OTRBuddyApprovalCell.m +++ b/ChatSecure/Classes/Views/Cells/OTRBuddyApprovalCell.m @@ -7,7 +7,7 @@ // #import "OTRBuddyApprovalCell.h" -#import "OTRLanguageManager.h" + @import OTRAssets; @import PureLayout; @@ -34,7 +34,7 @@ - (void)setThread:(id)thread NSString * name = [thread threadName]; self.nameLabel.text = name; - self.identifierLabel.text = [NSString stringWithFormat:@"%@ %@", name, WANTS_TO_CHAT_STRING]; + self.identifierLabel.text = [NSString stringWithFormat:@"%@ %@", name, WANTS_TO_CHAT_STRING()]; } - (void)updateConstraints diff --git a/ChatSecure/Classes/Views/Cells/OTRBuddyInfoCell.m b/ChatSecure/Classes/Views/Cells/OTRBuddyInfoCell.m index 5965bc7dc..779db5a09 100644 --- a/ChatSecure/Classes/Views/Cells/OTRBuddyInfoCell.m +++ b/ChatSecure/Classes/Views/Cells/OTRBuddyInfoCell.m @@ -14,7 +14,7 @@ @import OTRAssets; @import PureLayout; #import "OTRDatabaseManager.h" -#import "OTRLanguageManager.h" + @interface OTRBuddyInfoCell () @@ -76,7 +76,7 @@ - (void)setThread:(id)thread if ([thread isKindOfClass:[OTRXMPPBuddy class]]) { if(((OTRXMPPBuddy *)thread).isPendingApproval) { - NSString *pendingString = [NSString stringWithFormat:@" - %@",PENDING_APPROVAL_STRING]; + NSString *pendingString = [NSString stringWithFormat:@" - %@",PENDING_APPROVAL_STRING()]; self.nameLabel.text = [self.nameLabel.text stringByAppendingString:pendingString]; } } diff --git a/ChatSecure/Classes/Views/OTRRememberPasswordView.m b/ChatSecure/Classes/Views/OTRRememberPasswordView.m index 050c00980..a31a5174f 100644 --- a/ChatSecure/Classes/Views/OTRRememberPasswordView.m +++ b/ChatSecure/Classes/Views/OTRRememberPasswordView.m @@ -9,7 +9,7 @@ #import "OTRRememberPasswordView.h" @import OTRAssets; @import PureLayout; -#import "OTRLanguageManager.h" + @interface OTRRememberPasswordView () @@ -32,7 +32,7 @@ - (id)initWithFrame:(CGRect)frame ////// label ////// self.rememberPasswordLabel = [[UILabel alloc] initWithFrame:CGRectZero]; self.rememberPasswordLabel.translatesAutoresizingMaskIntoConstraints = NO; - self.rememberPasswordLabel.text = REMEMBER_PASSPHRASE_STRING; + self.rememberPasswordLabel.text = REMEMBER_PASSPHRASE_STRING(); ////// switch ////// self.rememberPasswordSwitch = [[UISwitch alloc] initWithFrame:CGRectZero]; @@ -62,7 +62,7 @@ - (CGSize)intrinsicContentSize - (void)passwordInfoButtonPressed:(id)sender { - UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:REMEMBER_PASSPHRASE_STRING message:REMEMBER_PASSPHRASE_INFO_STRING delegate:nil cancelButtonTitle:nil otherButtonTitles:OK_STRING, nil]; + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:REMEMBER_PASSPHRASE_STRING() message:REMEMBER_PASSPHRASE_INFO_STRING() delegate:nil cancelButtonTitle:nil otherButtonTitles:OK_STRING(), nil]; [alertView show]; } diff --git a/ChatSecure/Classes/Views/OTRSocialButtonsView.m b/ChatSecure/Classes/Views/OTRSocialButtonsView.m index 400745d0a..a4bb44584 100644 --- a/ChatSecure/Classes/Views/OTRSocialButtonsView.m +++ b/ChatSecure/Classes/Views/OTRSocialButtonsView.m @@ -12,7 +12,7 @@ #import "NSURL+ChatSecure.h" #import "OTRAppDelegate.h" @import OTRAssets; -#import "OTRLanguageManager.h" + static CGFloat kOTRSocialButtonHeight = 30.0f; static CGFloat kOTRSocialButtonWidth = 93.0f; @@ -31,17 +31,17 @@ - (id)initWithFrame:(CGRect)frame self.translatesAutoresizingMaskIntoConstraints = NO; UIFont *buttonFont = [UIFont systemFontOfSize:15]; self.facebookButton = [[BButton alloc] initWithFrame:CGRectZero type:BButtonTypeFacebook style:BButtonStyleBootstrapV3]; - self.facebookButton.titleLabel.text = FACEBOOK_STRING; + self.facebookButton.titleLabel.text = FACEBOOK_STRING(); self.facebookButton.titleLabel.font = buttonFont; [self.facebookButton addAwesomeIcon:FAFacebook beforeTitle:YES]; [self.facebookButton addTarget:self action:@selector(facebookButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; self.githubButton = [[BButton alloc] initWithFrame:CGRectZero type:BButtonTypeDefault style:BButtonStyleBootstrapV3]; - self.githubButton.titleLabel.text = GITHUB_STRING; + self.githubButton.titleLabel.text = GITHUB_STRING(); self.githubButton.titleLabel.font = buttonFont; [self.githubButton addAwesomeIcon:FAGithub beforeTitle:YES]; [self.githubButton addTarget:self action:@selector(githubButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; self.twitterButton = [[BButton alloc] initWithFrame:CGRectZero type:BButtonTypeTwitter style:BButtonStyleBootstrapV3]; - self.twitterButton.titleLabel.text = TWITTER_STRING; + self.twitterButton.titleLabel.text = TWITTER_STRING(); self.twitterButton.titleLabel.font = buttonFont; [self.twitterButton addAwesomeIcon:FATwitter beforeTitle:YES]; [self.twitterButton addTarget:self action:@selector(twitterButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; diff --git a/ChatSecureCore/ChatSecureCore.h b/ChatSecureCore/ChatSecureCore.h index 3c32af668..d31a26b11 100644 --- a/ChatSecureCore/ChatSecureCore.h +++ b/ChatSecureCore/ChatSecureCore.h @@ -50,7 +50,7 @@ FOUNDATION_EXPORT const unsigned char ChatSecureCoreVersionString[]; #import "OTRThreadOwner.h" #import "OTRBuddy.h" #import "OTRXMPPBuddy.h" -#import "OTRLanguageManager.h" + #import "NSURL+ChatSecure.h" #import "OTRProtocolManager.h" #import "OTRInviteViewController.h" diff --git a/OTRAssets/OTRAssets.h b/OTRAssets/OTRAssets.h index 5f90e3723..d7f1a03da 100644 --- a/OTRAssets/OTRAssets.h +++ b/OTRAssets/OTRAssets.h @@ -22,8 +22,12 @@ FOUNDATION_EXPORT double OTRAssetsVersionNumber; //! Project version string for OTRAssets. FOUNDATION_EXPORT const unsigned char OTRAssetsVersionString[]; +FOUNDATION_EXPORT NSString *const kOTRDefaultLanguageLocale; +FOUNDATION_EXPORT NSString *const kOTRSettingKeyLanguage; + // In this header, you should import all the public headers of your framework using statements like #import #import "OTRStrings.h" #import "OTRSecrets.h" #import "OTRBranding.h" +#import "OTRLanguageManager.h" diff --git a/OTRAssets/OTRAssets.m b/OTRAssets/OTRAssets.m index da2278ca8..423677a88 100644 --- a/OTRAssets/OTRAssets.m +++ b/OTRAssets/OTRAssets.m @@ -8,6 +8,9 @@ #import "OTRAssets.h" +NSString *const kOTRSettingKeyLanguage = @"userSelectedSetting"; +NSString *const kOTRDefaultLanguageLocale = @"kOTRDefaultLanguageLocale"; + @implementation OTRAssets /** Returns OTRResources.bundle */ @@ -18,4 +21,4 @@ + (NSBundle*) resourcesBundle { return dataBundle; } -@end \ No newline at end of file +@end diff --git a/ChatSecure/Classes/Controllers/OTRLanguageManager.h b/OTRAssets/OTRLanguageManager.h similarity index 53% rename from ChatSecure/Classes/Controllers/OTRLanguageManager.h rename to OTRAssets/OTRLanguageManager.h index 070f4407e..a54f5cb41 100644 --- a/ChatSecure/Classes/Controllers/OTRLanguageManager.h +++ b/OTRAssets/OTRLanguageManager.h @@ -1,5 +1,5 @@ // -// OTRLanguageController.h +// OTRLanguageManager.h // Off the Record // // Created by David on 11/13/12. @@ -8,22 +8,18 @@ @import Foundation; -extern NSString *const kOTRDefaultLanguageLocale; -extern NSString *const kOTRSettingKeyLanguage; +NS_ASSUME_NONNULL_BEGIN @interface OTRLanguageManager : NSObject -@property (nonatomic,strong) NSDictionary * languageLookupDictionary; - /** @return an Array of supported language codes from the bundle */ -+ (NSArray *)supportedLanguages; ++ (NSArray *)supportedLanguages; + (void)setLocale:(NSString *)locale; - + (NSString *)currentLocale; -+ (NSString *)translatedString:(NSString *)englishString; @end +NS_ASSUME_NONNULL_END diff --git a/ChatSecure/Classes/Controllers/OTRLanguageManager.m b/OTRAssets/OTRLanguageManager.m similarity index 90% rename from ChatSecure/Classes/Controllers/OTRLanguageManager.m rename to OTRAssets/OTRLanguageManager.m index 890e46abf..3d01bca77 100644 --- a/ChatSecure/Classes/Controllers/OTRLanguageManager.m +++ b/OTRAssets/OTRLanguageManager.m @@ -7,11 +7,10 @@ // #import "OTRLanguageManager.h" -@import OTRAssets; +#import "OTRAssets.h" +#import "OTRLanguageManager_Private.h" -NSString *const kOTRSettingKeyLanguage = @"userSelectedSetting"; -NSString *const kOTRDefaultLanguageLocale = @"kOTRDefaultLanguageLocale"; -NSString *const kOTRAppleLanguagesKey = @"AppleLanguages"; +static NSString *const kOTRAppleLanguagesKey = @"AppleLanguages"; @implementation OTRLanguageManager diff --git a/OTRAssets/OTRLanguageManager_Private.h b/OTRAssets/OTRLanguageManager_Private.h new file mode 100644 index 000000000..a2d76ddde --- /dev/null +++ b/OTRAssets/OTRLanguageManager_Private.h @@ -0,0 +1,17 @@ +// +// OTRLanguageManager_Private.h +// ChatSecure +// +// Created by Chris Ballinger on 1/12/17. +// Copyright © 2017 Chris Ballinger. All rights reserved. +// + +#import "OTRLanguageManager.h" + +NS_ASSUME_NONNULL_BEGIN +@interface OTRLanguageManager() + ++ (NSString *)translatedString:(NSString *)englishString; + +@end +NS_ASSUME_NONNULL_END diff --git a/OTRAssets/Strings/OTRStrings.h b/OTRAssets/Strings/OTRStrings.h index 9cfec4c48..2b32aaf38 100644 --- a/OTRAssets/Strings/OTRStrings.h +++ b/OTRAssets/Strings/OTRStrings.h @@ -1,302 +1,609 @@ // DO NOT EDIT THIS FILE. EDIT strings.json then run python StringsConverter.py -#define NO_DEVICES_BUDDY_ERROR_STRING [OTRLanguageManager translatedString: @"We could not find any trusted devices for this contact."] -#define Server_String [OTRLanguageManager translatedString: @"Server"] -#define errSSLCryptoString [OTRLanguageManager translatedString: @"Underlying cryptographic error"] -#define OFFLINE_STRING [OTRLanguageManager translatedString: @"Offline"] -#define ERROR_STRING [OTRLanguageManager translatedString: @"Error"] -#define LOGOUT_STRING [OTRLanguageManager translatedString: @"Log Out"] -#define DELETE_CONVERSATIONS_ON_DISCONNECT_TITLE_STRING [OTRLanguageManager translatedString: @"Auto-delete"] -#define DONE_STRING [OTRLanguageManager translatedString: @"Done"] -#define noErrString [OTRLanguageManager translatedString: @"No Error"] -#define Basic_Setup [OTRLanguageManager translatedString: @"Basic Setup"] -#define CHATSECURE_PUSH_STRING [OTRLanguageManager translatedString: @"ChatSecure Push"] -#define CONVERSATION_NO_LONGER_SECURE_STRING [OTRLanguageManager translatedString: @"The conversation with %@ is no longer secure."] -#define USER_PASS_BLANK_STRING [OTRLanguageManager translatedString: @"You must enter a username and a password to login."] -#define THEIR_FINGERPRINT_STRING [OTRLanguageManager translatedString: @"Purported fingerprint for"] -#define errSSLPeerAuthCompletedString [OTRLanguageManager translatedString: @"Peer cert is valid, or was ignored if verification disabled"] -#define PASSWORD_STRING [OTRLanguageManager translatedString: @"Password"] -#define ADVANCED_STRING [OTRLanguageManager translatedString: @"Advanced"] -#define Could_Not_Decrypt_Database [OTRLanguageManager translatedString: @"Could not decrypt database. If the app is not working properly, you may need to delete and reinstall."] -#define Profile_String [OTRLanguageManager translatedString: @"Profile"] -#define Unrecognized_Invite_Format [OTRLanguageManager translatedString: @"Unrecognized Invite Format"] -#define RESEND_STRING [OTRLanguageManager translatedString: @"Resend"] -#define OTRL_MSGEVENT_ENCRYPTION_REQUIRED_STRING [OTRLanguageManager translatedString: @"Our policy requires encryption but we are trying to send an unencrypted message out."] -#define VERSION_STRING [OTRLanguageManager translatedString: @"Version"] -#define ENTER_GROUP_NAME_STRING [OTRLanguageManager translatedString: @"Enter a group name"] -#define ACCOUNT_DISCONNECTED_STRING [OTRLanguageManager translatedString: @"Account Disconnected"] -#define INITIATE_ENCRYPTED_CHAT_STRING [OTRLanguageManager translatedString: @"Initiate Encrypted Chat"] -#define INVALID_EMAIL_TITLE_STRING [OTRLanguageManager translatedString: @"Invalid Email"] -#define SENDING_STRING [OTRLanguageManager translatedString: @"Sending"] -#define Crash_Detected_Title [OTRLanguageManager translatedString: @"Crash Detected"] -#define RESEND_MESSAGE_TITLE [OTRLanguageManager translatedString: @"Resend Message"] -#define SEND_PLAINTEXT_STRING [OTRLanguageManager translatedString: @"Send plaintext message"] -#define OTRL_MSGEVENT_CONNECTION_ENDED_STRING [OTRLanguageManager translatedString: @"Message has not been sent because our buddy has ended the private conversation. We should either close the connection, or refresh it."] -#define ACCOUNT_DISCONNECTED_DESCRIPTION_STRING [OTRLanguageManager translatedString: @"Please log into this account before managing requests."] -#define ADD_STRING [OTRLanguageManager translatedString: @"Add"] -#define OTRL_MSGEVENT_RCVDMSG_FOR_OTHER_INSTANCE_STRING [OTRLanguageManager translatedString: @"Received and discarded a message intended for another instance."] -#define RESEND_DESCRIPTION_STRING [OTRLanguageManager translatedString: @"Resending this message will use %@."] -#define OPEN_IN_TWITTER_STRING [OTRLanguageManager translatedString: @"Open in Twitter"] -#define TWITTER_STRING [OTRLanguageManager translatedString: @"Twitter"] -#define Microphone_Disabled [OTRLanguageManager translatedString: @"Microphone Disabled"] -#define CONNECTED_STRING [OTRLanguageManager translatedString: @"Connected"] -#define TOR_WARNING_MESSAGE_STRING [OTRLanguageManager translatedString: @"Tor is an experimental feature, please use with caution."] -#define MY_QR_CODE [OTRLanguageManager translatedString: @"My QR Code"] -#define Server_String_Hint [OTRLanguageManager translatedString: @"Choose from our list of trusted servers, or use your own."] -#define EXTENDED_AWAY_STRING [OTRLanguageManager translatedString: @"Extended Away"] -#define OTRL_MSGEVENT_MSG_REFLECTED_STRING [OTRLanguageManager translatedString: @"Received our own OTR messages."] -#define errSSLClosedNoNotifyString [OTRLanguageManager translatedString: @"Server closed session with no notification"] -#define PUBLIC_KEY_ERROR_STRING [OTRLanguageManager translatedString: @"Could not retrieve public key from certificate"] -#define OTRL_MSGEVENT_RCVDMSG_NOT_IN_PRIVATE_STRING [OTRLanguageManager translatedString: @"Received an encrypted message but cannot read it because no private connection is established yet."] -#define NEW_CERTIFICATE_STRING [OTRLanguageManager translatedString: @"New SSL Certificate"] -#define LOGIN_STRING [OTRLanguageManager translatedString: @"Log In"] -#define CANCEL_STRING [OTRLanguageManager translatedString: @"Cancel"] -#define Database_Error_String [OTRLanguageManager translatedString: @"Database Error"] -#define LOGIN_AUTOMATICALLY_STRING [OTRLanguageManager translatedString: @"Login Automatically"] -#define UNTRUSTED_DEVICE_STRING [OTRLanguageManager translatedString: @"Untrusted Device"] -#define errSSLPeerDecodeErrorString [OTRLanguageManager translatedString: @"Decoding error"] -#define iOS_SSL_ERROR_PART1_STRING [OTRLanguageManager translatedString: @"Your current iOS system version (%@) contains a serious security vulnerability. Please update to the latest version as soon as possible."] -#define errSSLRecordOverflowString [OTRLanguageManager translatedString: @"Record overflow"] -#define errSSLDecryptionFailString [OTRLanguageManager translatedString: @"Decryption failure"] -#define CONNECT_EXISTING_STRING [OTRLanguageManager translatedString: @"Connect to Existing Account"] -#define GITHUB_STRING [OTRLanguageManager translatedString: @"GitHub"] -#define ONBOARDING_SUCCESS_STRING [OTRLanguageManager translatedString: @"You're ready to use"] -#define Removed_By_Server [OTRLanguageManager translatedString: @"Removed By Server"] -#define OPEN_IN_FACEBOOK_STRING [OTRLanguageManager translatedString: @"Open in Facebook"] -#define Show_Advanced_Encryption_Settings [OTRLanguageManager translatedString: @"Show Advanced Encryption Settings"] -#define errSSLHostNameMismatchString [OTRLanguageManager translatedString: @"Peer host name mismatch"] -#define CONVERSATION_SECURE_WARNING_STRING [OTRLanguageManager translatedString: @"This chat is secured"] -#define PINNED_CERTIFICATES_STRING [OTRLanguageManager translatedString: @"Pinned Certificates"] -#define DELETE_ACCOUNT_MESSAGE_STRING [OTRLanguageManager translatedString: @"Permanently delete"] -#define OTRL_MSGEVENT_RCVDMSG_GENERAL_ERR_STRING [OTRLanguageManager translatedString: @"Received a general OTR error."] -#define CREATED_BY_STRING [OTRLanguageManager translatedString: @"Created by"] -#define UNLOCKED_ALERT_STRING [OTRLanguageManager translatedString: @"The conversation is not secure"] -#define SAVE_STRING [OTRLanguageManager translatedString: @"Save"] -#define errSSLNoRootCertString [OTRLanguageManager translatedString: @"Cert chain not verified by root"] -#define ACCOUNTS_STRING [OTRLanguageManager translatedString: @"Accounts"] -#define PENDING_APPROVAL_STRING [OTRLanguageManager translatedString: @"Pending Approval"] -#define errSSLPeerDecryptionFailString [OTRLanguageManager translatedString: @"Decryption failed"] -#define JABBER_STRING [OTRLanguageManager translatedString: @"Jabber (XMPP)"] -#define VERIFY_STRING [OTRLanguageManager translatedString: @"Verify"] -#define errSSLCertExpiredString [OTRLanguageManager translatedString: @"Chain had an expired cert"] -#define errSSLBadConfigurationString [OTRLanguageManager translatedString: @"Configuration error"] -#define ADD_BUDDY_STRING [OTRLanguageManager translatedString: @"Add Buddy"] -#define errSSLClientCertRequestedString [OTRLanguageManager translatedString: @"Server has requested a client cert"] -#define XMPP_TOR_STRING [OTRLanguageManager translatedString: @"XMPP + Tor"] -#define REGISTER_ERROR_STRING [OTRLanguageManager translatedString: @"Error Registering Username"] -#define OTRL_MSGEVENT_RCVDMSG_UNREADABLE_STRING [OTRLanguageManager translatedString: @"Cannot read the received message."] -#define errSSLPeerProtocolVersionString [OTRLanguageManager translatedString: @"Bad protocol version"] -#define TOR_DOMAIN_WARNING_MESSAGE_STRING [OTRLanguageManager translatedString: @"Only one Tor account per domain is supported at this time."] -#define CHANGE_PASSPHRASE_STRING [OTRLanguageManager translatedString: @"Change Passphrase"] -#define RECENT_STRING [OTRLanguageManager translatedString: @"Recent"] -#define errSSLBufferOverflowString [OTRLanguageManager translatedString: @"Insufficient buffer provided"] -#define COPY_STRING [OTRLanguageManager translatedString: @"Copy"] -#define INCOMING_STRING [OTRLanguageManager translatedString: @"Incoming"] -#define CONNECTING_STRING [OTRLanguageManager translatedString: @"Connecting"] -#define LOCKED_WARN_STRING [OTRLanguageManager translatedString: @"The fingerprint has not been verified"] -#define UNLOCK_STRING [OTRLanguageManager translatedString: @"Unlock"] -#define Advanced_Crypto_Warning [OTRLanguageManager translatedString: @"Don't change these unless you really know what you're doing. By default we will always select the best available encryption method."] -#define DONATE_MESSAGE_STRING [OTRLanguageManager translatedString: @"Your donation will help fund the continued development of ChatSecure."] -#define DONATE_STRING [OTRLanguageManager translatedString: @"Donate"] -#define REJECT_STRING [OTRLanguageManager translatedString: @"Reject"] -#define errSSLIllegalParamString [OTRLanguageManager translatedString: @"Illegal parameter"] -#define CREATE_STRING [OTRLanguageManager translatedString: @"Create"] -#define RESOURCE_STRING [OTRLanguageManager translatedString: @"Resource"] -#define Crash_Detected_Message [OTRLanguageManager translatedString: @"The app crashed last time it was launched. Send a crash report?"] -#define errSSLPeerAccessDeniedString [OTRLanguageManager translatedString: @"Access denied"] -#define errSSLPeerInternalErrorString [OTRLanguageManager translatedString: @"Internal error"] -#define OTRL_MSGEVENT_ENCRYPTION_ERROR_STRING [OTRLanguageManager translatedString: @"An error occured while encrypting a message and the message was not sent."] -#define RELEASE_TO_DELETE_STRING [OTRLanguageManager translatedString: @"Release to delete"] -#define PHOTO_LIBRARY_STRING [OTRLanguageManager translatedString: @"Photo Library"] -#define VERIFY_FINGERPRINT_STRING [OTRLanguageManager translatedString: @"Verify Fingerprint"] -#define SAVED_CERTIFICATES_STRING [OTRLanguageManager translatedString: @"Saved Certificates"] -#define NEW_ACCOUNT_STRING [OTRLanguageManager translatedString: @"New Account"] -#define DOMAIN_BLANK_ERROR_STRING [OTRLanguageManager translatedString: @"Domain needs to be set"] -#define LOCKED_SECURE_STRING [OTRLanguageManager translatedString: @"The conversation is secure and the fingerprint is verfied"] -#define QR_CODE_STRING [OTRLanguageManager translatedString: @"QR code"] -#define AWAY_MESSAGE_STRING [OTRLanguageManager translatedString: @"is now away"] -#define FACEBOOK_REMOVED_STRING [OTRLanguageManager translatedString: @"Facebook account removed"] -#define AWAY_STRING [OTRLanguageManager translatedString: @"Away"] -#define HOSTNAME_STRING [OTRLanguageManager translatedString: @"Hostname"] -#define errSSLPeerInsufficientSecurityString [OTRLanguageManager translatedString: @"Insufficient security"] -#define iOS_SSL_ERROR_TITLE_STRING [OTRLanguageManager translatedString: @"iOS Vulnerability"] -#define CUSTOM_STRING [OTRLanguageManager translatedString: @"Custom"] -#define HOLD_TO_TALK_STRING [OTRLanguageManager translatedString: @"Hold to talk"] -#define SKIP_STRING [OTRLanguageManager translatedString: @"Skip"] -#define SEARCH_STRING [OTRLanguageManager translatedString: @"Search"] -#define AIM_STRING [OTRLanguageManager translatedString: @"OSCAR Instant Messenger"] -#define DISCONNECTION_WARNING_DESC_STRING [OTRLanguageManager translatedString: @"1 Minute Alert Before Disconnection"] -#define OTRL_MSGEVENT_MSG_RESENT_STRING [OTRLanguageManager translatedString: @"The previous message was resent."] -#define CONNECT_STRING [OTRLanguageManager translatedString: @"Connect"] -#define PAYMENTS_SETUP_ERROR_STRING [OTRLanguageManager translatedString: @"This device doesn't seem to be configured to make payments."] -#define WANTS_TO_CHAT_STRING [OTRLanguageManager translatedString: @"wants to chat."] -#define errSSLPeerRecordOverflowString [OTRLanguageManager translatedString: @"Record overflow"] -#define KNOCK_SENT_STRING [OTRLanguageManager translatedString: @"Knock Sent"] -#define SECURITY_STRING [OTRLanguageManager translatedString: @"Security"] -#define Plaintext_Opportunistic_OTR [OTRLanguageManager translatedString: @"Plaintext (Opportunistic OTR)"] -#define UNABLE_TO_SEND_STRING [OTRLanguageManager translatedString: @"Unable to Send Message"] -#define errSSLPeerCertUnknownString [OTRLanguageManager translatedString: @"Unknown certificate"] -#define ERROR_CREATING_ACCOUNT_STRING [OTRLanguageManager translatedString: @"Error Creating Account"] -#define OTR_FINGERPRINTS_STRING [OTRLanguageManager translatedString: @"OTR Fingerprints"] -#define errSSLPeerCertExpiredString [OTRLanguageManager translatedString: @"Certificate expired"] -#define SEND_ENCRYPTED_STRING [OTRLanguageManager translatedString: @"Send %@ encrypted message"] -#define OTRL_MSGEVENT_SETUP_ERROR_STRING [OTRLanguageManager translatedString: @"A private conversation could not be set up."] -#define UNKNOWN_ERROR_STRING [OTRLanguageManager translatedString: @"Unknown Error"] -#define errSSLNegotiationString [OTRLanguageManager translatedString: @"Cipher Suite negotiation failure"] -#define errSSLPeerExportRestrictionString [OTRLanguageManager translatedString: @"Export restriction"] -#define errSSLPeerHandshakeFailString [OTRLanguageManager translatedString: @"Handshake failure"] -#define GOOGLE_TALK_STRING [OTRLanguageManager translatedString: @"Google Talk"] -#define OTR_FINGERPRINTS_SUBTITLE_STRING [OTRLanguageManager translatedString: @"Manage OTR fingerprints"] -#define errSSLFatalAlertString [OTRLanguageManager translatedString: @"Fatal alert"] -#define iOS_SSL_ERROR_PART2_STRING [OTRLanguageManager translatedString: @"Settings -> General -> Software Update"] -#define USERNAME_STRING [OTRLanguageManager translatedString: @"Username"] -#define Advanced_Encryption_Settings [OTRLanguageManager translatedString: @"Advanced Encryption Settings"] -#define errSSLModuleAttachString [OTRLanguageManager translatedString: @"Module attach failure"] -#define REMEMBER_PASSPHRASE_INFO_STRING [OTRLanguageManager translatedString: @"Your password will be stored in the iOS Keychain of this device only, and is only as safe as your device passphrase or pin. However, it will not persist during a device backup/restore via iTunes, so please don't forget it, or you may lose your conversation history."] -#define WAITING_STRING [OTRLanguageManager translatedString: @"Waiting"] -#define GROUP_NAME_STRING [OTRLanguageManager translatedString: @"Group Name"] -#define SHARE_STRING [OTRLanguageManager translatedString: @"Share"] -#define Basic_Setup_Hint [OTRLanguageManager translatedString: @"Think of a unique nickname that you don't use anywhere else and doesn't contain personal information."] -#define OPPORTUNISTIC_OTR_SETTING_TITLE [OTRLanguageManager translatedString: @"Auto-start Encryption"] -#define SEND_FEEDBACK_STRING [OTRLanguageManager translatedString: @"Send Feedback"] -#define NAME_STRING [OTRLanguageManager translatedString: @"Name"] -#define BLOCK_STRING [OTRLanguageManager translatedString: @"Block"] -#define ACCOUNT_FINGERPRINTS_STRING [OTRLanguageManager translatedString: @"Account Fingerprints"] -#define OK_STRING [OTRLanguageManager translatedString: @"OK"] -#define OPPORTUNISTIC_OTR_SETTING_DESCRIPTION [OTRLanguageManager translatedString: @"Enables opportunistic OTR"] -#define errSSLUnexpectedRecordString [OTRLanguageManager translatedString: @"Unexpected (skipped) record in DTLS"] -#define VIEW_PROFILE_STRING [OTRLanguageManager translatedString: @"View Profile"] -#define PORT_STRING [OTRLanguageManager translatedString: @"Port"] -#define errSSLClosedAbortString [OTRLanguageManager translatedString: @"Connection closed via error"] -#define SUBSCRIPTION_REQUEST_TITLE [OTRLanguageManager translatedString: @"Subscription Requests"] -#define Nickname_String [OTRLanguageManager translatedString: @"Nickname"] -#define UNTRUSTED_DEVICE_REVEIVED_STRING [OTRLanguageManager translatedString: @"This message was received from an untrusted device."] -#define DELETE_ACCOUNT_TITLE_STRING [OTRLanguageManager translatedString: @"Delete Account?"] -#define errSSLPeerDecompressFailString [OTRLanguageManager translatedString: @"Decompression failure"] -#define errSSLPeerUnsupportedCertString [OTRLanguageManager translatedString: @"Bad unsupported cert format"] -#define OTRL_MSGEVENT_RCVDMSG_UNENCRYPTED_STRING [OTRLanguageManager translatedString: @"Received an unencrypted message."] -#define errSSLPeerUnknownCAString [OTRLanguageManager translatedString: @"Unknown Cert Authority"] -#define errSSLBadCipherSuiteString [OTRLanguageManager translatedString: @"Bad SSLCipherSuite"] -#define OFFLINE_MESSAGE_STRING [OTRLanguageManager translatedString: @"is now offline"] -#define errSSLBadRecordMacString [OTRLanguageManager translatedString: @"Bad MAC"] -#define XMPP_FAIL_STRING [OTRLanguageManager translatedString: @"Failed to connect to XMPP server. Please check your login credentials and internet connection and try again."] -#define errSSLPeerNoRenegotiationString [OTRLanguageManager translatedString: @"No renegotiation allowed"] -#define UNENCRYPTED_STRING [OTRLanguageManager translatedString: @"plaintext"] -#define EXPIRATION_STRING [OTRLanguageManager translatedString: @"Background session will expire in one minute."] -#define Enable_Tor_String [OTRLanguageManager translatedString: @"Enable Tor"] -#define Show_Advanced_Options [OTRLanguageManager translatedString: @"Show Advanced Options"] -#define Me_String [OTRLanguageManager translatedString: @"Me"] -#define errSSLInternalString [OTRLanguageManager translatedString: @"Internal error"] -#define YOU_ARE_NOT_CONNECTED_STRING [OTRLanguageManager translatedString: @"You are not connected"] -#define FACEBOOK_STRING [OTRLanguageManager translatedString: @"Facebook"] -#define PUSH_TITLE_STRING [OTRLanguageManager translatedString: @"Push"] -#define DUPLICATE_ACCOUNT_MESSAGE_STRING [OTRLanguageManager translatedString: @"There already exists an account with this username."] -#define errSSLWouldBlockString [OTRLanguageManager translatedString: @"I/O would block (not fatal)"] -#define CONNECTING_TO_TOR_STRING [OTRLanguageManager translatedString: @"Connecting to Tor"] -#define CHAT_STRING [OTRLanguageManager translatedString: @"Chat"] -#define OTRL_MSGEVENT_LOG_HEARTBEAT_RCVD_STRING [OTRLanguageManager translatedString: @"Received a heartbeat."] -#define FACEBOOK_REMOVED_MESSAGE_STRING [OTRLanguageManager translatedString: @"Facebook has remmoved acces to the chat API"] -#define DO_NOT_DISTURB_STRING [OTRLanguageManager translatedString: @"Do Not Disturb"] -#define errSSLProtocolString [OTRLanguageManager translatedString: @"SSL protocol error"] -#define VIEW_PROFILE_DESCRIPTION_STRING [OTRLanguageManager translatedString: @"View profile to review contact's devices or change encryption settings."] -#define SHARE_MESSAGE_STRING [OTRLanguageManager translatedString: @"Chat with me securely"] -#define OTRL_MSGEVENT_LOG_HEARTBEAT_SENT_STRING [OTRLanguageManager translatedString: @"Sent a heartbeat."] -#define NO_DEVICES_ACCOUNT_ERROR_STRING [OTRLanguageManager translatedString: @"We could not find any trusted devices for this account."] -#define Microphone_Reenable_Please [OTRLanguageManager translatedString: @"To use this feature you must re-enable microphone permissions."] -#define errSSLClosedGracefulString [OTRLanguageManager translatedString: @"Connection closed gracefully"] -#define VALID_CERTIFICATE_STRING [OTRLanguageManager translatedString: @"Valid certificate"] -#define NEW_STRING [OTRLanguageManager translatedString: @"New"] -#define errSSLPeerUnexpectedMsgString [OTRLanguageManager translatedString: @"Unexpected message received"] -#define DELETE_CONVERSATIONS_ON_DISCONNECT_DESCRIPTION_STRING [OTRLanguageManager translatedString: @"Delete chats on disconnect"] -#define INVITE_SMS_STRING [OTRLanguageManager translatedString: @"Invite SMS"] -#define CHATS_STRING [OTRLanguageManager translatedString: @"Chats"] -#define HELP_TRANSLATE_STRING [OTRLanguageManager translatedString: @"Help Translate"] -#define NOT_VERIFIED_STRING [OTRLanguageManager translatedString: @"Not Verified"] -#define errSSLPeerDecryptErrorString [OTRLanguageManager translatedString: @"Decryption error"] -#define Choose_Server_String [OTRLanguageManager translatedString: @"Choose Server"] -#define errSSLBadCertString [OTRLanguageManager translatedString: @"Bad certificate format"] -#define errSSLConnectionRefusedString [OTRLanguageManager translatedString: @"Peer dropped connection before responding"] -#define SECURITY_WARNING_STRING [OTRLanguageManager translatedString: @"Security Warning"] -#define VERIFIED_STRING [OTRLanguageManager translatedString: @"Verified"] -#define BUDDY_INFO_STRING [OTRLanguageManager translatedString: @"Buddy Info"] -#define NEW_PASSPHRASE_STRING [OTRLanguageManager translatedString: @"New Passphrase"] -#define ACCOUNT_STRING [OTRLanguageManager translatedString: @"Account"] -#define KNOCK_STRING [OTRLanguageManager translatedString: @"Knock"] -#define QR_CODE_INSTRUCTIONS_STRING [OTRLanguageManager translatedString: @"This QR Code contains a link to http://omniqrcode.com/q/chatsecure and will redirect to the App Store."] -#define REMEMBER_PASSWORD_STRING [OTRLanguageManager translatedString: @"Remember password"] -#define CONVERSATION_NOT_SECURE_WARNING_STRING [OTRLanguageManager translatedString: @"Warning: This chat is not encrypted"] -#define CANCEL_ENCRYPTED_CHAT_STRING [OTRLanguageManager translatedString: @"Cancel Encrypted Chat"] -#define Generate_Secure_Password_Hint [OTRLanguageManager translatedString: @"We can automatically generate you a secure password. If you choose your own, make sure it's a unique password you don't use anywhere else."] -#define Best_Available [OTRLanguageManager translatedString: @"Best Available"] -#define SETTINGS_STRING [OTRLanguageManager translatedString: @"Settings"] -#define ENCRYPTION_ERROR_STRING [OTRLanguageManager translatedString: @"Encryption Error"] -#define LOCKED_ERROR_STRING [OTRLanguageManager translatedString: @"The fingerprint has changed and needs to be verified"] -#define SIGN_UP_STRING [OTRLanguageManager translatedString: @"Sign Up"] -#define REMEMBER_PASSPHRASE_STRING [OTRLanguageManager translatedString: @"Remember Passphrase"] -#define MANAGE_CHATSECURE_PUSH_ACCOUNT_STRING [OTRLanguageManager translatedString: @"Manage ChatSecure Push account"] -#define errSSLPeerBadCertString [OTRLanguageManager translatedString: @"Miscellaneous bad certificate"] -#define Generate_Secure_Password [OTRLanguageManager translatedString: @"Generate Secure Password"] -#define OLD_STRING [OTRLanguageManager translatedString: @"Old"] -#define FORGOT_PASSPHRASE_INFO_STRING [OTRLanguageManager translatedString: @"Because the database contents is encrypted with your passphrase, you've lost access to your data and will need to delete and reinstall ChatSecure to continue. Password managers like 1Password or MiniKeePass can be helpful for generating and storing strong passwords."] -#define SOURCE_STRING [OTRLanguageManager translatedString: @"Check out the source here on Github"] -#define DATABASE_PASSPHRASE_CHANGE_SUCCESS_STRING [OTRLanguageManager translatedString: @"The database passphrase change was successful."] -#define errSSLSessionNotFoundString [OTRLanguageManager translatedString: @"Attempt to restore an unknown session"] -#define INFO_STRING [OTRLanguageManager translatedString: @"Info"] -#define OTHER_STRING [OTRLanguageManager translatedString: @"Other"] -#define REPLY_STRING [OTRLanguageManager translatedString: @"Reply"] -#define IN_BAND_ERROR_STRING [OTRLanguageManager translatedString: @"The XMPP server does not support in-band registration"] -#define AVAILABLE_STRING [OTRLanguageManager translatedString: @"Available"] -#define CREATE_NEW_ACCOUNT_STRING [OTRLanguageManager translatedString: @"Create New Account"] -#define errSSLPeerBadRecordMacString [OTRLanguageManager translatedString: @"Bad MAC"] -#define OPTIONAL_STRING [OTRLanguageManager translatedString: @"Optional"] -#define Plaintext_Only [OTRLanguageManager translatedString: @"Plaintext Only"] -#define errSSLCertNotYetValidString [OTRLanguageManager translatedString: @"Chain had a cert not yet valid"] -#define errSSLPeerUserCancelledString [OTRLanguageManager translatedString: @"User canceled"] -#define DELIVERED_STRING [OTRLanguageManager translatedString: @"Delivered"] -#define ABOUT_STRING [OTRLanguageManager translatedString: @"About"] -#define REQUIRED_STRING [OTRLanguageManager translatedString: @"Required"] -#define INVALID_EMAIL_DETAIL_STRING [OTRLanguageManager translatedString: @"Please choose a valid email address"] -#define INVITE_LINK_STRING [OTRLanguageManager translatedString: @"Share Invite"] -#define YOUR_FINGERPRINT_STRING [OTRLanguageManager translatedString: @"Fingerprint for you"] -#define COMPOSE_STRING [OTRLanguageManager translatedString: @"Compose"] -#define UNTRUSTED_DEVICE_SENT_STRING [OTRLanguageManager translatedString: @"This message was sent to an untrusted device."] -#define FORGOT_PASSPHRASE_STRING [OTRLanguageManager translatedString: @"Forgot Passphrase?"] -#define NEXT_STRING [OTRLanguageManager translatedString: @"Next"] -#define DUPLICATE_ACCOUNT_STRING [OTRLanguageManager translatedString: @"Duplicate account"] -#define Enable_String [OTRLanguageManager translatedString: @"Enable"] -#define SCAN_QR_STRING [OTRLanguageManager translatedString: @"Scan QR"] -#define BASIC_STRING [OTRLanguageManager translatedString: @"Basic"] -#define LANGUAGE_STRING [OTRLanguageManager translatedString: @"Language"] -#define errSSLUnknownRootCertString [OTRLanguageManager translatedString: @"Valid cert chain, untrusted root"] -#define SET_NEW_DATABASE_PASSPHRASE_STRING [OTRLanguageManager translatedString: @"Set new database passphrase"] -#define AVAILABLE_MESSAGE_STRING [OTRLanguageManager translatedString: @"is now available"] -#define OTRL_MSGEVENT_RCVDMSG_MALFORMED_STRING [OTRLanguageManager translatedString: @"The message received contains malformed data."] -#define DATABASE_PASSPHRASE_CHANGE_ERROR_STRING [OTRLanguageManager translatedString: @"An error occurred while changing the database passphrase."] -#define BLOCK_AND_REMOVE_STRING [OTRLanguageManager translatedString: @"Block & Remove"] -#define CREATING_ACCOUNT_STRING [OTRLanguageManager translatedString: @"Creating Account"] -#define DATABASE_SETUP_ERROR_STRING [OTRLanguageManager translatedString: @"An error occurred while setting up the database."] -#define XMPP_PORT_FAIL_STRING [OTRLanguageManager translatedString: @"Domain needs to be set manually when specifying a custom port"] -#define SOMEONE_STRING [OTRLanguageManager translatedString: @"Someone"] -#define DISCONNECTION_WARNING_TITLE_STRING [OTRLanguageManager translatedString: @"Sign out Warning"] -#define BUDDY_LIST_STRING [OTRLanguageManager translatedString: @"Buddy List"] -#define errSSLPeerCertRevokedString [OTRLanguageManager translatedString: @"Certificate revoked"] -#define VERIFY_LATER_STRING [OTRLanguageManager translatedString: @"Verify Later"] -#define LOGGING_IN_STRING [OTRLanguageManager translatedString: @"Logging in..."] -#define OTRL_MSGEVENT_RCVDMSG_UNRECOGNIZED_STRING [OTRLanguageManager translatedString: @"Cannot recognize the type of OTR message received."] -#define SSL_MISMATCH_STRING [OTRLanguageManager translatedString: @"SSL Hostname Mismatch"] -#define RELEASE_TO_SEND_STRING [OTRLanguageManager translatedString: @"Release to send"] -#define errSSLXCertChainInvalidString [OTRLanguageManager translatedString: @"Invalid certificate chain"] -#define EMAIL_STRING [OTRLanguageManager translatedString: @"Email"] -#define XMPP_USERNAME_EXAMPLE_STRING [OTRLanguageManager translatedString: @"user@example.com"] -#define OPEN_IN_CHROME [OTRLanguageManager translatedString: @"Open in Chrome"] -#define SECURE_CONVERSATION_STRING [OTRLanguageManager translatedString: @"You must be in a secure conversation first."] -#define SHOW_USERVOICE_STRING [OTRLanguageManager translatedString: @"Would you like to connect to UserVoice to send feedback?"] -#define CURRENT_PASSPHRASE_STRING [OTRLanguageManager translatedString: @"Current Passphrase"] -#define SELF_SIGNED_SSL_STRING [OTRLanguageManager translatedString: @"Self Signed SSL"] -#define ABOUT_VERSION_STRING [OTRLanguageManager translatedString: @"About This Version"] -#define USE_CAMERA_STRING [OTRLanguageManager translatedString: @"Take Photo"] -#define BUDDY_FINGERPRINTS_STRING [OTRLanguageManager translatedString: @"Buddy Fingerprints"] -#define PINNED_CERTIFICATES_DESCRIPTION_STRING [OTRLanguageManager translatedString: @"Manage saved SSL certificates"] -#define Customize_Username [OTRLanguageManager translatedString: @"Customize Username"] -#define REMOVE_STRING [OTRLanguageManager translatedString: @"Remove"] -#define DEFAULT_LANGUAGE_STRING NSLocalizedString(@"Default", @"default string to revert to normal language behaviour") \ No newline at end of file +@import Foundation; +NS_ASSUME_NONNULL_BEGIN +/** "We could not find any trusted devices for this contact.", Error message for not finding any devices */ +FOUNDATION_EXPORT NSString* NO_DEVICES_BUDDY_ERROR_STRING(); +/** "Server", server selection section title */ +FOUNDATION_EXPORT NSString* Server_String(); +/** "Underlying cryptographic error", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLCryptoString(); +/** "Offline", Label in buddy list for users that are offline */ +FOUNDATION_EXPORT NSString* OFFLINE_STRING(); +/** "Error", Title of error message pop-up box */ +FOUNDATION_EXPORT NSString* ERROR_STRING(); +/** "Log Out", log out from account */ +FOUNDATION_EXPORT NSString* LOGOUT_STRING(); +/** "Auto-delete", Title for automatic conversation deletion setting */ +FOUNDATION_EXPORT NSString* DELETE_CONVERSATIONS_ON_DISCONNECT_TITLE_STRING(); +/** "Done", Title for button to press when user is finished */ +FOUNDATION_EXPORT NSString* DONE_STRING(); +/** "No Error", SSL error message */ +FOUNDATION_EXPORT NSString* noErrString(); +/** "Basic Setup", username section */ +FOUNDATION_EXPORT NSString* Basic_Setup(); +/** "ChatSecure Push", Title for ChatSecure Push (this probably doesnt need to be translated) */ +FOUNDATION_EXPORT NSString* CHATSECURE_PUSH_STRING(); +/** "The conversation with %@ is no longer secure.", Warn user that the current chat is no longer secure */ +FOUNDATION_EXPORT NSString* CONVERSATION_NO_LONGER_SECURE_STRING(); +/** "You must enter a username and a password to login.", error message shown when user doesn't fill in a username or password */ +FOUNDATION_EXPORT NSString* USER_PASS_BLANK_STRING(); +/** "Purported fingerprint for", the alleged fingerprint of their other person */ +FOUNDATION_EXPORT NSString* THEIR_FINGERPRINT_STRING(); +/** "Peer cert is valid, or was ignored if verification disabled", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerAuthCompletedString(); +/** "Password", Label text for password field on login screen */ +FOUNDATION_EXPORT NSString* PASSWORD_STRING(); +/** "Advanced", String to describe advanced set of settings */ +FOUNDATION_EXPORT NSString* ADVANCED_STRING(); +/** "Could not decrypt database. If the app is not working properly, you may need to delete and reinstall.", */ +FOUNDATION_EXPORT NSString* Could_Not_Decrypt_Database(); +/** "Profile", title for contacts profile view */ +FOUNDATION_EXPORT NSString* Profile_String(); +/** "Unrecognized Invite Format", shown when invite QR code doesnt work */ +FOUNDATION_EXPORT NSString* Unrecognized_Invite_Format(); +/** "Resend", Label for button to resend message. */ +FOUNDATION_EXPORT NSString* RESEND_STRING(); +/** "Our policy requires encryption but we are trying to send an unencrypted message out.", Error string for OTR message string */ +FOUNDATION_EXPORT NSString* OTRL_MSGEVENT_ENCRYPTION_REQUIRED_STRING(); +/** "Version", when displaying version numbers such as 1.0.0 */ +FOUNDATION_EXPORT NSString* VERSION_STRING(); +/** "Enter a group name", The placeholder text for the text field to enter a group chat name or label */ +FOUNDATION_EXPORT NSString* ENTER_GROUP_NAME_STRING(); +/** "Account Disconnected", Error title when account is disconnected */ +FOUNDATION_EXPORT NSString* ACCOUNT_DISCONNECTED_STRING(); +/** "Initiate Encrypted Chat", Shown when starting an encrypted chat session */ +FOUNDATION_EXPORT NSString* INITIATE_ENCRYPTED_CHAT_STRING(); +/** "Invalid Email", title label for invalid email */ +FOUNDATION_EXPORT NSString* INVALID_EMAIL_TITLE_STRING(); +/** "Sending", Label text for when a transfer is in progress (normally followed by a percent value 34%) */ +FOUNDATION_EXPORT NSString* SENDING_STRING(); +/** "Crash Detected", */ +FOUNDATION_EXPORT NSString* Crash_Detected_Title(); +/** "Resend Message", Ttitle for alert view to resend a message */ +FOUNDATION_EXPORT NSString* RESEND_MESSAGE_TITLE(); +/** "Send plaintext message", The placeholder text in the chat view where the message should go */ +FOUNDATION_EXPORT NSString* SEND_PLAINTEXT_STRING(); +/** "Message has not been sent because our buddy has ended the private conversation. We should either close the connection, or refresh it.", Error string for OTR message string */ +FOUNDATION_EXPORT NSString* OTRL_MSGEVENT_CONNECTION_ENDED_STRING(); +/** "Please log into this account before managing requests.", Error description when account is disconnected while managing requests */ +FOUNDATION_EXPORT NSString* ACCOUNT_DISCONNECTED_DESCRIPTION_STRING(); +/** "Received and discarded a message intended for another instance.", Error string for OTR message string */ +FOUNDATION_EXPORT NSString* OTRL_MSGEVENT_RCVDMSG_FOR_OTHER_INSTANCE_STRING(); +/** "Resending this message will use %@.", Describe what resending will do the %@ will be replaced withe the method OTR/OMEMO/Plaintext */ +FOUNDATION_EXPORT NSString* RESEND_DESCRIPTION_STRING(); +/** "Open in Twitter", Label for button to open link in twitter app */ +FOUNDATION_EXPORT NSString* OPEN_IN_TWITTER_STRING(); +/** "Twitter", Name of the popular social tweeting site */ +FOUNDATION_EXPORT NSString* TWITTER_STRING(); +/** "Microphone Disabled", microphone permission is disabled */ +FOUNDATION_EXPORT NSString* Microphone_Disabled(); +/** "Connected", Whether or not account is logged in */ +FOUNDATION_EXPORT NSString* CONNECTED_STRING(); +/** "Tor is an experimental feature, please use with caution.", Message for warning about using tor network */ +FOUNDATION_EXPORT NSString* TOR_WARNING_MESSAGE_STRING(); +/** "My QR Code", Your QR code */ +FOUNDATION_EXPORT NSString* MY_QR_CODE(); +/** "Choose from our list of trusted servers, or use your own.", server selection footer */ +FOUNDATION_EXPORT NSString* Server_String_Hint(); +/** "Extended Away", Default message when a user status is set to extended away */ +FOUNDATION_EXPORT NSString* EXTENDED_AWAY_STRING(); +/** "Received our own OTR messages.", Error string for OTR message string */ +FOUNDATION_EXPORT NSString* OTRL_MSGEVENT_MSG_REFLECTED_STRING(); +/** "Server closed session with no notification", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLClosedNoNotifyString(); +/** "Could not retrieve public key from certificate", Error message when cannot get public key from SSL certificate */ +FOUNDATION_EXPORT NSString* PUBLIC_KEY_ERROR_STRING(); +/** "Received an encrypted message but cannot read it because no private connection is established yet.", Error string for OTR message string */ +FOUNDATION_EXPORT NSString* OTRL_MSGEVENT_RCVDMSG_NOT_IN_PRIVATE_STRING(); +/** "New SSL Certificate", Title for alert when a new SSL certificate is encountered */ +FOUNDATION_EXPORT NSString* NEW_CERTIFICATE_STRING(); +/** "Log In", log in to account */ +FOUNDATION_EXPORT NSString* LOGIN_STRING(); +/** "Cancel", Cancel an alert window */ +FOUNDATION_EXPORT NSString* CANCEL_STRING(); +/** "Database Error", */ +FOUNDATION_EXPORT NSString* Database_Error_String(); +/** "Login Automatically", Label for account setting that autologins on launch */ +FOUNDATION_EXPORT NSString* LOGIN_AUTOMATICALLY_STRING(); +/** "Untrusted Device", Title for error message */ +FOUNDATION_EXPORT NSString* UNTRUSTED_DEVICE_STRING(); +/** "Decoding error", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerDecodeErrorString(); +/** "Your current iOS system version (%@) contains a serious security vulnerability. Please update to the latest version as soon as possible.", Alert to system issues, leave in the %@ */ +FOUNDATION_EXPORT NSString* iOS_SSL_ERROR_PART1_STRING(); +/** "Record overflow", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLRecordOverflowString(); +/** "Decryption failure", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLDecryptionFailString(); +/** "Add", Button title to add someone as a buddy */ +FOUNDATION_EXPORT NSString* ADD_STRING(); +/** "GitHub", Name of popular web based hosting service */ +FOUNDATION_EXPORT NSString* GITHUB_STRING(); +/** "You're ready to use", String used when onboarding works */ +FOUNDATION_EXPORT NSString* ONBOARDING_SUCCESS_STRING(); +/** "Removed By Server", */ +FOUNDATION_EXPORT NSString* Removed_By_Server(); +/** "Open in Facebook", Label for button to open link in facebook app */ +FOUNDATION_EXPORT NSString* OPEN_IN_FACEBOOK_STRING(); +/** "Show Advanced Encryption Settings", */ +FOUNDATION_EXPORT NSString* Show_Advanced_Encryption_Settings(); +/** "Peer host name mismatch", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLHostNameMismatchString(); +/** "This chat is secured", Warns user that the current chat is secure */ +FOUNDATION_EXPORT NSString* CONVERSATION_SECURE_WARNING_STRING(); +/** "Pinned Certificates", Button Lable to show all pinned SSL certificates */ +FOUNDATION_EXPORT NSString* PINNED_CERTIFICATES_STRING(); +/** "Permanently delete", Ask user if they want to delete the stored account information */ +FOUNDATION_EXPORT NSString* DELETE_ACCOUNT_MESSAGE_STRING(); +/** "Received a general OTR error.", Error string for OTR message string */ +FOUNDATION_EXPORT NSString* OTRL_MSGEVENT_RCVDMSG_GENERAL_ERR_STRING(); +/** "Created by", Start of sentence that will be followed by names */ +FOUNDATION_EXPORT NSString* CREATED_BY_STRING(); +/** "The conversation is not secure", Title to let user know that encryption is not currently enabled */ +FOUNDATION_EXPORT NSString* UNLOCKED_ALERT_STRING(); +/** "Save", Title for button for saving a setting */ +FOUNDATION_EXPORT NSString* SAVE_STRING(); +/** "Cert chain not verified by root", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLNoRootCertString(); +/** "Accounts", Title for the accounts tab */ +FOUNDATION_EXPORT NSString* ACCOUNTS_STRING(); +/** "Pending Approval", String for XMPP buddies when adding buddy is pending */ +FOUNDATION_EXPORT NSString* PENDING_APPROVAL_STRING(); +/** "Decryption failed", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerDecryptionFailString(); +/** "Jabber (XMPP)", the name for jabber, also include (XMPP) at the end */ +FOUNDATION_EXPORT NSString* JABBER_STRING(); +/** "Verify", Shown when verifying fingerprints */ +FOUNDATION_EXPORT NSString* VERIFY_STRING(); +/** "Chain had an expired cert", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLCertExpiredString(); +/** "Configuration error", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLBadConfigurationString(); +/** "Add Buddy", The title for the view to add a buddy */ +FOUNDATION_EXPORT NSString* ADD_BUDDY_STRING(); +/** "Server has requested a client cert", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLClientCertRequestedString(); +/** "XMPP + Tor", Title for xmpp accounts that connect through the Tor network */ +FOUNDATION_EXPORT NSString* XMPP_TOR_STRING(); +/** "Error Registering Username", Error message when registration fails */ +FOUNDATION_EXPORT NSString* REGISTER_ERROR_STRING(); +/** "Cannot read the received message.", Error string for OTR message string */ +FOUNDATION_EXPORT NSString* OTRL_MSGEVENT_RCVDMSG_UNREADABLE_STRING(); +/** "Bad protocol version", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerProtocolVersionString(); +/** "Only one Tor account per domain is supported at this time.", Message shown when using more than one Tor account with the same domain */ +FOUNDATION_EXPORT NSString* TOR_DOMAIN_WARNING_MESSAGE_STRING(); +/** "Change Passphrase", Title for button to change encrypted database passphrase */ +FOUNDATION_EXPORT NSString* CHANGE_PASSPHRASE_STRING(); +/** "Recent", Title for header of Buddy list view with Recent Buddies */ +FOUNDATION_EXPORT NSString* RECENT_STRING(); +/** "Insufficient buffer provided", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLBufferOverflowString(); +/** "Copy", Copy string to clipboard as in copy and paste */ +FOUNDATION_EXPORT NSString* COPY_STRING(); +/** "Incoming", Label for incoming data transfers */ +FOUNDATION_EXPORT NSString* INCOMING_STRING(); +/** "Connecting", String to state if an account is progress of creating a connection */ +FOUNDATION_EXPORT NSString* CONNECTING_STRING(); +/** "The fingerprint has not been verified", Title to let user know that the OTR fingerprint has not been checked */ +FOUNDATION_EXPORT NSString* LOCKED_WARN_STRING(); +/** "Unlock", Label for button to unlock app */ +FOUNDATION_EXPORT NSString* UNLOCK_STRING(); +/** "Don't change these unless you really know what you're doing. By default we will always select the best available encryption method.", */ +FOUNDATION_EXPORT NSString* Advanced_Crypto_Warning(); +/** "Your donation will help fund the continued development of ChatSecure.", Message shown when about to donate */ +FOUNDATION_EXPORT NSString* DONATE_MESSAGE_STRING(); +/** "Donate", Title for donation link */ +FOUNDATION_EXPORT NSString* DONATE_STRING(); +/** "Reject", Button title to reject a request such as a buddy request */ +FOUNDATION_EXPORT NSString* REJECT_STRING(); +/** "Illegal parameter", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLIllegalParamString(); +/** "Create", Title for button to create account */ +FOUNDATION_EXPORT NSString* CREATE_STRING(); +/** "Resource", Label for text input for XMPP resource */ +FOUNDATION_EXPORT NSString* RESOURCE_STRING(); +/** "The app crashed last time it was launched. Send a crash report?", */ +FOUNDATION_EXPORT NSString* Crash_Detected_Message(); +/** "Access denied", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerAccessDeniedString(); +/** "Internal error", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerInternalErrorString(); +/** "An error occured while encrypting a message and the message was not sent.", Error string for OTR message string */ +FOUNDATION_EXPORT NSString* OTRL_MSGEVENT_ENCRYPTION_ERROR_STRING(); +/** "Release to delete", Label for instruction to delete current recording */ +FOUNDATION_EXPORT NSString* RELEASE_TO_DELETE_STRING(); +/** "Photo Library", Label for button to open up photo library and choose photo */ +FOUNDATION_EXPORT NSString* PHOTO_LIBRARY_STRING(); +/** "Verify Fingerprint", Title of the dialog for fingerprint verification */ +FOUNDATION_EXPORT NSString* VERIFY_FINGERPRINT_STRING(); +/** "Saved Certificates", Title for listing the user saved SSL certificates */ +FOUNDATION_EXPORT NSString* SAVED_CERTIFICATES_STRING(); +/** "New Account", Title for New Account View */ +FOUNDATION_EXPORT NSString* NEW_ACCOUNT_STRING(); +/** "Domain needs to be set", Error message when domain textfield left blank */ +FOUNDATION_EXPORT NSString* DOMAIN_BLANK_ERROR_STRING(); +/** "The conversation is secure and the fingerprint is verfied", Title to let user know that the OTR fingerprint has not been checked */ +FOUNDATION_EXPORT NSString* LOCKED_SECURE_STRING(); +/** "QR code", Label for qr code image */ +FOUNDATION_EXPORT NSString* QR_CODE_STRING(); +/** "is now away", Message shown in line for users that are away */ +FOUNDATION_EXPORT NSString* AWAY_MESSAGE_STRING(); +/** "Facebook account removed", Title for alert about removing facebook */ +FOUNDATION_EXPORT NSString* FACEBOOK_REMOVED_STRING(); +/** "Away", Label in buddy list for users that are away */ +FOUNDATION_EXPORT NSString* AWAY_STRING(); +/** "Hostname", Label text for hostname field on login scree */ +FOUNDATION_EXPORT NSString* HOSTNAME_STRING(); +/** "Insufficient security", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerInsufficientSecurityString(); +/** "iOS Vulnerability", Directions to the system software update */ +FOUNDATION_EXPORT NSString* iOS_SSL_ERROR_TITLE_STRING(); +/** "Custom", Place holder label for custom domains */ +FOUNDATION_EXPORT NSString* CUSTOM_STRING(); +/** "Hold to talk", Label for button to hold to record audio */ +FOUNDATION_EXPORT NSString* HOLD_TO_TALK_STRING(); +/** "Skip", Label for button to skip this step */ +FOUNDATION_EXPORT NSString* SKIP_STRING(); +/** "Search", Label for text field where you search for a buddy */ +FOUNDATION_EXPORT NSString* SEARCH_STRING(); +/** "OSCAR Instant Messenger", the name for AIM */ +FOUNDATION_EXPORT NSString* AIM_STRING(); +/** "1 Minute Alert Before Disconnection", Description for disconnection warning setting */ +FOUNDATION_EXPORT NSString* DISCONNECTION_WARNING_DESC_STRING(); +/** "The previous message was resent.", Error string for OTR message string */ +FOUNDATION_EXPORT NSString* OTRL_MSGEVENT_MSG_RESENT_STRING(); +/** "Connect", String for button to connect connect */ +FOUNDATION_EXPORT NSString* CONNECT_STRING(); +/** "This device doesn't seem to be configured to make payments.", Error message when trying to make a purchase but payments haven't been set up yet */ +FOUNDATION_EXPORT NSString* PAYMENTS_SETUP_ERROR_STRING(); +/** "wants to chat.", This string follows a user's dislplay name or username ex Bob wants to chat. */ +FOUNDATION_EXPORT NSString* WANTS_TO_CHAT_STRING(); +/** "Record overflow", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerRecordOverflowString(); +/** "Knock Sent", Text for label after knock is sent. Like knocking on a door */ +FOUNDATION_EXPORT NSString* KNOCK_SENT_STRING(); +/** "Security", Title heading in settings */ +FOUNDATION_EXPORT NSString* SECURITY_STRING(); +/** "Plaintext (Opportunistic OTR)", */ +FOUNDATION_EXPORT NSString* Plaintext_Opportunistic_OTR(); +/** "Unable to Send Message", Title for error message */ +FOUNDATION_EXPORT NSString* UNABLE_TO_SEND_STRING(); +/** "Unknown certificate", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerCertUnknownString(); +/** "Error Creating Account", title label for error when creating account */ +FOUNDATION_EXPORT NSString* ERROR_CREATING_ACCOUNT_STRING(); +/** "OTR Fingerprints", Lable for button to show saved fingerprints */ +FOUNDATION_EXPORT NSString* OTR_FINGERPRINTS_STRING(); +/** "Certificate expired", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerCertExpiredString(); +/** "Send %@ encrypted message", The placeholder text in the chat view where the message should go */ +FOUNDATION_EXPORT NSString* SEND_ENCRYPTED_STRING(); +/** "A private conversation could not be set up.", Error string for OTR message string */ +FOUNDATION_EXPORT NSString* OTRL_MSGEVENT_SETUP_ERROR_STRING(); +/** "Unknown Error", Describes an error without a known cause */ +FOUNDATION_EXPORT NSString* UNKNOWN_ERROR_STRING(); +/** "Cipher Suite negotiation failure", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLNegotiationString(); +/** "Export restriction", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerExportRestrictionString(); +/** "Handshake failure", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerHandshakeFailString(); +/** "Google Talk", the name for Google talk */ +FOUNDATION_EXPORT NSString* GOOGLE_TALK_STRING(); +/** "Manage OTR fingerprints", Subtitle lable for button to show saved fingerprints */ +FOUNDATION_EXPORT NSString* OTR_FINGERPRINTS_SUBTITLE_STRING(); +/** "Fatal alert", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLFatalAlertString(); +/** "Settings -> General -> Software Update", Directions to the system software update */ +FOUNDATION_EXPORT NSString* iOS_SSL_ERROR_PART2_STRING(); +/** "Username", Label text for username field on login screen */ +FOUNDATION_EXPORT NSString* USERNAME_STRING(); +/** "Advanced Encryption Settings", */ +FOUNDATION_EXPORT NSString* Advanced_Encryption_Settings(); +/** "Module attach failure", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLModuleAttachString(); +/** "Your password will be stored in the iOS Keychain of this device only, and is only as safe as your device passphrase or pin. However, it will not persist during a device backup/restore via iTunes, so please don't forget it, or you may lose your conversation history.", Text that describes what remembering your passphrase does */ +FOUNDATION_EXPORT NSString* REMEMBER_PASSPHRASE_INFO_STRING(); +/** "Waiting", Label text for when a transfer has not started yet */ +FOUNDATION_EXPORT NSString* WAITING_STRING(); +/** "Group Name", The title for the view to enter a group chat name or label */ +FOUNDATION_EXPORT NSString* GROUP_NAME_STRING(); +/** "Share", Title for sharing a link to the app */ +FOUNDATION_EXPORT NSString* SHARE_STRING(); +/** "Think of a unique nickname that you don't use anywhere else and doesn't contain personal information.", basic setup selection footer */ +FOUNDATION_EXPORT NSString* Basic_Setup_Hint(); +/** "Auto-start Encryption", string for title yes/no setting for allowing opportunistic otr */ +FOUNDATION_EXPORT NSString* OPPORTUNISTIC_OTR_SETTING_TITLE(); +/** "Send Feedback", String on button to email feedback */ +FOUNDATION_EXPORT NSString* SEND_FEEDBACK_STRING(); +/** "Name", The string describing a buddy's display name */ +FOUNDATION_EXPORT NSString* NAME_STRING(); +/** "Block", The String for a button to block a buddy */ +FOUNDATION_EXPORT NSString* BLOCK_STRING(); +/** "Account Fingerprints", Title for showing the users account otr fingerprints */ +FOUNDATION_EXPORT NSString* ACCOUNT_FINGERPRINTS_STRING(); +/** "OK", Accept the dialog */ +FOUNDATION_EXPORT NSString* OK_STRING(); +/** "Enables opportunistic OTR", string for decription yes/no setting for allowing opportunistic otr */ +FOUNDATION_EXPORT NSString* OPPORTUNISTIC_OTR_SETTING_DESCRIPTION(); +/** "Unexpected (skipped) record in DTLS", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLUnexpectedRecordString(); +/** "View Profile", The label for a button to view the buddy profile */ +FOUNDATION_EXPORT NSString* VIEW_PROFILE_STRING(); +/** "Port", Label for port number field for connecting to service */ +FOUNDATION_EXPORT NSString* PORT_STRING(); +/** "Connection closed via error", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLClosedAbortString(); +/** "Subscription Requests", Title of view where you can mange buddy or subscription requests */ +FOUNDATION_EXPORT NSString* SUBSCRIPTION_REQUEST_TITLE(); +/** "Nickname", for choosing your XMPP vCard display name */ +FOUNDATION_EXPORT NSString* Nickname_String(); +/** "This message was received from an untrusted device.", Error message description */ +FOUNDATION_EXPORT NSString* UNTRUSTED_DEVICE_REVEIVED_STRING(); +/** "Delete Account?", Ask user if they want to delete the stored account information */ +FOUNDATION_EXPORT NSString* DELETE_ACCOUNT_TITLE_STRING(); +/** "Decompression failure", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerDecompressFailString(); +/** "Bad unsupported cert format", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerUnsupportedCertString(); +/** "Received an unencrypted message.", Error string for OTR message string */ +FOUNDATION_EXPORT NSString* OTRL_MSGEVENT_RCVDMSG_UNENCRYPTED_STRING(); +/** "Unknown Cert Authority", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerUnknownCAString(); +/** "Bad SSLCipherSuite", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLBadCipherSuiteString(); +/** "is now offline", Message shown in line for users that are offline */ +FOUNDATION_EXPORT NSString* OFFLINE_MESSAGE_STRING(); +/** "Bad MAC", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLBadRecordMacString(); +/** "Failed to connect to XMPP server. Please check your login credentials and internet connection and try again.", Message when cannot connect to XMPP server */ +FOUNDATION_EXPORT NSString* XMPP_FAIL_STRING(); +/** "No renegotiation allowed", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerNoRenegotiationString(); +/** "plaintext", Label for messages that are not encrypted */ +FOUNDATION_EXPORT NSString* UNENCRYPTED_STRING(); +/** "Background session will expire in one minute.", Message displayed in Notification Manager when session will expire in one minute */ +FOUNDATION_EXPORT NSString* EXPIRATION_STRING(); +/** "Enable Tor", */ +FOUNDATION_EXPORT NSString* Enable_Tor_String(); +/** "Show Advanced Options", toggle switch for show advanced */ +FOUNDATION_EXPORT NSString* Show_Advanced_Options(); +/** "Me", */ +FOUNDATION_EXPORT NSString* Me_String(); +/** "Internal error", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLInternalString(); +/** "Enable Push", button for enabling push messages */ +FOUNDATION_EXPORT NSString* ENABLE_PUSH_STRING(); +/** "You are not connected", Text explaining that the account is not currently connected */ +FOUNDATION_EXPORT NSString* YOU_ARE_NOT_CONNECTED_STRING(); +/** "Facebook", the name for facebook */ +FOUNDATION_EXPORT NSString* FACEBOOK_STRING(); +/** "Push", Title for push-messaging related settings */ +FOUNDATION_EXPORT NSString* PUSH_TITLE_STRING(); +/** "There already exists an account with this username.", Error message when there is a duplicate account */ +FOUNDATION_EXPORT NSString* DUPLICATE_ACCOUNT_MESSAGE_STRING(); +/** "I/O would block (not fatal)", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLWouldBlockString(); +/** "Connecting to Tor", Message shown when connecting to the Tor network */ +FOUNDATION_EXPORT NSString* CONNECTING_TO_TOR_STRING(); +/** "Chat", Title for chat view */ +FOUNDATION_EXPORT NSString* CHAT_STRING(); +/** "Received a heartbeat.", Error string for OTR message string */ +FOUNDATION_EXPORT NSString* OTRL_MSGEVENT_LOG_HEARTBEAT_RCVD_STRING(); +/** "Facebook has remmoved acces to the chat API", Message for when facebook accounts removed */ +FOUNDATION_EXPORT NSString* FACEBOOK_REMOVED_MESSAGE_STRING(); +/** "Do Not Disturb", Default message when a user status is set to do not disturb */ +FOUNDATION_EXPORT NSString* DO_NOT_DISTURB_STRING(); +/** "SSL protocol error", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLProtocolString(); +/** "View profile to review contact's devices or change encryption settings.", Describe how to change a contact's device settings */ +FOUNDATION_EXPORT NSString* VIEW_PROFILE_DESCRIPTION_STRING(); +/** "Chat with me securely", Body of SMS or email when sharing a link to the app */ +FOUNDATION_EXPORT NSString* SHARE_MESSAGE_STRING(); +/** "Sent a heartbeat.", Error string for OTR message string */ +FOUNDATION_EXPORT NSString* OTRL_MSGEVENT_LOG_HEARTBEAT_SENT_STRING(); +/** "We could not find any trusted devices for this account.", Error message for not finding any devices */ +FOUNDATION_EXPORT NSString* NO_DEVICES_ACCOUNT_ERROR_STRING(); +/** "To use this feature you must re-enable microphone permissions.", microphone permission is disabled */ +FOUNDATION_EXPORT NSString* Microphone_Reenable_Please(); +/** "Connection closed gracefully", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLClosedGracefulString(); +/** "Valid certificate", shown to show that the certificate was valid to the system */ +FOUNDATION_EXPORT NSString* VALID_CERTIFICATE_STRING(); +/** "New", For a new settings value */ +FOUNDATION_EXPORT NSString* NEW_STRING(); +/** "Unexpected message received", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerUnexpectedMsgString(); +/** "Delete chats on disconnect", Description for automatic conversation deletion */ +FOUNDATION_EXPORT NSString* DELETE_CONVERSATIONS_ON_DISCONNECT_DESCRIPTION_STRING(); +/** "Invite SMS", Label for inviting friends via sms */ +FOUNDATION_EXPORT NSString* INVITE_SMS_STRING(); +/** "Chats", Title for chats view */ +FOUNDATION_EXPORT NSString* CHATS_STRING(); +/** "Help Translate", Label for button to open link to translate app */ +FOUNDATION_EXPORT NSString* HELP_TRANSLATE_STRING(); +/** "Not Verified", To let the user know the fingerprint as not been checked */ +FOUNDATION_EXPORT NSString* NOT_VERIFIED_STRING(); +/** "Decryption error", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerDecryptErrorString(); +/** "Choose Server", title for server selection screen */ +FOUNDATION_EXPORT NSString* Choose_Server_String(); +/** "Bad certificate format", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLBadCertString(); +/** "Peer dropped connection before responding", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLConnectionRefusedString(); +/** "Security Warning", Title of alert box warning about security issues */ +FOUNDATION_EXPORT NSString* SECURITY_WARNING_STRING(); +/** "Verified", To let the user know the fingerprint as been checked */ +FOUNDATION_EXPORT NSString* VERIFIED_STRING(); +/** "Buddy Info", The title for the view that shows detailed buddy info */ +FOUNDATION_EXPORT NSString* BUDDY_INFO_STRING(); +/** "New Passphrase", title label for the new passphrase */ +FOUNDATION_EXPORT NSString* NEW_PASSPHRASE_STRING(); +/** "Account", The string describing a buddy's account */ +FOUNDATION_EXPORT NSString* ACCOUNT_STRING(); +/** "Knock", Label for button after to send push notification knock. Like knocking on a door */ +FOUNDATION_EXPORT NSString* KNOCK_STRING(); +/** "This QR Code contains a link to http://omniqrcode.com/q/chatsecure and will redirect to the App Store.", Instructions label text underneath QR code */ +FOUNDATION_EXPORT NSString* QR_CODE_INSTRUCTIONS_STRING(); +/** "Remember password", label for switch for whether or not we should save their password between launches */ +FOUNDATION_EXPORT NSString* REMEMBER_PASSWORD_STRING(); +/** "Warning: This chat is not encrypted", Warn user that the current chat is not secure */ +FOUNDATION_EXPORT NSString* CONVERSATION_NOT_SECURE_WARNING_STRING(); +/** "Cancel Encrypted Chat", Shown when ending an encrypted chat session */ +FOUNDATION_EXPORT NSString* CANCEL_ENCRYPTED_CHAT_STRING(); +/** "We can automatically generate you a secure password. If you choose your own, make sure it's a unique password you don't use anywhere else.", help text for password generator */ +FOUNDATION_EXPORT NSString* Generate_Secure_Password_Hint(); +/** "Enable Push in Settings", button for enabling push messages in iOS system settings */ +FOUNDATION_EXPORT NSString* ENABLE_PUSH_IN_SETTINGS_STRING(); +/** "Best Available", */ +FOUNDATION_EXPORT NSString* Best_Available(); +/** "Settings", Title for the Settings screen */ +FOUNDATION_EXPORT NSString* SETTINGS_STRING(); +/** "Encryption Error", Generic title for encryption errors */ +FOUNDATION_EXPORT NSString* ENCRYPTION_ERROR_STRING(); +/** "The fingerprint has changed and needs to be verified", Title to let user know that the OTR fingerprint has not been checked */ +FOUNDATION_EXPORT NSString* LOCKED_ERROR_STRING(); +/** "Sign Up", title label for signing up for a new account */ +FOUNDATION_EXPORT NSString* SIGN_UP_STRING(); +/** "Remember Passphrase", Label for switch to save passphrase */ +FOUNDATION_EXPORT NSString* REMEMBER_PASSPHRASE_STRING(); +/** "Manage ChatSecure Push account", Title for button to manage ChatSecure Push account */ +FOUNDATION_EXPORT NSString* MANAGE_CHATSECURE_PUSH_ACCOUNT_STRING(); +/** "Miscellaneous bad certificate", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerBadCertString(); +/** "Add Existing Account", Label for button to create account by logging into an existing account */ +FOUNDATION_EXPORT NSString* ADD_EXISTING_STRING(); +/** "Generate Secure Password", whether or not we should generate a strong password for them */ +FOUNDATION_EXPORT NSString* Generate_Secure_Password(); +/** "Old", For an old settings value */ +FOUNDATION_EXPORT NSString* OLD_STRING(); +/** "Because the database contents is encrypted with your passphrase, you've lost access to your data and will need to delete and reinstall ChatSecure to continue. Password managers like 1Password or MiniKeePass can be helpful for generating and storing strong passwords.", Text describing what happens when the user has forgotten the passphrase */ +FOUNDATION_EXPORT NSString* FORGOT_PASSPHRASE_INFO_STRING(); +/** "Check out the source here on Github", let users know source is on Github */ +FOUNDATION_EXPORT NSString* SOURCE_STRING(); +/** "The database passphrase change was successful.", shown when changing database passphrase succeeds */ +FOUNDATION_EXPORT NSString* DATABASE_PASSPHRASE_CHANGE_SUCCESS_STRING(); +/** "Attempt to restore an unknown session", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLSessionNotFoundString(); +/** "Info", Short for information, button title to get more information */ +FOUNDATION_EXPORT NSString* INFO_STRING(); +/** "Other", Title for other miscellaneous settings group */ +FOUNDATION_EXPORT NSString* OTHER_STRING(); +/** "Reply", Reply to an incoming message */ +FOUNDATION_EXPORT NSString* REPLY_STRING(); +/** "The XMPP server does not support in-band registration", Error message for when in band registration is not supported */ +FOUNDATION_EXPORT NSString* IN_BAND_ERROR_STRING(); +/** "Available", Label in buddy list for users that are available */ +FOUNDATION_EXPORT NSString* AVAILABLE_STRING(); +/** "Create New Account", Label for button to create a new account via in band registration */ +FOUNDATION_EXPORT NSString* CREATE_NEW_ACCOUNT_STRING(); +/** "Bad MAC", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerBadRecordMacString(); +/** "Optional", Hint text for domain field telling user this field is not required */ +FOUNDATION_EXPORT NSString* OPTIONAL_STRING(); +/** "Plaintext Only", */ +FOUNDATION_EXPORT NSString* Plaintext_Only(); +/** "Chain had a cert not yet valid", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLCertNotYetValidString(); +/** "User canceled", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerUserCancelledString(); +/** "Delivered", Shows in the chat view when a message has been delivered */ +FOUNDATION_EXPORT NSString* DELIVERED_STRING(); +/** "About", Title for the about page */ +FOUNDATION_EXPORT NSString* ABOUT_STRING(); +/** "Required", String to let user know a certain field like a password is required to create an account */ +FOUNDATION_EXPORT NSString* REQUIRED_STRING(); +/** "Please choose a valid email address", detail title label for invalid email */ +FOUNDATION_EXPORT NSString* INVALID_EMAIL_DETAIL_STRING(); +/** "Share Invite", Label for inviting friends via URL */ +FOUNDATION_EXPORT NSString* INVITE_LINK_STRING(); +/** "Fingerprint for you", your fingerprint */ +FOUNDATION_EXPORT NSString* YOUR_FINGERPRINT_STRING(); +/** "Compose", Label for text field where you compose a new message */ +FOUNDATION_EXPORT NSString* COMPOSE_STRING(); +/** "This message was sent to an untrusted device.", Error message description */ +FOUNDATION_EXPORT NSString* UNTRUSTED_DEVICE_SENT_STRING(); +/** "Forgot Passphrase?", Label for button when you've forgotten the passphrase */ +FOUNDATION_EXPORT NSString* FORGOT_PASSPHRASE_STRING(); +/** "Next", Label for button to go to next step */ +FOUNDATION_EXPORT NSString* NEXT_STRING(); +/** "Duplicate account", Error title when there is a duplicate account */ +FOUNDATION_EXPORT NSString* DUPLICATE_ACCOUNT_STRING(); +/** "Enable", enable permission */ +FOUNDATION_EXPORT NSString* Enable_String(); +/** "Scan QR", Label for sharing via QR Code */ +FOUNDATION_EXPORT NSString* SCAN_QR_STRING(); +/** "Basic", string to describe basic set of settings */ +FOUNDATION_EXPORT NSString* BASIC_STRING(); +/** "Language", string to bring up language selector */ +FOUNDATION_EXPORT NSString* LANGUAGE_STRING(); +/** "Valid cert chain, untrusted root", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLUnknownRootCertString(); +/** "Set new database passphrase", Detail label for button to change encrypted database passphrase */ +FOUNDATION_EXPORT NSString* SET_NEW_DATABASE_PASSPHRASE_STRING(); +/** "is now available", Message shown in line for users that are available */ +FOUNDATION_EXPORT NSString* AVAILABLE_MESSAGE_STRING(); +/** "The message received contains malformed data.", Error string for OTR message string */ +FOUNDATION_EXPORT NSString* OTRL_MSGEVENT_RCVDMSG_MALFORMED_STRING(); +/** "An error occurred while changing the database passphrase.", shown when changing database passphrase fails */ +FOUNDATION_EXPORT NSString* DATABASE_PASSPHRASE_CHANGE_ERROR_STRING(); +/** "Block & Remove", The String for a buddy to block and remove a buddy from the buddy list */ +FOUNDATION_EXPORT NSString* BLOCK_AND_REMOVE_STRING(); +/** "Creating Account", Title for progress of creating a new account */ +FOUNDATION_EXPORT NSString* CREATING_ACCOUNT_STRING(); +/** "An error occurred while setting up the database.", Error message when setting up database */ +FOUNDATION_EXPORT NSString* DATABASE_SETUP_ERROR_STRING(); +/** "Domain needs to be set manually when specifying a custom port", Message when port is changed but domain not set */ +FOUNDATION_EXPORT NSString* XMPP_PORT_FAIL_STRING(); +/** "Someone", A placeholder for a buddy's username like Someone wants to chat. */ +FOUNDATION_EXPORT NSString* SOMEONE_STRING(); +/** "Sign out Warning", Title for setting about showing a warning before disconnection */ +FOUNDATION_EXPORT NSString* DISCONNECTION_WARNING_TITLE_STRING(); +/** "Buddy List", Title for the buddy list tab */ +FOUNDATION_EXPORT NSString* BUDDY_LIST_STRING(); +/** "Certificate revoked", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLPeerCertRevokedString(); +/** "Verify Later", Shown when verifying fingerprints */ +FOUNDATION_EXPORT NSString* VERIFY_LATER_STRING(); +/** "Logging in...", shown during the login process */ +FOUNDATION_EXPORT NSString* LOGGING_IN_STRING(); +/** "Cannot recognize the type of OTR message received.", Error string for OTR message string */ +FOUNDATION_EXPORT NSString* OTRL_MSGEVENT_RCVDMSG_UNRECOGNIZED_STRING(); +/** "SSL Hostname Mismatch", string for settings to allow SSL mismatch */ +FOUNDATION_EXPORT NSString* SSL_MISMATCH_STRING(); +/** "Release to send", Label for instruction to send current audio */ +FOUNDATION_EXPORT NSString* RELEASE_TO_SEND_STRING(); +/** "Invalid certificate chain", SSL error message */ +FOUNDATION_EXPORT NSString* errSSLXCertChainInvalidString(); +/** "Email", The string describing account name or email address for a buddy */ +FOUNDATION_EXPORT NSString* EMAIL_STRING(); +/** "user@example.com", Example of a username using the words user and example */ +FOUNDATION_EXPORT NSString* XMPP_USERNAME_EXAMPLE_STRING(); +/** "Open in Chrome", Label to open link in the chrome web browser */ +FOUNDATION_EXPORT NSString* OPEN_IN_CHROME(); +/** "You must be in a secure conversation first.", Inform user that they must be secure their conversation before doing that action */ +FOUNDATION_EXPORT NSString* SECURE_CONVERSATION_STRING(); +/** "Would you like to connect to UserVoice to send feedback?", actionsheet for showing uservoice feedback service */ +FOUNDATION_EXPORT NSString* SHOW_USERVOICE_STRING(); +/** "Current Passphrase", title label for the existing passphrase */ +FOUNDATION_EXPORT NSString* CURRENT_PASSPHRASE_STRING(); +/** "Self Signed SSL", string for settings to allow self signed SSL string */ +FOUNDATION_EXPORT NSString* SELF_SIGNED_SSL_STRING(); +/** "About This Version", Label for button to show version numbers and licenses */ +FOUNDATION_EXPORT NSString* ABOUT_VERSION_STRING(); +/** "Take Photo", Label for button to take a photo from camera */ +FOUNDATION_EXPORT NSString* USE_CAMERA_STRING(); +/** "Buddy Fingerprints", Title for showing the users buddies otr fingerprints */ +FOUNDATION_EXPORT NSString* BUDDY_FINGERPRINTS_STRING(); +/** "Manage saved SSL certificates", subtitle for the certificate pinned setting */ +FOUNDATION_EXPORT NSString* PINNED_CERTIFICATES_DESCRIPTION_STRING(); +/** "Customize Username", if you want to change your username */ +FOUNDATION_EXPORT NSString* Customize_Username(); +/** "Remove", The String for a button to remove a buddy from the buddy list */ +FOUNDATION_EXPORT NSString* REMOVE_STRING(); +/** "Default", default string to revert to normal language behaviour */ +FOUNDATION_EXPORT NSString* DEFAULT_LANGUAGE_STRING(); +NS_ASSUME_NONNULL_END diff --git a/OTRAssets/Strings/OTRStrings.m b/OTRAssets/Strings/OTRStrings.m new file mode 100644 index 000000000..198e93e2e --- /dev/null +++ b/OTRAssets/Strings/OTRStrings.m @@ -0,0 +1,609 @@ +// DO NOT EDIT THIS FILE. EDIT strings.json then run python StringsConverter.py + +#import "OTRStrings.h" +#import "OTRLanguageManager_Private.h" +/** "We could not find any trusted devices for this contact.", Error message for not finding any devices */ +NSString* NO_DEVICES_BUDDY_ERROR_STRING() { return [OTRLanguageManager translatedString:@"We could not find any trusted devices for this contact."]; } +/** "Server", server selection section title */ +NSString* Server_String() { return [OTRLanguageManager translatedString:@"Server"]; } +/** "Underlying cryptographic error", SSL error message */ +NSString* errSSLCryptoString() { return [OTRLanguageManager translatedString:@"Underlying cryptographic error"]; } +/** "Offline", Label in buddy list for users that are offline */ +NSString* OFFLINE_STRING() { return [OTRLanguageManager translatedString:@"Offline"]; } +/** "Error", Title of error message pop-up box */ +NSString* ERROR_STRING() { return [OTRLanguageManager translatedString:@"Error"]; } +/** "Log Out", log out from account */ +NSString* LOGOUT_STRING() { return [OTRLanguageManager translatedString:@"Log Out"]; } +/** "Auto-delete", Title for automatic conversation deletion setting */ +NSString* DELETE_CONVERSATIONS_ON_DISCONNECT_TITLE_STRING() { return [OTRLanguageManager translatedString:@"Auto-delete"]; } +/** "Done", Title for button to press when user is finished */ +NSString* DONE_STRING() { return [OTRLanguageManager translatedString:@"Done"]; } +/** "No Error", SSL error message */ +NSString* noErrString() { return [OTRLanguageManager translatedString:@"No Error"]; } +/** "Basic Setup", username section */ +NSString* Basic_Setup() { return [OTRLanguageManager translatedString:@"Basic Setup"]; } +/** "ChatSecure Push", Title for ChatSecure Push (this probably doesnt need to be translated) */ +NSString* CHATSECURE_PUSH_STRING() { return [OTRLanguageManager translatedString:@"ChatSecure Push"]; } +/** "The conversation with %@ is no longer secure.", Warn user that the current chat is no longer secure */ +NSString* CONVERSATION_NO_LONGER_SECURE_STRING() { return [OTRLanguageManager translatedString:@"The conversation with %@ is no longer secure."]; } +/** "You must enter a username and a password to login.", error message shown when user doesn't fill in a username or password */ +NSString* USER_PASS_BLANK_STRING() { return [OTRLanguageManager translatedString:@"You must enter a username and a password to login."]; } +/** "Purported fingerprint for", the alleged fingerprint of their other person */ +NSString* THEIR_FINGERPRINT_STRING() { return [OTRLanguageManager translatedString:@"Purported fingerprint for"]; } +/** "Peer cert is valid, or was ignored if verification disabled", SSL error message */ +NSString* errSSLPeerAuthCompletedString() { return [OTRLanguageManager translatedString:@"Peer cert is valid, or was ignored if verification disabled"]; } +/** "Password", Label text for password field on login screen */ +NSString* PASSWORD_STRING() { return [OTRLanguageManager translatedString:@"Password"]; } +/** "Advanced", String to describe advanced set of settings */ +NSString* ADVANCED_STRING() { return [OTRLanguageManager translatedString:@"Advanced"]; } +/** "Could not decrypt database. If the app is not working properly, you may need to delete and reinstall.", */ +NSString* Could_Not_Decrypt_Database() { return [OTRLanguageManager translatedString:@"Could not decrypt database. If the app is not working properly, you may need to delete and reinstall."]; } +/** "Profile", title for contacts profile view */ +NSString* Profile_String() { return [OTRLanguageManager translatedString:@"Profile"]; } +/** "Unrecognized Invite Format", shown when invite QR code doesnt work */ +NSString* Unrecognized_Invite_Format() { return [OTRLanguageManager translatedString:@"Unrecognized Invite Format"]; } +/** "Resend", Label for button to resend message. */ +NSString* RESEND_STRING() { return [OTRLanguageManager translatedString:@"Resend"]; } +/** "Our policy requires encryption but we are trying to send an unencrypted message out.", Error string for OTR message string */ +NSString* OTRL_MSGEVENT_ENCRYPTION_REQUIRED_STRING() { return [OTRLanguageManager translatedString:@"Our policy requires encryption but we are trying to send an unencrypted message out."]; } +/** "Version", when displaying version numbers such as 1.0.0 */ +NSString* VERSION_STRING() { return [OTRLanguageManager translatedString:@"Version"]; } +/** "Enter a group name", The placeholder text for the text field to enter a group chat name or label */ +NSString* ENTER_GROUP_NAME_STRING() { return [OTRLanguageManager translatedString:@"Enter a group name"]; } +/** "Account Disconnected", Error title when account is disconnected */ +NSString* ACCOUNT_DISCONNECTED_STRING() { return [OTRLanguageManager translatedString:@"Account Disconnected"]; } +/** "Initiate Encrypted Chat", Shown when starting an encrypted chat session */ +NSString* INITIATE_ENCRYPTED_CHAT_STRING() { return [OTRLanguageManager translatedString:@"Initiate Encrypted Chat"]; } +/** "Invalid Email", title label for invalid email */ +NSString* INVALID_EMAIL_TITLE_STRING() { return [OTRLanguageManager translatedString:@"Invalid Email"]; } +/** "Sending", Label text for when a transfer is in progress (normally followed by a percent value 34%) */ +NSString* SENDING_STRING() { return [OTRLanguageManager translatedString:@"Sending"]; } +/** "Crash Detected", */ +NSString* Crash_Detected_Title() { return [OTRLanguageManager translatedString:@"Crash Detected"]; } +/** "Resend Message", Ttitle for alert view to resend a message */ +NSString* RESEND_MESSAGE_TITLE() { return [OTRLanguageManager translatedString:@"Resend Message"]; } +/** "Send plaintext message", The placeholder text in the chat view where the message should go */ +NSString* SEND_PLAINTEXT_STRING() { return [OTRLanguageManager translatedString:@"Send plaintext message"]; } +/** "Message has not been sent because our buddy has ended the private conversation. We should either close the connection, or refresh it.", Error string for OTR message string */ +NSString* OTRL_MSGEVENT_CONNECTION_ENDED_STRING() { return [OTRLanguageManager translatedString:@"Message has not been sent because our buddy has ended the private conversation. We should either close the connection, or refresh it."]; } +/** "Please log into this account before managing requests.", Error description when account is disconnected while managing requests */ +NSString* ACCOUNT_DISCONNECTED_DESCRIPTION_STRING() { return [OTRLanguageManager translatedString:@"Please log into this account before managing requests."]; } +/** "Received and discarded a message intended for another instance.", Error string for OTR message string */ +NSString* OTRL_MSGEVENT_RCVDMSG_FOR_OTHER_INSTANCE_STRING() { return [OTRLanguageManager translatedString:@"Received and discarded a message intended for another instance."]; } +/** "Resending this message will use %@.", Describe what resending will do the %@ will be replaced withe the method OTR/OMEMO/Plaintext */ +NSString* RESEND_DESCRIPTION_STRING() { return [OTRLanguageManager translatedString:@"Resending this message will use %@."]; } +/** "Open in Twitter", Label for button to open link in twitter app */ +NSString* OPEN_IN_TWITTER_STRING() { return [OTRLanguageManager translatedString:@"Open in Twitter"]; } +/** "Twitter", Name of the popular social tweeting site */ +NSString* TWITTER_STRING() { return [OTRLanguageManager translatedString:@"Twitter"]; } +/** "Microphone Disabled", microphone permission is disabled */ +NSString* Microphone_Disabled() { return [OTRLanguageManager translatedString:@"Microphone Disabled"]; } +/** "Connected", Whether or not account is logged in */ +NSString* CONNECTED_STRING() { return [OTRLanguageManager translatedString:@"Connected"]; } +/** "Tor is an experimental feature, please use with caution.", Message for warning about using tor network */ +NSString* TOR_WARNING_MESSAGE_STRING() { return [OTRLanguageManager translatedString:@"Tor is an experimental feature, please use with caution."]; } +/** "My QR Code", Your QR code */ +NSString* MY_QR_CODE() { return [OTRLanguageManager translatedString:@"My QR Code"]; } +/** "Choose from our list of trusted servers, or use your own.", server selection footer */ +NSString* Server_String_Hint() { return [OTRLanguageManager translatedString:@"Choose from our list of trusted servers, or use your own."]; } +/** "Extended Away", Default message when a user status is set to extended away */ +NSString* EXTENDED_AWAY_STRING() { return [OTRLanguageManager translatedString:@"Extended Away"]; } +/** "Received our own OTR messages.", Error string for OTR message string */ +NSString* OTRL_MSGEVENT_MSG_REFLECTED_STRING() { return [OTRLanguageManager translatedString:@"Received our own OTR messages."]; } +/** "Server closed session with no notification", SSL error message */ +NSString* errSSLClosedNoNotifyString() { return [OTRLanguageManager translatedString:@"Server closed session with no notification"]; } +/** "Could not retrieve public key from certificate", Error message when cannot get public key from SSL certificate */ +NSString* PUBLIC_KEY_ERROR_STRING() { return [OTRLanguageManager translatedString:@"Could not retrieve public key from certificate"]; } +/** "Received an encrypted message but cannot read it because no private connection is established yet.", Error string for OTR message string */ +NSString* OTRL_MSGEVENT_RCVDMSG_NOT_IN_PRIVATE_STRING() { return [OTRLanguageManager translatedString:@"Received an encrypted message but cannot read it because no private connection is established yet."]; } +/** "New SSL Certificate", Title for alert when a new SSL certificate is encountered */ +NSString* NEW_CERTIFICATE_STRING() { return [OTRLanguageManager translatedString:@"New SSL Certificate"]; } +/** "Log In", log in to account */ +NSString* LOGIN_STRING() { return [OTRLanguageManager translatedString:@"Log In"]; } +/** "Cancel", Cancel an alert window */ +NSString* CANCEL_STRING() { return [OTRLanguageManager translatedString:@"Cancel"]; } +/** "Database Error", */ +NSString* Database_Error_String() { return [OTRLanguageManager translatedString:@"Database Error"]; } +/** "Login Automatically", Label for account setting that autologins on launch */ +NSString* LOGIN_AUTOMATICALLY_STRING() { return [OTRLanguageManager translatedString:@"Login Automatically"]; } +/** "Untrusted Device", Title for error message */ +NSString* UNTRUSTED_DEVICE_STRING() { return [OTRLanguageManager translatedString:@"Untrusted Device"]; } +/** "Decoding error", SSL error message */ +NSString* errSSLPeerDecodeErrorString() { return [OTRLanguageManager translatedString:@"Decoding error"]; } +/** "Your current iOS system version (%@) contains a serious security vulnerability. Please update to the latest version as soon as possible.", Alert to system issues, leave in the %@ */ +NSString* iOS_SSL_ERROR_PART1_STRING() { return [OTRLanguageManager translatedString:@"Your current iOS system version (%@) contains a serious security vulnerability. Please update to the latest version as soon as possible."]; } +/** "Record overflow", SSL error message */ +NSString* errSSLRecordOverflowString() { return [OTRLanguageManager translatedString:@"Record overflow"]; } +/** "Decryption failure", SSL error message */ +NSString* errSSLDecryptionFailString() { return [OTRLanguageManager translatedString:@"Decryption failure"]; } +/** "Add", Button title to add someone as a buddy */ +NSString* ADD_STRING() { return [OTRLanguageManager translatedString:@"Add"]; } +/** "GitHub", Name of popular web based hosting service */ +NSString* GITHUB_STRING() { return [OTRLanguageManager translatedString:@"GitHub"]; } +/** "You're ready to use", String used when onboarding works */ +NSString* ONBOARDING_SUCCESS_STRING() { return [OTRLanguageManager translatedString:@"You're ready to use"]; } +/** "Removed By Server", */ +NSString* Removed_By_Server() { return [OTRLanguageManager translatedString:@"Removed By Server"]; } +/** "Open in Facebook", Label for button to open link in facebook app */ +NSString* OPEN_IN_FACEBOOK_STRING() { return [OTRLanguageManager translatedString:@"Open in Facebook"]; } +/** "Show Advanced Encryption Settings", */ +NSString* Show_Advanced_Encryption_Settings() { return [OTRLanguageManager translatedString:@"Show Advanced Encryption Settings"]; } +/** "Peer host name mismatch", SSL error message */ +NSString* errSSLHostNameMismatchString() { return [OTRLanguageManager translatedString:@"Peer host name mismatch"]; } +/** "This chat is secured", Warns user that the current chat is secure */ +NSString* CONVERSATION_SECURE_WARNING_STRING() { return [OTRLanguageManager translatedString:@"This chat is secured"]; } +/** "Pinned Certificates", Button Lable to show all pinned SSL certificates */ +NSString* PINNED_CERTIFICATES_STRING() { return [OTRLanguageManager translatedString:@"Pinned Certificates"]; } +/** "Permanently delete", Ask user if they want to delete the stored account information */ +NSString* DELETE_ACCOUNT_MESSAGE_STRING() { return [OTRLanguageManager translatedString:@"Permanently delete"]; } +/** "Received a general OTR error.", Error string for OTR message string */ +NSString* OTRL_MSGEVENT_RCVDMSG_GENERAL_ERR_STRING() { return [OTRLanguageManager translatedString:@"Received a general OTR error."]; } +/** "Created by", Start of sentence that will be followed by names */ +NSString* CREATED_BY_STRING() { return [OTRLanguageManager translatedString:@"Created by"]; } +/** "The conversation is not secure", Title to let user know that encryption is not currently enabled */ +NSString* UNLOCKED_ALERT_STRING() { return [OTRLanguageManager translatedString:@"The conversation is not secure"]; } +/** "Save", Title for button for saving a setting */ +NSString* SAVE_STRING() { return [OTRLanguageManager translatedString:@"Save"]; } +/** "Cert chain not verified by root", SSL error message */ +NSString* errSSLNoRootCertString() { return [OTRLanguageManager translatedString:@"Cert chain not verified by root"]; } +/** "Accounts", Title for the accounts tab */ +NSString* ACCOUNTS_STRING() { return [OTRLanguageManager translatedString:@"Accounts"]; } +/** "Pending Approval", String for XMPP buddies when adding buddy is pending */ +NSString* PENDING_APPROVAL_STRING() { return [OTRLanguageManager translatedString:@"Pending Approval"]; } +/** "Decryption failed", SSL error message */ +NSString* errSSLPeerDecryptionFailString() { return [OTRLanguageManager translatedString:@"Decryption failed"]; } +/** "Jabber (XMPP)", the name for jabber, also include (XMPP) at the end */ +NSString* JABBER_STRING() { return [OTRLanguageManager translatedString:@"Jabber (XMPP)"]; } +/** "Verify", Shown when verifying fingerprints */ +NSString* VERIFY_STRING() { return [OTRLanguageManager translatedString:@"Verify"]; } +/** "Chain had an expired cert", SSL error message */ +NSString* errSSLCertExpiredString() { return [OTRLanguageManager translatedString:@"Chain had an expired cert"]; } +/** "Configuration error", SSL error message */ +NSString* errSSLBadConfigurationString() { return [OTRLanguageManager translatedString:@"Configuration error"]; } +/** "Add Buddy", The title for the view to add a buddy */ +NSString* ADD_BUDDY_STRING() { return [OTRLanguageManager translatedString:@"Add Buddy"]; } +/** "Server has requested a client cert", SSL error message */ +NSString* errSSLClientCertRequestedString() { return [OTRLanguageManager translatedString:@"Server has requested a client cert"]; } +/** "XMPP + Tor", Title for xmpp accounts that connect through the Tor network */ +NSString* XMPP_TOR_STRING() { return [OTRLanguageManager translatedString:@"XMPP + Tor"]; } +/** "Error Registering Username", Error message when registration fails */ +NSString* REGISTER_ERROR_STRING() { return [OTRLanguageManager translatedString:@"Error Registering Username"]; } +/** "Cannot read the received message.", Error string for OTR message string */ +NSString* OTRL_MSGEVENT_RCVDMSG_UNREADABLE_STRING() { return [OTRLanguageManager translatedString:@"Cannot read the received message."]; } +/** "Bad protocol version", SSL error message */ +NSString* errSSLPeerProtocolVersionString() { return [OTRLanguageManager translatedString:@"Bad protocol version"]; } +/** "Only one Tor account per domain is supported at this time.", Message shown when using more than one Tor account with the same domain */ +NSString* TOR_DOMAIN_WARNING_MESSAGE_STRING() { return [OTRLanguageManager translatedString:@"Only one Tor account per domain is supported at this time."]; } +/** "Change Passphrase", Title for button to change encrypted database passphrase */ +NSString* CHANGE_PASSPHRASE_STRING() { return [OTRLanguageManager translatedString:@"Change Passphrase"]; } +/** "Recent", Title for header of Buddy list view with Recent Buddies */ +NSString* RECENT_STRING() { return [OTRLanguageManager translatedString:@"Recent"]; } +/** "Insufficient buffer provided", SSL error message */ +NSString* errSSLBufferOverflowString() { return [OTRLanguageManager translatedString:@"Insufficient buffer provided"]; } +/** "Copy", Copy string to clipboard as in copy and paste */ +NSString* COPY_STRING() { return [OTRLanguageManager translatedString:@"Copy"]; } +/** "Incoming", Label for incoming data transfers */ +NSString* INCOMING_STRING() { return [OTRLanguageManager translatedString:@"Incoming"]; } +/** "Connecting", String to state if an account is progress of creating a connection */ +NSString* CONNECTING_STRING() { return [OTRLanguageManager translatedString:@"Connecting"]; } +/** "The fingerprint has not been verified", Title to let user know that the OTR fingerprint has not been checked */ +NSString* LOCKED_WARN_STRING() { return [OTRLanguageManager translatedString:@"The fingerprint has not been verified"]; } +/** "Unlock", Label for button to unlock app */ +NSString* UNLOCK_STRING() { return [OTRLanguageManager translatedString:@"Unlock"]; } +/** "Don't change these unless you really know what you're doing. By default we will always select the best available encryption method.", */ +NSString* Advanced_Crypto_Warning() { return [OTRLanguageManager translatedString:@"Don't change these unless you really know what you're doing. By default we will always select the best available encryption method."]; } +/** "Your donation will help fund the continued development of ChatSecure.", Message shown when about to donate */ +NSString* DONATE_MESSAGE_STRING() { return [OTRLanguageManager translatedString:@"Your donation will help fund the continued development of ChatSecure."]; } +/** "Donate", Title for donation link */ +NSString* DONATE_STRING() { return [OTRLanguageManager translatedString:@"Donate"]; } +/** "Reject", Button title to reject a request such as a buddy request */ +NSString* REJECT_STRING() { return [OTRLanguageManager translatedString:@"Reject"]; } +/** "Illegal parameter", SSL error message */ +NSString* errSSLIllegalParamString() { return [OTRLanguageManager translatedString:@"Illegal parameter"]; } +/** "Create", Title for button to create account */ +NSString* CREATE_STRING() { return [OTRLanguageManager translatedString:@"Create"]; } +/** "Resource", Label for text input for XMPP resource */ +NSString* RESOURCE_STRING() { return [OTRLanguageManager translatedString:@"Resource"]; } +/** "The app crashed last time it was launched. Send a crash report?", */ +NSString* Crash_Detected_Message() { return [OTRLanguageManager translatedString:@"The app crashed last time it was launched. Send a crash report?"]; } +/** "Access denied", SSL error message */ +NSString* errSSLPeerAccessDeniedString() { return [OTRLanguageManager translatedString:@"Access denied"]; } +/** "Internal error", SSL error message */ +NSString* errSSLPeerInternalErrorString() { return [OTRLanguageManager translatedString:@"Internal error"]; } +/** "An error occured while encrypting a message and the message was not sent.", Error string for OTR message string */ +NSString* OTRL_MSGEVENT_ENCRYPTION_ERROR_STRING() { return [OTRLanguageManager translatedString:@"An error occured while encrypting a message and the message was not sent."]; } +/** "Release to delete", Label for instruction to delete current recording */ +NSString* RELEASE_TO_DELETE_STRING() { return [OTRLanguageManager translatedString:@"Release to delete"]; } +/** "Photo Library", Label for button to open up photo library and choose photo */ +NSString* PHOTO_LIBRARY_STRING() { return [OTRLanguageManager translatedString:@"Photo Library"]; } +/** "Verify Fingerprint", Title of the dialog for fingerprint verification */ +NSString* VERIFY_FINGERPRINT_STRING() { return [OTRLanguageManager translatedString:@"Verify Fingerprint"]; } +/** "Saved Certificates", Title for listing the user saved SSL certificates */ +NSString* SAVED_CERTIFICATES_STRING() { return [OTRLanguageManager translatedString:@"Saved Certificates"]; } +/** "New Account", Title for New Account View */ +NSString* NEW_ACCOUNT_STRING() { return [OTRLanguageManager translatedString:@"New Account"]; } +/** "Domain needs to be set", Error message when domain textfield left blank */ +NSString* DOMAIN_BLANK_ERROR_STRING() { return [OTRLanguageManager translatedString:@"Domain needs to be set"]; } +/** "The conversation is secure and the fingerprint is verfied", Title to let user know that the OTR fingerprint has not been checked */ +NSString* LOCKED_SECURE_STRING() { return [OTRLanguageManager translatedString:@"The conversation is secure and the fingerprint is verfied"]; } +/** "QR code", Label for qr code image */ +NSString* QR_CODE_STRING() { return [OTRLanguageManager translatedString:@"QR code"]; } +/** "is now away", Message shown in line for users that are away */ +NSString* AWAY_MESSAGE_STRING() { return [OTRLanguageManager translatedString:@"is now away"]; } +/** "Facebook account removed", Title for alert about removing facebook */ +NSString* FACEBOOK_REMOVED_STRING() { return [OTRLanguageManager translatedString:@"Facebook account removed"]; } +/** "Away", Label in buddy list for users that are away */ +NSString* AWAY_STRING() { return [OTRLanguageManager translatedString:@"Away"]; } +/** "Hostname", Label text for hostname field on login scree */ +NSString* HOSTNAME_STRING() { return [OTRLanguageManager translatedString:@"Hostname"]; } +/** "Insufficient security", SSL error message */ +NSString* errSSLPeerInsufficientSecurityString() { return [OTRLanguageManager translatedString:@"Insufficient security"]; } +/** "iOS Vulnerability", Directions to the system software update */ +NSString* iOS_SSL_ERROR_TITLE_STRING() { return [OTRLanguageManager translatedString:@"iOS Vulnerability"]; } +/** "Custom", Place holder label for custom domains */ +NSString* CUSTOM_STRING() { return [OTRLanguageManager translatedString:@"Custom"]; } +/** "Hold to talk", Label for button to hold to record audio */ +NSString* HOLD_TO_TALK_STRING() { return [OTRLanguageManager translatedString:@"Hold to talk"]; } +/** "Skip", Label for button to skip this step */ +NSString* SKIP_STRING() { return [OTRLanguageManager translatedString:@"Skip"]; } +/** "Search", Label for text field where you search for a buddy */ +NSString* SEARCH_STRING() { return [OTRLanguageManager translatedString:@"Search"]; } +/** "OSCAR Instant Messenger", the name for AIM */ +NSString* AIM_STRING() { return [OTRLanguageManager translatedString:@"OSCAR Instant Messenger"]; } +/** "1 Minute Alert Before Disconnection", Description for disconnection warning setting */ +NSString* DISCONNECTION_WARNING_DESC_STRING() { return [OTRLanguageManager translatedString:@"1 Minute Alert Before Disconnection"]; } +/** "The previous message was resent.", Error string for OTR message string */ +NSString* OTRL_MSGEVENT_MSG_RESENT_STRING() { return [OTRLanguageManager translatedString:@"The previous message was resent."]; } +/** "Connect", String for button to connect connect */ +NSString* CONNECT_STRING() { return [OTRLanguageManager translatedString:@"Connect"]; } +/** "This device doesn't seem to be configured to make payments.", Error message when trying to make a purchase but payments haven't been set up yet */ +NSString* PAYMENTS_SETUP_ERROR_STRING() { return [OTRLanguageManager translatedString:@"This device doesn't seem to be configured to make payments."]; } +/** "wants to chat.", This string follows a user's dislplay name or username ex Bob wants to chat. */ +NSString* WANTS_TO_CHAT_STRING() { return [OTRLanguageManager translatedString:@"wants to chat."]; } +/** "Record overflow", SSL error message */ +NSString* errSSLPeerRecordOverflowString() { return [OTRLanguageManager translatedString:@"Record overflow"]; } +/** "Knock Sent", Text for label after knock is sent. Like knocking on a door */ +NSString* KNOCK_SENT_STRING() { return [OTRLanguageManager translatedString:@"Knock Sent"]; } +/** "Security", Title heading in settings */ +NSString* SECURITY_STRING() { return [OTRLanguageManager translatedString:@"Security"]; } +/** "Plaintext (Opportunistic OTR)", */ +NSString* Plaintext_Opportunistic_OTR() { return [OTRLanguageManager translatedString:@"Plaintext (Opportunistic OTR)"]; } +/** "Unable to Send Message", Title for error message */ +NSString* UNABLE_TO_SEND_STRING() { return [OTRLanguageManager translatedString:@"Unable to Send Message"]; } +/** "Unknown certificate", SSL error message */ +NSString* errSSLPeerCertUnknownString() { return [OTRLanguageManager translatedString:@"Unknown certificate"]; } +/** "Error Creating Account", title label for error when creating account */ +NSString* ERROR_CREATING_ACCOUNT_STRING() { return [OTRLanguageManager translatedString:@"Error Creating Account"]; } +/** "OTR Fingerprints", Lable for button to show saved fingerprints */ +NSString* OTR_FINGERPRINTS_STRING() { return [OTRLanguageManager translatedString:@"OTR Fingerprints"]; } +/** "Certificate expired", SSL error message */ +NSString* errSSLPeerCertExpiredString() { return [OTRLanguageManager translatedString:@"Certificate expired"]; } +/** "Send %@ encrypted message", The placeholder text in the chat view where the message should go */ +NSString* SEND_ENCRYPTED_STRING() { return [OTRLanguageManager translatedString:@"Send %@ encrypted message"]; } +/** "A private conversation could not be set up.", Error string for OTR message string */ +NSString* OTRL_MSGEVENT_SETUP_ERROR_STRING() { return [OTRLanguageManager translatedString:@"A private conversation could not be set up."]; } +/** "Unknown Error", Describes an error without a known cause */ +NSString* UNKNOWN_ERROR_STRING() { return [OTRLanguageManager translatedString:@"Unknown Error"]; } +/** "Cipher Suite negotiation failure", SSL error message */ +NSString* errSSLNegotiationString() { return [OTRLanguageManager translatedString:@"Cipher Suite negotiation failure"]; } +/** "Export restriction", SSL error message */ +NSString* errSSLPeerExportRestrictionString() { return [OTRLanguageManager translatedString:@"Export restriction"]; } +/** "Handshake failure", SSL error message */ +NSString* errSSLPeerHandshakeFailString() { return [OTRLanguageManager translatedString:@"Handshake failure"]; } +/** "Google Talk", the name for Google talk */ +NSString* GOOGLE_TALK_STRING() { return [OTRLanguageManager translatedString:@"Google Talk"]; } +/** "Manage OTR fingerprints", Subtitle lable for button to show saved fingerprints */ +NSString* OTR_FINGERPRINTS_SUBTITLE_STRING() { return [OTRLanguageManager translatedString:@"Manage OTR fingerprints"]; } +/** "Fatal alert", SSL error message */ +NSString* errSSLFatalAlertString() { return [OTRLanguageManager translatedString:@"Fatal alert"]; } +/** "Settings -> General -> Software Update", Directions to the system software update */ +NSString* iOS_SSL_ERROR_PART2_STRING() { return [OTRLanguageManager translatedString:@"Settings -> General -> Software Update"]; } +/** "Username", Label text for username field on login screen */ +NSString* USERNAME_STRING() { return [OTRLanguageManager translatedString:@"Username"]; } +/** "Advanced Encryption Settings", */ +NSString* Advanced_Encryption_Settings() { return [OTRLanguageManager translatedString:@"Advanced Encryption Settings"]; } +/** "Module attach failure", SSL error message */ +NSString* errSSLModuleAttachString() { return [OTRLanguageManager translatedString:@"Module attach failure"]; } +/** "Your password will be stored in the iOS Keychain of this device only, and is only as safe as your device passphrase or pin. However, it will not persist during a device backup/restore via iTunes, so please don't forget it, or you may lose your conversation history.", Text that describes what remembering your passphrase does */ +NSString* REMEMBER_PASSPHRASE_INFO_STRING() { return [OTRLanguageManager translatedString:@"Your password will be stored in the iOS Keychain of this device only, and is only as safe as your device passphrase or pin. However, it will not persist during a device backup/restore via iTunes, so please don't forget it, or you may lose your conversation history."]; } +/** "Waiting", Label text for when a transfer has not started yet */ +NSString* WAITING_STRING() { return [OTRLanguageManager translatedString:@"Waiting"]; } +/** "Group Name", The title for the view to enter a group chat name or label */ +NSString* GROUP_NAME_STRING() { return [OTRLanguageManager translatedString:@"Group Name"]; } +/** "Share", Title for sharing a link to the app */ +NSString* SHARE_STRING() { return [OTRLanguageManager translatedString:@"Share"]; } +/** "Think of a unique nickname that you don't use anywhere else and doesn't contain personal information.", basic setup selection footer */ +NSString* Basic_Setup_Hint() { return [OTRLanguageManager translatedString:@"Think of a unique nickname that you don't use anywhere else and doesn't contain personal information."]; } +/** "Auto-start Encryption", string for title yes/no setting for allowing opportunistic otr */ +NSString* OPPORTUNISTIC_OTR_SETTING_TITLE() { return [OTRLanguageManager translatedString:@"Auto-start Encryption"]; } +/** "Send Feedback", String on button to email feedback */ +NSString* SEND_FEEDBACK_STRING() { return [OTRLanguageManager translatedString:@"Send Feedback"]; } +/** "Name", The string describing a buddy's display name */ +NSString* NAME_STRING() { return [OTRLanguageManager translatedString:@"Name"]; } +/** "Block", The String for a button to block a buddy */ +NSString* BLOCK_STRING() { return [OTRLanguageManager translatedString:@"Block"]; } +/** "Account Fingerprints", Title for showing the users account otr fingerprints */ +NSString* ACCOUNT_FINGERPRINTS_STRING() { return [OTRLanguageManager translatedString:@"Account Fingerprints"]; } +/** "OK", Accept the dialog */ +NSString* OK_STRING() { return [OTRLanguageManager translatedString:@"OK"]; } +/** "Enables opportunistic OTR", string for decription yes/no setting for allowing opportunistic otr */ +NSString* OPPORTUNISTIC_OTR_SETTING_DESCRIPTION() { return [OTRLanguageManager translatedString:@"Enables opportunistic OTR"]; } +/** "Unexpected (skipped) record in DTLS", SSL error message */ +NSString* errSSLUnexpectedRecordString() { return [OTRLanguageManager translatedString:@"Unexpected (skipped) record in DTLS"]; } +/** "View Profile", The label for a button to view the buddy profile */ +NSString* VIEW_PROFILE_STRING() { return [OTRLanguageManager translatedString:@"View Profile"]; } +/** "Port", Label for port number field for connecting to service */ +NSString* PORT_STRING() { return [OTRLanguageManager translatedString:@"Port"]; } +/** "Connection closed via error", SSL error message */ +NSString* errSSLClosedAbortString() { return [OTRLanguageManager translatedString:@"Connection closed via error"]; } +/** "Subscription Requests", Title of view where you can mange buddy or subscription requests */ +NSString* SUBSCRIPTION_REQUEST_TITLE() { return [OTRLanguageManager translatedString:@"Subscription Requests"]; } +/** "Nickname", for choosing your XMPP vCard display name */ +NSString* Nickname_String() { return [OTRLanguageManager translatedString:@"Nickname"]; } +/** "This message was received from an untrusted device.", Error message description */ +NSString* UNTRUSTED_DEVICE_REVEIVED_STRING() { return [OTRLanguageManager translatedString:@"This message was received from an untrusted device."]; } +/** "Delete Account?", Ask user if they want to delete the stored account information */ +NSString* DELETE_ACCOUNT_TITLE_STRING() { return [OTRLanguageManager translatedString:@"Delete Account?"]; } +/** "Decompression failure", SSL error message */ +NSString* errSSLPeerDecompressFailString() { return [OTRLanguageManager translatedString:@"Decompression failure"]; } +/** "Bad unsupported cert format", SSL error message */ +NSString* errSSLPeerUnsupportedCertString() { return [OTRLanguageManager translatedString:@"Bad unsupported cert format"]; } +/** "Received an unencrypted message.", Error string for OTR message string */ +NSString* OTRL_MSGEVENT_RCVDMSG_UNENCRYPTED_STRING() { return [OTRLanguageManager translatedString:@"Received an unencrypted message."]; } +/** "Unknown Cert Authority", SSL error message */ +NSString* errSSLPeerUnknownCAString() { return [OTRLanguageManager translatedString:@"Unknown Cert Authority"]; } +/** "Bad SSLCipherSuite", SSL error message */ +NSString* errSSLBadCipherSuiteString() { return [OTRLanguageManager translatedString:@"Bad SSLCipherSuite"]; } +/** "is now offline", Message shown in line for users that are offline */ +NSString* OFFLINE_MESSAGE_STRING() { return [OTRLanguageManager translatedString:@"is now offline"]; } +/** "Bad MAC", SSL error message */ +NSString* errSSLBadRecordMacString() { return [OTRLanguageManager translatedString:@"Bad MAC"]; } +/** "Failed to connect to XMPP server. Please check your login credentials and internet connection and try again.", Message when cannot connect to XMPP server */ +NSString* XMPP_FAIL_STRING() { return [OTRLanguageManager translatedString:@"Failed to connect to XMPP server. Please check your login credentials and internet connection and try again."]; } +/** "No renegotiation allowed", SSL error message */ +NSString* errSSLPeerNoRenegotiationString() { return [OTRLanguageManager translatedString:@"No renegotiation allowed"]; } +/** "plaintext", Label for messages that are not encrypted */ +NSString* UNENCRYPTED_STRING() { return [OTRLanguageManager translatedString:@"plaintext"]; } +/** "Background session will expire in one minute.", Message displayed in Notification Manager when session will expire in one minute */ +NSString* EXPIRATION_STRING() { return [OTRLanguageManager translatedString:@"Background session will expire in one minute."]; } +/** "Enable Tor", */ +NSString* Enable_Tor_String() { return [OTRLanguageManager translatedString:@"Enable Tor"]; } +/** "Show Advanced Options", toggle switch for show advanced */ +NSString* Show_Advanced_Options() { return [OTRLanguageManager translatedString:@"Show Advanced Options"]; } +/** "Me", */ +NSString* Me_String() { return [OTRLanguageManager translatedString:@"Me"]; } +/** "Internal error", SSL error message */ +NSString* errSSLInternalString() { return [OTRLanguageManager translatedString:@"Internal error"]; } +/** "Enable Push", button for enabling push messages */ +NSString* ENABLE_PUSH_STRING() { return [OTRLanguageManager translatedString:@"Enable Push"]; } +/** "You are not connected", Text explaining that the account is not currently connected */ +NSString* YOU_ARE_NOT_CONNECTED_STRING() { return [OTRLanguageManager translatedString:@"You are not connected"]; } +/** "Facebook", the name for facebook */ +NSString* FACEBOOK_STRING() { return [OTRLanguageManager translatedString:@"Facebook"]; } +/** "Push", Title for push-messaging related settings */ +NSString* PUSH_TITLE_STRING() { return [OTRLanguageManager translatedString:@"Push"]; } +/** "There already exists an account with this username.", Error message when there is a duplicate account */ +NSString* DUPLICATE_ACCOUNT_MESSAGE_STRING() { return [OTRLanguageManager translatedString:@"There already exists an account with this username."]; } +/** "I/O would block (not fatal)", SSL error message */ +NSString* errSSLWouldBlockString() { return [OTRLanguageManager translatedString:@"I/O would block (not fatal)"]; } +/** "Connecting to Tor", Message shown when connecting to the Tor network */ +NSString* CONNECTING_TO_TOR_STRING() { return [OTRLanguageManager translatedString:@"Connecting to Tor"]; } +/** "Chat", Title for chat view */ +NSString* CHAT_STRING() { return [OTRLanguageManager translatedString:@"Chat"]; } +/** "Received a heartbeat.", Error string for OTR message string */ +NSString* OTRL_MSGEVENT_LOG_HEARTBEAT_RCVD_STRING() { return [OTRLanguageManager translatedString:@"Received a heartbeat."]; } +/** "Facebook has remmoved acces to the chat API", Message for when facebook accounts removed */ +NSString* FACEBOOK_REMOVED_MESSAGE_STRING() { return [OTRLanguageManager translatedString:@"Facebook has remmoved acces to the chat API"]; } +/** "Do Not Disturb", Default message when a user status is set to do not disturb */ +NSString* DO_NOT_DISTURB_STRING() { return [OTRLanguageManager translatedString:@"Do Not Disturb"]; } +/** "SSL protocol error", SSL error message */ +NSString* errSSLProtocolString() { return [OTRLanguageManager translatedString:@"SSL protocol error"]; } +/** "View profile to review contact's devices or change encryption settings.", Describe how to change a contact's device settings */ +NSString* VIEW_PROFILE_DESCRIPTION_STRING() { return [OTRLanguageManager translatedString:@"View profile to review contact's devices or change encryption settings."]; } +/** "Chat with me securely", Body of SMS or email when sharing a link to the app */ +NSString* SHARE_MESSAGE_STRING() { return [OTRLanguageManager translatedString:@"Chat with me securely"]; } +/** "Sent a heartbeat.", Error string for OTR message string */ +NSString* OTRL_MSGEVENT_LOG_HEARTBEAT_SENT_STRING() { return [OTRLanguageManager translatedString:@"Sent a heartbeat."]; } +/** "We could not find any trusted devices for this account.", Error message for not finding any devices */ +NSString* NO_DEVICES_ACCOUNT_ERROR_STRING() { return [OTRLanguageManager translatedString:@"We could not find any trusted devices for this account."]; } +/** "To use this feature you must re-enable microphone permissions.", microphone permission is disabled */ +NSString* Microphone_Reenable_Please() { return [OTRLanguageManager translatedString:@"To use this feature you must re-enable microphone permissions."]; } +/** "Connection closed gracefully", SSL error message */ +NSString* errSSLClosedGracefulString() { return [OTRLanguageManager translatedString:@"Connection closed gracefully"]; } +/** "Valid certificate", shown to show that the certificate was valid to the system */ +NSString* VALID_CERTIFICATE_STRING() { return [OTRLanguageManager translatedString:@"Valid certificate"]; } +/** "New", For a new settings value */ +NSString* NEW_STRING() { return [OTRLanguageManager translatedString:@"New"]; } +/** "Unexpected message received", SSL error message */ +NSString* errSSLPeerUnexpectedMsgString() { return [OTRLanguageManager translatedString:@"Unexpected message received"]; } +/** "Delete chats on disconnect", Description for automatic conversation deletion */ +NSString* DELETE_CONVERSATIONS_ON_DISCONNECT_DESCRIPTION_STRING() { return [OTRLanguageManager translatedString:@"Delete chats on disconnect"]; } +/** "Invite SMS", Label for inviting friends via sms */ +NSString* INVITE_SMS_STRING() { return [OTRLanguageManager translatedString:@"Invite SMS"]; } +/** "Chats", Title for chats view */ +NSString* CHATS_STRING() { return [OTRLanguageManager translatedString:@"Chats"]; } +/** "Help Translate", Label for button to open link to translate app */ +NSString* HELP_TRANSLATE_STRING() { return [OTRLanguageManager translatedString:@"Help Translate"]; } +/** "Not Verified", To let the user know the fingerprint as not been checked */ +NSString* NOT_VERIFIED_STRING() { return [OTRLanguageManager translatedString:@"Not Verified"]; } +/** "Decryption error", SSL error message */ +NSString* errSSLPeerDecryptErrorString() { return [OTRLanguageManager translatedString:@"Decryption error"]; } +/** "Choose Server", title for server selection screen */ +NSString* Choose_Server_String() { return [OTRLanguageManager translatedString:@"Choose Server"]; } +/** "Bad certificate format", SSL error message */ +NSString* errSSLBadCertString() { return [OTRLanguageManager translatedString:@"Bad certificate format"]; } +/** "Peer dropped connection before responding", SSL error message */ +NSString* errSSLConnectionRefusedString() { return [OTRLanguageManager translatedString:@"Peer dropped connection before responding"]; } +/** "Security Warning", Title of alert box warning about security issues */ +NSString* SECURITY_WARNING_STRING() { return [OTRLanguageManager translatedString:@"Security Warning"]; } +/** "Verified", To let the user know the fingerprint as been checked */ +NSString* VERIFIED_STRING() { return [OTRLanguageManager translatedString:@"Verified"]; } +/** "Buddy Info", The title for the view that shows detailed buddy info */ +NSString* BUDDY_INFO_STRING() { return [OTRLanguageManager translatedString:@"Buddy Info"]; } +/** "New Passphrase", title label for the new passphrase */ +NSString* NEW_PASSPHRASE_STRING() { return [OTRLanguageManager translatedString:@"New Passphrase"]; } +/** "Account", The string describing a buddy's account */ +NSString* ACCOUNT_STRING() { return [OTRLanguageManager translatedString:@"Account"]; } +/** "Knock", Label for button after to send push notification knock. Like knocking on a door */ +NSString* KNOCK_STRING() { return [OTRLanguageManager translatedString:@"Knock"]; } +/** "This QR Code contains a link to http://omniqrcode.com/q/chatsecure and will redirect to the App Store.", Instructions label text underneath QR code */ +NSString* QR_CODE_INSTRUCTIONS_STRING() { return [OTRLanguageManager translatedString:@"This QR Code contains a link to http://omniqrcode.com/q/chatsecure and will redirect to the App Store."]; } +/** "Remember password", label for switch for whether or not we should save their password between launches */ +NSString* REMEMBER_PASSWORD_STRING() { return [OTRLanguageManager translatedString:@"Remember password"]; } +/** "Warning: This chat is not encrypted", Warn user that the current chat is not secure */ +NSString* CONVERSATION_NOT_SECURE_WARNING_STRING() { return [OTRLanguageManager translatedString:@"Warning: This chat is not encrypted"]; } +/** "Cancel Encrypted Chat", Shown when ending an encrypted chat session */ +NSString* CANCEL_ENCRYPTED_CHAT_STRING() { return [OTRLanguageManager translatedString:@"Cancel Encrypted Chat"]; } +/** "We can automatically generate you a secure password. If you choose your own, make sure it's a unique password you don't use anywhere else.", help text for password generator */ +NSString* Generate_Secure_Password_Hint() { return [OTRLanguageManager translatedString:@"We can automatically generate you a secure password. If you choose your own, make sure it's a unique password you don't use anywhere else."]; } +/** "Enable Push in Settings", button for enabling push messages in iOS system settings */ +NSString* ENABLE_PUSH_IN_SETTINGS_STRING() { return [OTRLanguageManager translatedString:@"Enable Push in Settings"]; } +/** "Best Available", */ +NSString* Best_Available() { return [OTRLanguageManager translatedString:@"Best Available"]; } +/** "Settings", Title for the Settings screen */ +NSString* SETTINGS_STRING() { return [OTRLanguageManager translatedString:@"Settings"]; } +/** "Encryption Error", Generic title for encryption errors */ +NSString* ENCRYPTION_ERROR_STRING() { return [OTRLanguageManager translatedString:@"Encryption Error"]; } +/** "The fingerprint has changed and needs to be verified", Title to let user know that the OTR fingerprint has not been checked */ +NSString* LOCKED_ERROR_STRING() { return [OTRLanguageManager translatedString:@"The fingerprint has changed and needs to be verified"]; } +/** "Sign Up", title label for signing up for a new account */ +NSString* SIGN_UP_STRING() { return [OTRLanguageManager translatedString:@"Sign Up"]; } +/** "Remember Passphrase", Label for switch to save passphrase */ +NSString* REMEMBER_PASSPHRASE_STRING() { return [OTRLanguageManager translatedString:@"Remember Passphrase"]; } +/** "Manage ChatSecure Push account", Title for button to manage ChatSecure Push account */ +NSString* MANAGE_CHATSECURE_PUSH_ACCOUNT_STRING() { return [OTRLanguageManager translatedString:@"Manage ChatSecure Push account"]; } +/** "Miscellaneous bad certificate", SSL error message */ +NSString* errSSLPeerBadCertString() { return [OTRLanguageManager translatedString:@"Miscellaneous bad certificate"]; } +/** "Add Existing Account", Label for button to create account by logging into an existing account */ +NSString* ADD_EXISTING_STRING() { return [OTRLanguageManager translatedString:@"Add Existing Account"]; } +/** "Generate Secure Password", whether or not we should generate a strong password for them */ +NSString* Generate_Secure_Password() { return [OTRLanguageManager translatedString:@"Generate Secure Password"]; } +/** "Old", For an old settings value */ +NSString* OLD_STRING() { return [OTRLanguageManager translatedString:@"Old"]; } +/** "Because the database contents is encrypted with your passphrase, you've lost access to your data and will need to delete and reinstall ChatSecure to continue. Password managers like 1Password or MiniKeePass can be helpful for generating and storing strong passwords.", Text describing what happens when the user has forgotten the passphrase */ +NSString* FORGOT_PASSPHRASE_INFO_STRING() { return [OTRLanguageManager translatedString:@"Because the database contents is encrypted with your passphrase, you've lost access to your data and will need to delete and reinstall ChatSecure to continue. Password managers like 1Password or MiniKeePass can be helpful for generating and storing strong passwords."]; } +/** "Check out the source here on Github", let users know source is on Github */ +NSString* SOURCE_STRING() { return [OTRLanguageManager translatedString:@"Check out the source here on Github"]; } +/** "The database passphrase change was successful.", shown when changing database passphrase succeeds */ +NSString* DATABASE_PASSPHRASE_CHANGE_SUCCESS_STRING() { return [OTRLanguageManager translatedString:@"The database passphrase change was successful."]; } +/** "Attempt to restore an unknown session", SSL error message */ +NSString* errSSLSessionNotFoundString() { return [OTRLanguageManager translatedString:@"Attempt to restore an unknown session"]; } +/** "Info", Short for information, button title to get more information */ +NSString* INFO_STRING() { return [OTRLanguageManager translatedString:@"Info"]; } +/** "Other", Title for other miscellaneous settings group */ +NSString* OTHER_STRING() { return [OTRLanguageManager translatedString:@"Other"]; } +/** "Reply", Reply to an incoming message */ +NSString* REPLY_STRING() { return [OTRLanguageManager translatedString:@"Reply"]; } +/** "The XMPP server does not support in-band registration", Error message for when in band registration is not supported */ +NSString* IN_BAND_ERROR_STRING() { return [OTRLanguageManager translatedString:@"The XMPP server does not support in-band registration"]; } +/** "Available", Label in buddy list for users that are available */ +NSString* AVAILABLE_STRING() { return [OTRLanguageManager translatedString:@"Available"]; } +/** "Create New Account", Label for button to create a new account via in band registration */ +NSString* CREATE_NEW_ACCOUNT_STRING() { return [OTRLanguageManager translatedString:@"Create New Account"]; } +/** "Bad MAC", SSL error message */ +NSString* errSSLPeerBadRecordMacString() { return [OTRLanguageManager translatedString:@"Bad MAC"]; } +/** "Optional", Hint text for domain field telling user this field is not required */ +NSString* OPTIONAL_STRING() { return [OTRLanguageManager translatedString:@"Optional"]; } +/** "Plaintext Only", */ +NSString* Plaintext_Only() { return [OTRLanguageManager translatedString:@"Plaintext Only"]; } +/** "Chain had a cert not yet valid", SSL error message */ +NSString* errSSLCertNotYetValidString() { return [OTRLanguageManager translatedString:@"Chain had a cert not yet valid"]; } +/** "User canceled", SSL error message */ +NSString* errSSLPeerUserCancelledString() { return [OTRLanguageManager translatedString:@"User canceled"]; } +/** "Delivered", Shows in the chat view when a message has been delivered */ +NSString* DELIVERED_STRING() { return [OTRLanguageManager translatedString:@"Delivered"]; } +/** "About", Title for the about page */ +NSString* ABOUT_STRING() { return [OTRLanguageManager translatedString:@"About"]; } +/** "Required", String to let user know a certain field like a password is required to create an account */ +NSString* REQUIRED_STRING() { return [OTRLanguageManager translatedString:@"Required"]; } +/** "Please choose a valid email address", detail title label for invalid email */ +NSString* INVALID_EMAIL_DETAIL_STRING() { return [OTRLanguageManager translatedString:@"Please choose a valid email address"]; } +/** "Share Invite", Label for inviting friends via URL */ +NSString* INVITE_LINK_STRING() { return [OTRLanguageManager translatedString:@"Share Invite"]; } +/** "Fingerprint for you", your fingerprint */ +NSString* YOUR_FINGERPRINT_STRING() { return [OTRLanguageManager translatedString:@"Fingerprint for you"]; } +/** "Compose", Label for text field where you compose a new message */ +NSString* COMPOSE_STRING() { return [OTRLanguageManager translatedString:@"Compose"]; } +/** "This message was sent to an untrusted device.", Error message description */ +NSString* UNTRUSTED_DEVICE_SENT_STRING() { return [OTRLanguageManager translatedString:@"This message was sent to an untrusted device."]; } +/** "Forgot Passphrase?", Label for button when you've forgotten the passphrase */ +NSString* FORGOT_PASSPHRASE_STRING() { return [OTRLanguageManager translatedString:@"Forgot Passphrase?"]; } +/** "Next", Label for button to go to next step */ +NSString* NEXT_STRING() { return [OTRLanguageManager translatedString:@"Next"]; } +/** "Duplicate account", Error title when there is a duplicate account */ +NSString* DUPLICATE_ACCOUNT_STRING() { return [OTRLanguageManager translatedString:@"Duplicate account"]; } +/** "Enable", enable permission */ +NSString* Enable_String() { return [OTRLanguageManager translatedString:@"Enable"]; } +/** "Scan QR", Label for sharing via QR Code */ +NSString* SCAN_QR_STRING() { return [OTRLanguageManager translatedString:@"Scan QR"]; } +/** "Basic", string to describe basic set of settings */ +NSString* BASIC_STRING() { return [OTRLanguageManager translatedString:@"Basic"]; } +/** "Language", string to bring up language selector */ +NSString* LANGUAGE_STRING() { return [OTRLanguageManager translatedString:@"Language"]; } +/** "Valid cert chain, untrusted root", SSL error message */ +NSString* errSSLUnknownRootCertString() { return [OTRLanguageManager translatedString:@"Valid cert chain, untrusted root"]; } +/** "Set new database passphrase", Detail label for button to change encrypted database passphrase */ +NSString* SET_NEW_DATABASE_PASSPHRASE_STRING() { return [OTRLanguageManager translatedString:@"Set new database passphrase"]; } +/** "is now available", Message shown in line for users that are available */ +NSString* AVAILABLE_MESSAGE_STRING() { return [OTRLanguageManager translatedString:@"is now available"]; } +/** "The message received contains malformed data.", Error string for OTR message string */ +NSString* OTRL_MSGEVENT_RCVDMSG_MALFORMED_STRING() { return [OTRLanguageManager translatedString:@"The message received contains malformed data."]; } +/** "An error occurred while changing the database passphrase.", shown when changing database passphrase fails */ +NSString* DATABASE_PASSPHRASE_CHANGE_ERROR_STRING() { return [OTRLanguageManager translatedString:@"An error occurred while changing the database passphrase."]; } +/** "Block & Remove", The String for a buddy to block and remove a buddy from the buddy list */ +NSString* BLOCK_AND_REMOVE_STRING() { return [OTRLanguageManager translatedString:@"Block & Remove"]; } +/** "Creating Account", Title for progress of creating a new account */ +NSString* CREATING_ACCOUNT_STRING() { return [OTRLanguageManager translatedString:@"Creating Account"]; } +/** "An error occurred while setting up the database.", Error message when setting up database */ +NSString* DATABASE_SETUP_ERROR_STRING() { return [OTRLanguageManager translatedString:@"An error occurred while setting up the database."]; } +/** "Domain needs to be set manually when specifying a custom port", Message when port is changed but domain not set */ +NSString* XMPP_PORT_FAIL_STRING() { return [OTRLanguageManager translatedString:@"Domain needs to be set manually when specifying a custom port"]; } +/** "Someone", A placeholder for a buddy's username like Someone wants to chat. */ +NSString* SOMEONE_STRING() { return [OTRLanguageManager translatedString:@"Someone"]; } +/** "Sign out Warning", Title for setting about showing a warning before disconnection */ +NSString* DISCONNECTION_WARNING_TITLE_STRING() { return [OTRLanguageManager translatedString:@"Sign out Warning"]; } +/** "Buddy List", Title for the buddy list tab */ +NSString* BUDDY_LIST_STRING() { return [OTRLanguageManager translatedString:@"Buddy List"]; } +/** "Certificate revoked", SSL error message */ +NSString* errSSLPeerCertRevokedString() { return [OTRLanguageManager translatedString:@"Certificate revoked"]; } +/** "Verify Later", Shown when verifying fingerprints */ +NSString* VERIFY_LATER_STRING() { return [OTRLanguageManager translatedString:@"Verify Later"]; } +/** "Logging in...", shown during the login process */ +NSString* LOGGING_IN_STRING() { return [OTRLanguageManager translatedString:@"Logging in..."]; } +/** "Cannot recognize the type of OTR message received.", Error string for OTR message string */ +NSString* OTRL_MSGEVENT_RCVDMSG_UNRECOGNIZED_STRING() { return [OTRLanguageManager translatedString:@"Cannot recognize the type of OTR message received."]; } +/** "SSL Hostname Mismatch", string for settings to allow SSL mismatch */ +NSString* SSL_MISMATCH_STRING() { return [OTRLanguageManager translatedString:@"SSL Hostname Mismatch"]; } +/** "Release to send", Label for instruction to send current audio */ +NSString* RELEASE_TO_SEND_STRING() { return [OTRLanguageManager translatedString:@"Release to send"]; } +/** "Invalid certificate chain", SSL error message */ +NSString* errSSLXCertChainInvalidString() { return [OTRLanguageManager translatedString:@"Invalid certificate chain"]; } +/** "Email", The string describing account name or email address for a buddy */ +NSString* EMAIL_STRING() { return [OTRLanguageManager translatedString:@"Email"]; } +/** "user@example.com", Example of a username using the words user and example */ +NSString* XMPP_USERNAME_EXAMPLE_STRING() { return [OTRLanguageManager translatedString:@"user@example.com"]; } +/** "Open in Chrome", Label to open link in the chrome web browser */ +NSString* OPEN_IN_CHROME() { return [OTRLanguageManager translatedString:@"Open in Chrome"]; } +/** "You must be in a secure conversation first.", Inform user that they must be secure their conversation before doing that action */ +NSString* SECURE_CONVERSATION_STRING() { return [OTRLanguageManager translatedString:@"You must be in a secure conversation first."]; } +/** "Would you like to connect to UserVoice to send feedback?", actionsheet for showing uservoice feedback service */ +NSString* SHOW_USERVOICE_STRING() { return [OTRLanguageManager translatedString:@"Would you like to connect to UserVoice to send feedback?"]; } +/** "Current Passphrase", title label for the existing passphrase */ +NSString* CURRENT_PASSPHRASE_STRING() { return [OTRLanguageManager translatedString:@"Current Passphrase"]; } +/** "Self Signed SSL", string for settings to allow self signed SSL string */ +NSString* SELF_SIGNED_SSL_STRING() { return [OTRLanguageManager translatedString:@"Self Signed SSL"]; } +/** "About This Version", Label for button to show version numbers and licenses */ +NSString* ABOUT_VERSION_STRING() { return [OTRLanguageManager translatedString:@"About This Version"]; } +/** "Take Photo", Label for button to take a photo from camera */ +NSString* USE_CAMERA_STRING() { return [OTRLanguageManager translatedString:@"Take Photo"]; } +/** "Buddy Fingerprints", Title for showing the users buddies otr fingerprints */ +NSString* BUDDY_FINGERPRINTS_STRING() { return [OTRLanguageManager translatedString:@"Buddy Fingerprints"]; } +/** "Manage saved SSL certificates", subtitle for the certificate pinned setting */ +NSString* PINNED_CERTIFICATES_DESCRIPTION_STRING() { return [OTRLanguageManager translatedString:@"Manage saved SSL certificates"]; } +/** "Customize Username", if you want to change your username */ +NSString* Customize_Username() { return [OTRLanguageManager translatedString:@"Customize Username"]; } +/** "Remove", The String for a button to remove a buddy from the buddy list */ +NSString* REMOVE_STRING() { return [OTRLanguageManager translatedString:@"Remove"]; } +/** "Default", default string to revert to normal language behaviour */ +NSString* DEFAULT_LANGUAGE_STRING() { return NSLocalizedString(@"Default",@"default string to revert to normal language behaviour") +; } diff --git a/OTRAssets/Strings/StringsConverter.py b/OTRAssets/Strings/StringsConverter.py index 5a1076888..1a1ce3924 100644 --- a/OTRAssets/Strings/StringsConverter.py +++ b/OTRAssets/Strings/StringsConverter.py @@ -44,24 +44,70 @@ def convert_to_json(file): newFile.write(json.dumps(combiniedDict,sort_keys=True,indent=4)) newFile.close() -def json_to_strings(strings_dict, strings_h_path, temp_strings_h_path): - stringsFile = open(strings_h_path, 'w') +def gen_doc_string(string, comment): + doc_string = '/** "' + string + '", ' + comment + ' */\n' + return doc_string + +def gen_h_line(key): + h_line = 'FOUNDATION_EXPORT NSString* ' + key + '();\n' + return h_line + +def gen_m_function(key, return_value): + m_line = 'NSString* ' + key + '() { return ' + return_value + '; }\n' + return m_line + +def gen_m_line(key, string): + return_value = '[OTRLanguageManager translatedString:' + add_obj_c(string) + ']' + m_line = gen_m_function(key=key, return_value=return_value) + return m_line + +def gen_nslocalized_line(string, comment): + temp_line = 'NSLocalizedString('+add_obj_c(string)+','+add_obj_c(comment)+')\n' + return temp_line + +def json_to_strings(strings_dict, strings_h_path, strings_m_path, temp_strings_h_path): + strings_h_file = open(strings_h_path, 'w') + strings_m_file = open(strings_m_path, 'w') tempStrings = open(temp_strings_h_path, 'w') - stringsFile.write('// DO NOT EDIT THIS FILE. EDIT strings.json then run python StringsConverter.py\n\n') + strings_h_file.write('// DO NOT EDIT THIS FILE. EDIT strings.json then run python StringsConverter.py\n\n') + strings_h_file.write('@import Foundation;\nNS_ASSUME_NONNULL_BEGIN\n') + + strings_m_file.write('// DO NOT EDIT THIS FILE. EDIT strings.json then run python StringsConverter.py\n\n') + strings_m_file.write('#import "OTRStrings.h"\n#import "OTRLanguageManager_Private.h"\n') + for key in strings_dict: - line = '#define '+key+' [OTRLanguageManager translatedString: '+add_obj_c(strings_dict[key]['string'])+']' - stringsFile.write(line+'\n') - line = 'NSLocalizedString('+add_obj_c(strings_dict[key]['string'])+','+add_obj_c(strings_dict[key]['comment'])+')' - tempStrings.write(line+'\n') + string = strings_dict[key]['string'] + comment = strings_dict[key]['comment'] - #Special case for .h file where always display the 'Default' in iOS system language - default = 'NSLocalizedString(@\"Default\", @\"default string to revert to normal language behaviour\")' - stringsFile.write('#define DEFAULT_LANGUAGE_STRING '+ default) - tempStrings.write(default) + doc_string = gen_doc_string(string=string, comment=comment) + h_line = gen_h_line(key=key) + m_line = gen_m_line(key=key, string=string) - stringsFile.close() + strings_h_file.write(doc_string + h_line) + strings_m_file.write(doc_string + m_line) + + nslocalized_line = gen_nslocalized_line(string=string, comment=comment) + tempStrings.write(nslocalized_line) + + #Special case for .h file where always display the 'Default' in iOS system language + default_string = 'Default' + default_comment = 'default string to revert to normal language behaviour' + default_key = 'DEFAULT_LANGUAGE_STRING' + default_h_line = gen_h_line(default_key) + default_docstring = gen_doc_string(string=default_string,comment=default_comment) + nslocalized_line = gen_nslocalized_line(string=default_string, comment=default_comment) + default_m_line = gen_m_function(key=default_key, return_value=nslocalized_line) + + strings_h_file.write(default_docstring + default_h_line) + strings_m_file.write(default_docstring + default_m_line) + + tempStrings.write(nslocalized_line) + + strings_h_file.write('NS_ASSUME_NONNULL_END\n') + strings_h_file.close() + strings_m_file.close() tempStrings.close() def genStrings(inputFilePath, outputDirectoryPath): @@ -71,6 +117,7 @@ def main(): script_directory = os.path.dirname(os.path.abspath(__file__)) strings_json_path = os.path.join(script_directory, 'strings.json') strings_h_path = os.path.join(script_directory, 'OTRStrings.h') + strings_m_path = os.path.join(script_directory, 'OTRStrings.m') temp_strings_h_path = os.path.join(script_directory, 'tempStrings.h') project_root_path = os.path.join(os.path.join(script_directory, os.pardir), os.pardir) localizations_path = os.path.join(os.path.join(project_root_path, 'OTRResources'), 'Localizations') @@ -79,15 +126,16 @@ def main(): # Compare Modification Dates strings_json_modified = os.path.getmtime(strings_json_path) strings_h_modified = os.path.getmtime(strings_h_path) + strings_m_modified = os.path.getmtime(strings_m_path) # Bail out if strings.json hasn't been modified recently - if strings_json_modified < strings_h_modified: + if (strings_json_modified < strings_h_modified) and (strings_json_modified < strings_m_modified): print 'No changes to strings.json detected.' return strings_json_file = open(strings_json_path,'r') strings_dict = json.load(strings_json_file) - json_to_strings(strings_dict, strings_h_path, temp_strings_h_path) + json_to_strings(strings_dict, strings_h_path, strings_m_path, temp_strings_h_path) strings_json_file.close() genStrings(inputFilePath=temp_strings_h_path, outputDirectoryPath=base_lproj_path) diff --git a/OTRAssets/Strings/strings.json b/OTRAssets/Strings/strings.json index 4d71e7908..44ea7d19c 100644 --- a/OTRAssets/Strings/strings.json +++ b/OTRAssets/Strings/strings.json @@ -123,9 +123,9 @@ "comment": "Message shown when connecting to the Tor network", "string": "Connecting to Tor" }, - "CONNECT_EXISTING_STRING": { + "ADD_EXISTING_STRING": { "comment": "Label for button to create account by logging into an existing account", - "string": "Connect to Existing Account" + "string": "Add Existing Account" }, "CONVERSATION_NOT_SECURE_WARNING_STRING": { "comment": "Warn user that the current chat is not secure", @@ -1043,6 +1043,14 @@ "comment": "Describes an error without a known cause", "string": "Unknown Error" }, + "ENABLE_PUSH_STRING" : { + "comment": "button for enabling push messages", + "string": "Enable Push" + }, + "ENABLE_PUSH_IN_SETTINGS_STRING" : { + "comment": "button for enabling push messages in iOS system settings", + "string": "Enable Push in Settings" + }, "NO_DEVICES_BUDDY_ERROR_STRING" : { "comment": "Error message for not finding any devices", "string": "We could not find any trusted devices for this contact." @@ -1106,7 +1114,7 @@ "comment": "", "string" : "Plaintext Only" }, "Profile_String": { - "comment": "", + "comment": "title for contacts profile view", "string" : "Profile" }, "Show_Advanced_Encryption_Settings": { "comment": "", diff --git a/OTRResources/Localizations/Base.lproj/Localizable.strings b/OTRResources/Localizations/Base.lproj/Localizable.strings index 7170dd420a7d1c68aa3b6667c2a7241c09c6b626..71f1044e9cdc43f9aa9fc9e6f9515b36320f7a4a 100644 GIT binary patch delta 294 zcmdn+fqBAb<_&f1lP9!mOcv0~V|8RmVMv)gQBN1jx~OM3`9Uk+N>*$&3?(C;NEuOrE46LD&>l1(4a3|9+61e1u&}8pR}r0ElfsdqHXh*8$C4#|1K* zUjd8UEe^iP8?3!HZ}6JoJo$o_h4QYY7|i*BCO HH!l+a7__db};jrEakV!Z