Skip to content

Commit 57fb03a

Browse files
committed
Rename localizedUpToNinetyNine to localizedOrNinetyNinePlus
This new name seems more understandble to me.
1 parent cfb0f98 commit 57fb03a

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

WooCommerce/Classes/Extensions/NumberFormatter+LocalizedUpToNinetyNine.swift renamed to WooCommerce/Classes/Extensions/NumberFormatter+LocalizedOrNinetyNinePlus.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Foundation
44
extension NumberFormatter {
55
/// Returns `number` as a localized string or “99+” if it is greater than `99`.
66
///
7-
static func localizedUpToNinetyNine(_ number: Int) -> String {
7+
static func localizedOrNinetyNinePlus(_ number: Int) -> String {
88
if number > 99 {
99
return Constants.ninetyNinePlus
1010
} else {

WooCommerce/Classes/ViewModels/MainTabViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private extension MainTabViewModel {
5555
return
5656
}
5757

58-
onBadgeReload?(NumberFormatter.localizedUpToNinetyNine(processingCount))
58+
onBadgeReload?(NumberFormatter.localizedOrNinetyNinePlus(processingCount))
5959
}
6060

6161
private func observeBadgeRefreshNotifications() {

WooCommerce/Classes/ViewRelated/Search/Order/OrderSearchStarterViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ extension OrderSearchStarterViewModel {
8484
func cellViewModel(at indexPath: IndexPath) -> CellViewModel {
8585
let orderStatus = resultsController.object(at: indexPath)
8686

87-
let total = NumberFormatter.localizedUpToNinetyNine(orderStatus.total)
87+
let total = NumberFormatter.localizedOrNinetyNinePlus(orderStatus.total)
8888

8989
return CellViewModel(name: orderStatus.name,
9090
slug: orderStatus.slug,

WooCommerce/WooCommerce.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@
313313
5754727D2451F1D800A94C3C /* PublishSubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5754727C2451F1D800A94C3C /* PublishSubject.swift */; };
314314
5754727F24520B2A00A94C3C /* Observer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5754727E24520B2A00A94C3C /* Observer.swift */; };
315315
575472812452185300A94C3C /* ForegroundNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = 575472802452185300A94C3C /* ForegroundNotification.swift */; };
316-
57612989245888E2007BB2D9 /* NumberFormatter+LocalizedUpToNinetyNine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57612988245888E2007BB2D9 /* NumberFormatter+LocalizedUpToNinetyNine.swift */; };
317-
5761298B24589B84007BB2D9 /* NumberFormatter+LocalizedUpToNinetyNineTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5761298A24589B84007BB2D9 /* NumberFormatter+LocalizedUpToNinetyNineTests.swift */; };
316+
57612989245888E2007BB2D9 /* NumberFormatter+LocalizedOrNinetyNinePlus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57612988245888E2007BB2D9 /* NumberFormatter+LocalizedOrNinetyNinePlus.swift */; };
317+
5761298B24589B84007BB2D9 /* NumberFormatter+LocalizedOrNinetyNinePlusTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5761298A24589B84007BB2D9 /* NumberFormatter+LocalizedOrNinetyNinePlusTests.swift */; };
318318
576F92222423C3C0003E5FEF /* OrdersViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 576F92212423C3C0003E5FEF /* OrdersViewModel.swift */; };
319319
5795F22C23E26A8D00F6707C /* OrderSearchStarterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5795F22B23E26A8D00F6707C /* OrderSearchStarterViewController.xib */; };
320320
5795F22E23E26A9E00F6707C /* OrderSearchStarterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5795F22D23E26A9E00F6707C /* OrderSearchStarterViewController.swift */; };
@@ -1138,8 +1138,8 @@
11381138
5754727C2451F1D800A94C3C /* PublishSubject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishSubject.swift; sourceTree = "<group>"; };
11391139
5754727E24520B2A00A94C3C /* Observer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Observer.swift; sourceTree = "<group>"; };
11401140
575472802452185300A94C3C /* ForegroundNotification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ForegroundNotification.swift; sourceTree = "<group>"; };
1141-
57612988245888E2007BB2D9 /* NumberFormatter+LocalizedUpToNinetyNine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NumberFormatter+LocalizedUpToNinetyNine.swift"; sourceTree = "<group>"; };
1142-
5761298A24589B84007BB2D9 /* NumberFormatter+LocalizedUpToNinetyNineTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NumberFormatter+LocalizedUpToNinetyNineTests.swift"; sourceTree = "<group>"; };
1141+
57612988245888E2007BB2D9 /* NumberFormatter+LocalizedOrNinetyNinePlus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NumberFormatter+LocalizedOrNinetyNinePlus.swift"; sourceTree = "<group>"; };
1142+
5761298A24589B84007BB2D9 /* NumberFormatter+LocalizedOrNinetyNinePlusTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NumberFormatter+LocalizedOrNinetyNinePlusTests.swift"; sourceTree = "<group>"; };
11431143
576F92212423C3C0003E5FEF /* OrdersViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrdersViewModel.swift; sourceTree = "<group>"; };
11441144
5795F22B23E26A8D00F6707C /* OrderSearchStarterViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = OrderSearchStarterViewController.xib; sourceTree = "<group>"; };
11451145
5795F22D23E26A9E00F6707C /* OrderSearchStarterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderSearchStarterViewController.swift; sourceTree = "<group>"; };
@@ -2858,7 +2858,7 @@
28582858
F997174623DC070C00592D8E /* XLPagerStrip+AccessibilityIdentifierTests.swift */,
28592859
0215320C2423309B003F2BBD /* UIStackView+SubviewsTests.swift */,
28602860
6856D7981E11F85D5E4EFED7 /* NSMutableAttributedStringHelperTests.swift */,
2861-
5761298A24589B84007BB2D9 /* NumberFormatter+LocalizedUpToNinetyNineTests.swift */,
2861+
5761298A24589B84007BB2D9 /* NumberFormatter+LocalizedOrNinetyNinePlusTests.swift */,
28622862
);
28632863
path = Extensions;
28642864
sourceTree = "<group>";
@@ -3300,7 +3300,7 @@
33003300
02396250239948470096F34C /* UIImage+TintColor.swift */,
33013301
F997174323DC065900592D8E /* XLPagerStrip+AccessibilityIdentifier.swift */,
33023302
0215320A24231D5A003F2BBD /* UIStackView+Subviews.swift */,
3303-
57612988245888E2007BB2D9 /* NumberFormatter+LocalizedUpToNinetyNine.swift */,
3303+
57612988245888E2007BB2D9 /* NumberFormatter+LocalizedOrNinetyNinePlus.swift */,
33043304
);
33053305
path = Extensions;
33063306
sourceTree = "<group>";
@@ -4579,7 +4579,7 @@
45794579
024EFA6923FCC10B00F36918 /* Product+Media.swift in Sources */,
45804580
5795F23023E26B5300F6707C /* OrderSearchStarterViewModel.swift in Sources */,
45814581
0202B68D23876BC100F3EBE0 /* ProductsTabProductViewModel+ProductVariation.swift in Sources */,
4582-
57612989245888E2007BB2D9 /* NumberFormatter+LocalizedUpToNinetyNine.swift in Sources */,
4582+
57612989245888E2007BB2D9 /* NumberFormatter+LocalizedOrNinetyNinePlus.swift in Sources */,
45834583
B5A8532220BDBFAF00FAAB4D /* CircularImageView.swift in Sources */,
45844584
CE1F51252064179A00C6C810 /* UILabel+Helpers.swift in Sources */,
45854585
0235595324496A93004BE2B8 /* BottomSheetListSelectorViewProperties.swift in Sources */,
@@ -4773,7 +4773,7 @@
47734773
B57C5C9F21B80E8300FF82B2 /* SampleError.swift in Sources */,
47744774
02404EE42315151400FF1170 /* MockupStatsVersionStoresManager.swift in Sources */,
47754775
B53B898920D450AF00EDB467 /* SessionManagerTests.swift in Sources */,
4776-
5761298B24589B84007BB2D9 /* NumberFormatter+LocalizedUpToNinetyNineTests.swift in Sources */,
4776+
5761298B24589B84007BB2D9 /* NumberFormatter+LocalizedOrNinetyNinePlusTests.swift in Sources */,
47774777
7435E59021C0162C00216F0F /* OrderNoteWooTests.swift in Sources */,
47784778
45F5A3C323DF31D2007D40E5 /* ShippingInputFormatterTests.swift in Sources */,
47794779
02153211242376B5003F2BBD /* ProductPriceSettingsViewModelTests.swift in Sources */,

