mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
45 lines
932 B
Swift
45 lines
932 B
Swift
import Foundation
|
|
|
|
enum PluralizationForm {
|
|
case zero
|
|
case one
|
|
case two
|
|
case few
|
|
case many
|
|
case other
|
|
|
|
var name: String {
|
|
switch self {
|
|
case .zero:
|
|
return "zero"
|
|
case .one:
|
|
return "one"
|
|
case .two:
|
|
return "two"
|
|
case .few:
|
|
return "few"
|
|
case .many:
|
|
return "many"
|
|
case .other:
|
|
return "other"
|
|
}
|
|
}
|
|
}
|
|
|
|
func presentationStringsPluralizationForm(_ lc: UInt32, _ value: Int32) -> PluralizationForm {
|
|
switch numberPluralizationForm(lc, value) {
|
|
case .zero:
|
|
return .zero
|
|
case .one:
|
|
return .one
|
|
case .two:
|
|
return .two
|
|
case .few:
|
|
return .few
|
|
case .many:
|
|
return .many
|
|
case .other:
|
|
return .other
|
|
}
|
|
}
|