@@ -92,18 +92,34 @@ private extension EditableProductModel {
9292 return nil
9393 }
9494 let numberOfVariations = product. variations. count
95- let singularFormat = NSLocalizedString ( " %ld variant " , comment : " Label about one product variation shown on Products tab " )
96- let pluralFormat = NSLocalizedString ( " %ld variants " , comment : " Label about number of variations shown on Products tab " )
97- let format = String . pluralize ( numberOfVariations , singular : singularFormat , plural: pluralFormat )
95+ let format = String . pluralize ( numberOfVariations ,
96+ singular : Localization . VariationCount . singular ,
97+ plural: Localization . VariationCount . plural )
9898 return String . localizedStringWithFormat ( format, numberOfVariations)
9999 }
100100}
101101
102+ // MARK: Localization
103+ //
104+ private extension EditableProductModel {
105+ enum Localization {
106+ enum VariationCount {
107+ static let singular = NSLocalizedString ( " %1$ld variation " ,
108+ comment: " Label about one product variation shown on Products tab. Reads, `1 variation` " )
109+ static let plural = NSLocalizedString ( " %1$ld variations " ,
110+ comment: " Label about number of variations shown on Products tab. Reads, `2 variations` " )
111+ }
112+ }
113+ }
114+
102115private extension ProductsTabProductViewModel {
103116 enum Localization {
104- static let noTitle = NSLocalizedString ( " (No Title) " , comment: " Product title in Products list when there is no title " )
117+ static let noTitle = NSLocalizedString ( " (No Title) " ,
118+ comment: " Product title in Products list when there is no title " )
119+
105120 static func variationID( variationID: String ) -> String {
106- let titleFormat = NSLocalizedString ( " #%1$@ " , comment: " Variation ID. Parameters: %1$@ - Product variation ID " )
121+ let titleFormat = NSLocalizedString ( " #%1$@ " ,
122+ comment: " Variation ID. Parameters: %1$@ - Product variation ID " )
107123 return String . localizedStringWithFormat ( titleFormat, variationID)
108124 }
109125 }
0 commit comments