feat: update i18n string

This commit is contained in:
CMK 2022-11-14 19:27:09 +08:00
parent bc428486ae
commit af0dc45d1b
4 changed files with 19 additions and 15 deletions

View File

@ -386,7 +386,9 @@
"load_failed": "Load Failed",
"upload_failed": "Upload Failed",
"can_not_recognize_this_media_attachment": "Can not regonize this media attachment",
"attachment_too_large": "Attachment too large"
"attachment_too_large": "Attachment too large",
"compressing_state": "Compressing...",
"server_processing_state": "Server Processing..."
},
"poll": {
"duration_time": "Duration: %s",
@ -396,7 +398,9 @@
"one_day": "1 Day",
"three_days": "3 Days",
"seven_days": "7 Days",
"option_number": "Option %ld"
"option_number": "Option %ld",
"the_poll_is_invalid": "The poll is invalid",
"the_poll_has_empty_option": "The poll has empty option"
},
"content_warning": {
"placeholder": "Write an accurate warning here..."
@ -709,4 +713,4 @@
"title": "Bookmarks"
}
}
}
}

View File

@ -65,7 +65,7 @@ public struct AttachmentView: View {
if viewModel.output == nil, let error = viewModel.error {
VisualEffectView(effect: blurEffect)
VStack {
Text(L10n.Scene.Compose.Attachment) // TODO: i18n
Text(L10n.Scene.Compose.Attachment.loadFailed)
.font(.system(size: 13, weight: .semibold))
Text(error.localizedDescription)
.font(.system(size: 12, weight: .regular))
@ -123,7 +123,7 @@ public struct AttachmentView: View {
case .remove:
switch viewModel.uploadState {
case .compressing:
return "Comporessing..." // TODO: i18n
return "Compressing..." // TODO: i18n
default:
if viewModel.fractionCompleted < 0.9 {
let totalSizeInByte = viewModel.outputSizeInByte
@ -136,7 +136,7 @@ public struct AttachmentView: View {
}
}
case .retry:
return "Upload Failed" // TODO: i18n
return L10n.Scene.Compose.Attachment.uploadFailed
}
}()
let subtitle: String = {

View File

@ -11,6 +11,7 @@ import Combine
import PhotosUI
import Kingfisher
import MastodonCore
import MastodonLocalization
import func QuartzCore.CACurrentMediaTime
public protocol AttachmentViewModelDelegate: AnyObject {
@ -48,9 +49,7 @@ final public class AttachmentViewModel: NSObject, ObservableObject, Identifiable
public let authContext: AuthContext
public let input: Input
@Published var caption = ""
@Published var sizeLimit = SizeLimit()
// var compressVideoTask: Task<URL, Error>?
// @Published var sizeLimit = SizeLimit()
// output
@Published public private(set) var output: Output?
@ -263,15 +262,16 @@ extension AttachmentViewModel {
}
}
// not in using
public struct SizeLimit {
public let image: Int
public let gif: Int
public let video: Int
public init(
image: Int = 5 * 1024 * 1024, // 5 MiB,
gif: Int = 15 * 1024 * 1024, // 15 MiB,
video: Int = 512 * 1024 * 1024 // 512 MiB
image: Int = 10 * 1024 * 1024, // 10 MiB
gif: Int = 40 * 1024 * 1024, // 40 MiB
video: Int = 40 * 1024 * 1024 // 40 MiB
) {
self.image = image
self.gif = gif
@ -286,9 +286,9 @@ extension AttachmentViewModel {
public var errorDescription: String? {
switch self {
case .invalidAttachmentType:
return "Can not regonize this media attachment" // TODO: i18n
return L10n.Scene.Compose.Attachment.canNotRecognizeThisMediaAttachment
case .attachmentTooLarge:
return "Attachment too large"
return L10n.Scene.Compose.Attachment.attachmentTooLarge
}
}
}

View File

@ -479,7 +479,7 @@ extension ComposeContentViewModel {
public var errorDescription: String? {
switch self {
case .pollHasEmptyOption:
return "The post poll is invalid" // TODO: i18n
return "The poll is invalid" // TODO: i18n
}
}