WooCommerce/WooCommerceTests/Extensions/NumberFormatter+LocalizedUpToNinetyNineTests.swift renamed to WooCommerce/WooCommerceTests/Extensions/NumberFormatter+LocalizedOrNinetyNinePlusTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ import XCTest
33

44
@testable import WooCommerce
55

6-
final class NumberFormatterLocalizedUpToNinetyNineTests: XCTestCase {
6+
final class NumberFormatterLocalizedOrNinetyNinePlusTests: XCTestCase {
77

88
func testItReturnsNinetyNinePlusIfTheNumberIsGreaterThanNinetyNine() {
9-
let localized = NumberFormatter.localizedUpToNinetyNine(100)
9+
let localized = NumberFormatter.localizedOrNinetyNinePlus(100)
1010

1111
XCTAssertEqual(localized, NSLocalizedString("99+", comment: ""))
1212
}
1313

1414
func testItReturnsTheLocalizedNumberIfTheNumberIsLessThanNinetyNine() {
15-
let localized = NumberFormatter.localizedUpToNinetyNine(98)
15+
let localized = NumberFormatter.localizedOrNinetyNinePlus(98)
1616

1717
XCTAssertEqual(localized, NumberFormatter.localizedString(from: NSNumber(value: 98), number: .none))
1818
}
1919

2020
func testItReturnsTheLocalizedNumberIfTheNumberIsNinetyNine() {
21-
let localized = NumberFormatter.localizedUpToNinetyNine(99)
21+
let localized = NumberFormatter.localizedOrNinetyNinePlus(99)
2222

2323
XCTAssertEqual(localized, NumberFormatter.localizedString(from: NSNumber(value: 99), number: .none))
2424
}

0 commit comments

Comments
 (0)