fix untouched strings

pull/1023/head
Ryan ZHAO 1 year ago
parent 9df1505c2f
commit 6a04ba5fc2

@ -27,7 +27,7 @@ extension ProjectState {
"_SharedTestUtilities/", // Exclude shared test directory
"external/" // External dependencies
]
static let excludedPhrases: Set<String> = [ "", " ", " ", ",", ", ", "null", "\"", "@[0-9a-fA-F]{66}", "^[0-9A-Fa-f]+$" ]
static let excludedPhrases: Set<String> = [ "", " ", " ", ",", ", ", "null", "\"", "@[0-9a-fA-F]{66}", "^[0-9A-Fa-f]+$", "/" ]
static let excludedUnlocalisedStringLineMatching: Set<MatchType> = [
.contains(ProjectState.lintSuppression, caseSensitive: false),
.prefix("#import", caseSensitive: false),
@ -82,6 +82,7 @@ extension ProjectState {
.contains("accessibilityId:", caseSensitive: false),
.contains("key:", caseSensitive: false),
.contains("separator:", caseSensitive: false),
.contains("separatedBy:", caseSensitive: false),
.nextLine(.contains(".put(key:", caseSensitive: false)),
.nextLine(.contains(".localized()", caseSensitive: false)),
.regex(".*static var databaseTableName: String"),

@ -1,5 +1,7 @@
// Copyright © 2021 Rangeproof Pty Ltd. All rights reserved.
// stringlint:disable
import Foundation
import SessionUtilitiesKit

@ -1,3 +1,5 @@
// stringlint:disable
import WebRTC
extension RTCSignalingState : CustomStringConvertible {

@ -12,7 +12,7 @@ extension WebRTCSession: RTCDataChannelDelegate {
dataChannelConfiguration.isOrdered = true
dataChannelConfiguration.isNegotiated = true
dataChannelConfiguration.channelId = 548
guard let dataChannel = peerConnection?.dataChannel(forLabel: "CONTROL", configuration: dataChannelConfiguration) else {
guard let dataChannel = peerConnection?.dataChannel(forLabel: "CONTROL", configuration: dataChannelConfiguration) else { // stringlint:disable
SNLog("[Calls] Couldn't create data channel.")
return nil
}
@ -38,10 +38,10 @@ extension WebRTCSession: RTCDataChannelDelegate {
public func dataChannel(_ dataChannel: RTCDataChannel, didReceiveMessageWith buffer: RTCDataBuffer) {
if let json = try? JSONSerialization.jsonObject(with: buffer.data, options: [ .fragmentsAllowed ]) as? JSON {
SNLog("[Calls] Data channel did receive data: \(json)")
if let isRemoteVideoEnabled = json["video"] as? Bool {
if let isRemoteVideoEnabled = json["video"] as? Bool { // stringlint:disable
delegate?.isRemoteVideoDidChange(isEnabled: isRemoteVideoEnabled)
}
if let _ = json["hangup"] {
if let _ = json["hangup"] { // stringlint:disable
delegate?.didReceiveHangUpSignal()
}
}

@ -58,7 +58,7 @@ public final class WebRTCSession : NSObject, RTCPeerConnectionDelegate {
}()
internal lazy var audioTrack: RTCAudioTrack = {
return factory.audioTrack(with: audioSource, trackId: "ARDAMSa0")
return factory.audioTrack(with: audioSource, trackId: "ARDAMSa0") // stringlint:disable
}()
// Video
@ -69,7 +69,7 @@ public final class WebRTCSession : NSObject, RTCPeerConnectionDelegate {
}()
internal lazy var localVideoTrack: RTCVideoTrack = {
return factory.videoTrack(with: localVideoSource, trackId: "ARDAMSv0")
return factory.videoTrack(with: localVideoSource, trackId: "ARDAMSv0") // stringlint:disable
}()
internal lazy var remoteVideoTrack: RTCVideoTrack? = {
@ -86,7 +86,7 @@ public final class WebRTCSession : NSObject, RTCPeerConnectionDelegate {
public var errorDescription: String? {
switch self {
case .noThread: return "Couldn't find thread for contact."
case .noThread: return "Couldn't find thread for contact." // stringlint:disable
}
}
}
@ -103,7 +103,7 @@ public final class WebRTCSession : NSObject, RTCPeerConnectionDelegate {
super.init()
let mediaStreamTrackIDS = ["ARDAMS"]
let mediaStreamTrackIDS = ["ARDAMS"] // stringlint:disable
peerConnection?.add(audioTrack, streamIds: mediaStreamTrackIDS)
peerConnection?.add(localVideoTrack, streamIds: mediaStreamTrackIDS)
@ -394,8 +394,8 @@ public final class WebRTCSession : NSObject, RTCPeerConnectionDelegate {
private func correctSessionDescription(sdp: RTCSessionDescription?) -> RTCSessionDescription? {
guard let sdp = sdp else { return nil }
let cbrSdp = sdp.sdp.description.replace(regex: "(a=fmtp:111 ((?!cbr=).)*)\r?\n", with: "$1;cbr=1\r\n")
let finalSdp = cbrSdp.replace(regex: ".+urn:ietf:params:rtp-hdrext:ssrc-audio-level.*\r?\n", with: "")
let cbrSdp = sdp.sdp.description.replace(regex: "(a=fmtp:111 ((?!cbr=).)*)\r?\n", with: "$1;cbr=1\r\n") // stringlint:disable
let finalSdp = cbrSdp.replace(regex: ".+urn:ietf:params:rtp-hdrext:ssrc-audio-level.*\r?\n", with: "") // stringlint:disable
return RTCSessionDescription(type: sdp.type, sdp: finalSdp)
}
@ -480,15 +480,15 @@ extension WebRTCSession {
public func turnOffVideo() {
localVideoTrack.isEnabled = false
sendJSON(["video": false])
sendJSON(["video": false]) // stringlint:disable
}
public func turnOnVideo() {
localVideoTrack.isEnabled = true
sendJSON(["video": true])
sendJSON(["video": true]) // stringlint:disable
}
public func hangUp() {
sendJSON(["hangup": true])
sendJSON(["hangup": true]) // stringlint:disable
}
}

@ -604,7 +604,7 @@ extension Attachment {
private static var sharedDataAttachmentsDirPath: String = {
URL(fileURLWithPath: OWSFileSystem.appSharedDataDirectoryPath())
.appendingPathComponent("Attachments")
.appendingPathComponent("Attachments") // stringlint:disable
.path
}()
@ -720,7 +720,7 @@ extension Attachment {
// MARK: - Convenience
extension Attachment {
public static let nonMediaQuoteFileId: String = "NON_MEDIA_QUOTE_FILE_ID"
public static let nonMediaQuoteFileId: String = "NON_MEDIA_QUOTE_FILE_ID" // stringlint:disable
public enum ThumbnailSize {
case small
@ -753,7 +753,7 @@ extension Attachment {
var thumbnailsDirPath: String {
// Thumbnails are written to the caches directory, so that iOS can
// remove them if necessary
return "\(OWSFileSystem.cachesDirectoryPath())/\(id)-thumbnails"
return "\(OWSFileSystem.cachesDirectoryPath())/\(id)-thumbnails" // stringlint:disable
}
var legacyThumbnailPath: String? {
@ -766,7 +766,7 @@ extension Attachment {
let filename: String = fileUrl.lastPathComponent.filenameWithoutExtension
let containingDir: String = fileUrl.deletingLastPathComponent().path
return "\(containingDir)/\(filename)-signal-ios-thumbnail.jpg"
return "\(containingDir)/\(filename)-signal-ios-thumbnail.jpg" // stringlint:disable
}
var originalImage: UIImage? {
@ -822,7 +822,7 @@ extension Attachment {
}
public func thumbnailPath(for dimensions: UInt) -> String {
return "\(thumbnailsDirPath)/thumbnail-\(dimensions).jpg"
return "\(thumbnailsDirPath)/thumbnail-\(dimensions).jpg" // stringlint:disable
}
private func loadThumbnail(with dimensions: UInt, success: @escaping (UIImage, () throws -> Data) -> (), failure: @escaping () -> ()) {
@ -900,7 +900,7 @@ extension Attachment {
public func cloneAsQuoteThumbnail() -> Attachment? {
let cloneId: String = UUID().uuidString
let thumbnailName: String = "quoted-thumbnail-\(sourceFilename ?? "null")"
let thumbnailName: String = "quoted-thumbnail-\(sourceFilename ?? "null")" // stringlint:disable
guard self.isVisualMedia else { return nil }

@ -1,5 +1,7 @@
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
// stringlint:disable
import Foundation
import GRDB
import SessionUtilitiesKit

@ -35,7 +35,7 @@ public struct Interaction: Codable, Identifiable, Equatable, FetchableRecord, Mu
) -> SQL {
let halfResolution: Double = LinkPreview.timstampResolution
return "(\(interaction[.timestampMs]) BETWEEN (\(linkPreview[.timestamp]) - \(halfResolution)) * 1000 AND (\(linkPreview[.timestamp]) + \(halfResolution)) * 1000)"
return "(\(interaction[.timestampMs]) BETWEEN (\(linkPreview[.timestamp]) - \(halfResolution)) * 1000 AND (\(linkPreview[.timestamp]) + \(halfResolution)) * 1000)" // stringlint:disable
}
public static let recipientStates = hasMany(RecipientState.self, using: RecipientState.interactionForeignKey)
@ -936,7 +936,7 @@ public extension Interaction {
return publicKeysToCheck.contains { publicKey in
(
body != nil &&
(body ?? "").contains("@\(publicKey)")
(body ?? "").contains("@\(publicKey)") // stringlint:disable
) || (
quoteAuthorId == publicKey
)

@ -1,5 +1,7 @@
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
// stringlint:disable
import Foundation
import Combine
import GRDB

@ -1,5 +1,7 @@
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
// stringlint:disable
import Foundation
import Combine
import SessionSnodeKit

@ -1,5 +1,7 @@
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
// stringlint:disable
import Foundation
import SessionUtilitiesKit

@ -241,8 +241,8 @@ extension AttachmentDownloadJob {
public var errorDescription: String? {
switch self {
case .failedToSaveFile: return "Failed to save file"
case .invalidUrl: return "Invalid file URL"
case .failedToSaveFile: return "Failed to save file" // stringlint:disable
case .invalidUrl: return "Invalid file URL" // stringlint:disable
}
}
}

@ -45,12 +45,12 @@ public final class CallMessage: ControlMessage {
public var description: String {
switch self {
case .preOffer: return "preOffer"
case .offer: return "offer"
case .answer: return "answer"
case .provisionalAnswer: return "provisionalAnswer"
case .iceCandidates(_, _): return "iceCandidates"
case .endCall: return "endCall"
case .preOffer: return "preOffer" // stringlint:disable
case .offer: return "offer" // stringlint:disable
case .answer: return "answer" // stringlint:disable
case .provisionalAnswer: return "provisionalAnswer" // stringlint:disable
case .iceCandidates(_, _): return "iceCandidates" // stringlint:disable
case .endCall: return "endCall" // stringlint:disable
}
}

@ -50,13 +50,13 @@ public final class ClosedGroupControlMessage: ControlMessage {
public var description: String {
switch self {
case .new: return "new"
case .encryptionKeyPair: return "encryptionKeyPair"
case .nameChange: return "nameChange"
case .membersAdded: return "membersAdded"
case .membersRemoved: return "membersRemoved"
case .memberLeft: return "memberLeft"
case .encryptionKeyPairRequest: return "encryptionKeyPairRequest"
case .new: return "new" // stringlint:disable
case .encryptionKeyPair: return "encryptionKeyPair" // stringlint:disable
case .nameChange: return "nameChange" // stringlint:disable
case .membersAdded: return "membersAdded" // stringlint:disable
case .membersRemoved: return "membersRemoved" // stringlint:disable
case .memberLeft: return "memberLeft" // stringlint:disable
case .encryptionKeyPairRequest: return "encryptionKeyPairRequest" // stringlint:disable
}
}

@ -19,8 +19,8 @@ public final class DataExtractionNotification: ControlMessage {
public var description: String {
switch self {
case .screenshot: return "screenshot"
case .mediaSaved: return "mediaSaved"
case .screenshot: return "screenshot" // stringlint:disable
case .mediaSaved: return "mediaSaved" // stringlint:disable
}
}
}

@ -29,10 +29,10 @@ public final class SharedConfigMessage: ControlMessage {
public var description: String {
switch self {
case .userProfile: return "userProfile"
case .contacts: return "contacts"
case .convoInfoVolatile: return "convoInfoVolatile"
case .userGroups: return "userGroups"
case .userProfile: return "userProfile" // stringlint:disable
case .contacts: return "contacts" // stringlint:disable
case .convoInfoVolatile: return "convoInfoVolatile" // stringlint:disable
case .userGroups: return "userGroups" // stringlint:disable
}
}
}

@ -34,8 +34,8 @@ public final class TypingIndicator: ControlMessage {
public var description: String {
switch self {
case .started: return "started"
case .stopped: return "stopped"
case .started: return "started" // stringlint:disable
case .stopped: return "stopped" // stringlint:disable
}
}
}

@ -28,8 +28,8 @@ public extension VisibleMessage {
var description: String {
switch self {
case .react: return "react"
case .remove: return "remove"
case .react: return "react" // stringlint:disable
case .remove: return "remove" // stringlint:disable
}
}

@ -66,7 +66,7 @@ public final class OpenGroupManager {
private static func port(for server: String, serverUrl: URL) -> String {
if let port: Int = serverUrl.port {
return ":\(port)"
return ":\(port)" // stringlint:disable
}
let components: [String] = server.components(separatedBy: ":")
@ -79,7 +79,7 @@ public final class OpenGroupManager {
)
else { return "" }
return ":\(port)"
return ":\(port)" // stringlint:disable
}
public static func isSessionRunOpenGroup(server: String) -> Bool {

@ -1,5 +1,7 @@
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
// stringlint:disable
import Foundation
import SessionUtilitiesKit

@ -1,5 +1,7 @@
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
// stringlint:disable
import Foundation
public enum OpenGroupAPIError: LocalizedError {

@ -286,16 +286,6 @@ public class SignalAttachment: Equatable, Hashable {
// Returns the MIME type for this attachment or nil if no MIME type
// can be identified.
public var mimeType: String {
if isVoiceMessage {
// Legacy iOS clients don't handle "audio/mp4" files correctly;
// they are written to disk as .mp4 instead of .m4a which breaks
// playback. So we send voice messages as "audio/aac" to work
// around this.
//
// TODO: Remove this Nov. 2016 or after.
return "audio/aac"
}
if let filename = sourceFilename {
let fileExtension = (filename as NSString).pathExtension
if fileExtension.count > 0 {

@ -1,5 +1,7 @@
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
// stringlint:disable
import Foundation
public enum AttachmentError: LocalizedError {

@ -110,7 +110,7 @@ extension MessageSender {
}
let allActiveLegacyGroupIds: Set<String> = try ClosedGroup
.select(.threadId)
.filter(!ClosedGroup.Columns.threadId.like("\(SessionId.Prefix.group.rawValue)%"))
.filter(!ClosedGroup.Columns.threadId.like("\(SessionId.Prefix.group.rawValue)%")) // stringlint:disable
.joining(
required: ClosedGroup.members
.filter(GroupMember.Columns.profileId == userPublicKey)

@ -124,10 +124,10 @@ extension PushNotificationAPI {
/// on whether the subscription wants message data included; and the trailing `NS[i]` values are a
/// comma-delimited list of namespaces that should be subscribed to, in the same sorted order as
/// the `namespaces` parameter.
let verificationBytes: [UInt8] = "MONITOR".bytes
let verificationBytes: [UInt8] = "MONITOR".bytes // stringlint:disable
.appending(contentsOf: pubkey.bytes)
.appending(contentsOf: "\(timestamp)".bytes)
.appending(contentsOf: (includeMessageData ? "1" : "0").bytes)
.appending(contentsOf: (includeMessageData ? "1" : "0").bytes) // stringlint:disable
.appending(
contentsOf: namespaces
.map { $0.rawValue } // Intentionally not using `verificationString` here

@ -91,7 +91,7 @@ extension PushNotificationAPI {
/// `"UNSUBSCRIBE" || HEX(ACCOUNT) || SIG_TS`
///
/// Where `SIG_TS` is the `sig_ts` value as a base-10 string and must be within 24 hours of the current time.
let verificationBytes: [UInt8] = "UNSUBSCRIBE".bytes
let verificationBytes: [UInt8] = "UNSUBSCRIBE".bytes // stringlint:disable
.appending(contentsOf: pubkey.bytes)
.appending(contentsOf: "\(timestamp)".data(using: .ascii)?.bytes)

@ -1,5 +1,7 @@
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
// stringlint:disable
import Foundation
import Combine
import GRDB

@ -45,7 +45,7 @@ public final class CurrentUserPoller: Poller {
// MARK: - Abstract Methods
override func pollerName(for publicKey: String) -> String {
return "Main Poller"
return "Main Poller" // stringlint:disable
}
override func nextPollDelay(for publicKey: String, using dependencies: Dependencies) -> TimeInterval {

@ -314,7 +314,7 @@ extension OpenGroupAPI {
case .httpRequestFailedAtDestination(let statusCode, let data, _) = error,
statusCode == 400,
let dataString: String = String(data: data, encoding: .utf8),
dataString.contains("Invalid authentication: this server requires the use of blinded ids")
dataString.contains("Invalid authentication: this server requires the use of blinded ids") // stringlint:disable
else {
return Just(false)
.setFailureType(to: Error.self)

@ -223,7 +223,7 @@ public class Poller {
let pollerName: String = (
poller?.pollerName(for: publicKey) ??
"poller with public key \(publicKey)"
"poller with public key \(publicKey)" // stringlint:disable
)
let configHashes: [String] = SessionUtil.configHashes(for: publicKey)
@ -271,7 +271,7 @@ public class Poller {
var hadValidHashUpdate: Bool = false
var configMessageJobsToRun: [Job] = []
var standardMessageJobsToRun: [Job] = []
var pollerLogOutput: String = "\(pollerName) failed to process any messages"
var pollerLogOutput: String = "\(pollerName) failed to process any messages" // stringlint:disable
dependencies.storage.write { db in
let allProcessedMessages: [ProcessedMessage] = allMessages

@ -357,7 +357,7 @@ public final class NotificationServiceExtension: UNNotificationServiceExtension
.localized()
}
else {
notificationContent.body = "Incoming call..."
notificationContent.body = "Incoming call..." // FIXME: Localized
}
let identifier = self.request?.identifier ?? UUID().uuidString

@ -394,10 +394,7 @@ public final class ProfilePictureView: UIView {
}
case .rightPlus:
imageView.image = UIImage(
systemName: "plus",
withConfiguration: UIImage.SymbolConfiguration(weight: .semibold)
)
imageView.image = UIImage(systemName: "plus", withConfiguration: UIImage.SymbolConfiguration(weight: .semibold))
imageView.themeTintColor = .black
backgroundView.themeBackgroundColor = .primary
}

@ -39,6 +39,6 @@ public enum Format {
}
public static func duration(_ duration: TimeInterval) -> String {
return (Format.durationFormatter.string(from: duration) ?? "0:00")
return (Format.durationFormatter.string(from: duration) ?? "0:00") // stringlint:disable
}
}

@ -15,10 +15,10 @@ public enum Theme: String, CaseIterable, Codable, EnumStringSetting {
public var title: String {
switch self {
case .classicDark: return "appearanceThemesClassicDark"
case .classicLight: return "appearanceThemesClassicLight"
case .oceanDark: return "appearanceThemesOceanDark"
case .oceanLight: return "appearanceThemesOceanLight"
case .classicDark: return "appearanceThemesClassicDark".localized()
case .classicLight: return "appearanceThemesClassicLight".localized()
case .oceanDark: return "appearanceThemesOceanDark".localized()
case .oceanLight: return "appearanceThemesOceanLight".localized()
}
}

@ -1,5 +1,7 @@
// Copyright © 2024 Rangeproof Pty Ltd. All rights reserved.
// stringlint:disable
import Foundation
public extension NSAttributedString {

@ -1,5 +1,7 @@
// Copyright © 2024 Rangeproof Pty Ltd. All rights reserved.
// stringlint:disable
import UIKit.UIApplication
public extension UIApplication.State {

@ -169,7 +169,7 @@ class AttachmentTextToolbar: UIView, UITextViewDelegate {
private lazy var placeholderTextView: UITextView = {
let placeholderTextView = buildTextView()
placeholderTextView.text = "Message"
placeholderTextView.text = "message".localized()
placeholderTextView.isEditable = false
return placeholderTextView

Loading…
Cancel
Save