Skip to content

Commit 4b52f71

Browse files
committed
Move localized text to enum
1 parent 1aba3aa commit 4b52f71

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

WooCommerce/Classes/ServiceLocator/ProductImageUploader.swift

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,7 @@ final class ProductImageUploader: ProductImageUploaderProtocol {
173173

174174
func sendBackgroundUploadNoticeIfNeeded(key: ProductImageUploaderKey, using noticePresenter: NoticePresenter) {
175175
if activeUploadsPublisher.contains(key) {
176-
let title = NSLocalizedString(
177-
"productImageUploader.backgroundUploadNotice.title",
178-
value: "Image uploading will continue in the background",
179-
comment: ""
180-
)
181-
let notice = Notice(title: title)
176+
let notice = Notice(title: Localization.backgroundUploadNoticeTitle)
182177
noticePresenter.enqueue(notice: notice)
183178
}
184179
}
@@ -316,3 +311,11 @@ enum ProductImageUploaderError: Error {
316311
case failedSavingProductAfterImageUpload(error: Error)
317312
case failedUploadingImage(error: Error)
318313
}
314+
315+
private enum Localization {
316+
static let backgroundUploadNoticeTitle = NSLocalizedString(
317+
"productImageUploader.backgroundUploadNotice.title",
318+
value: "Image uploading will continue in the background",
319+
comment: ""
320+
)
321+
}

0 commit comments

Comments
 (0)