Merge commit '7621e2f8dec938cf48181c8b10afc9b01f444e68' into beta

This commit is contained in:
Ilya Laktyushin
2025-12-06 02:17:48 +04:00
commit 8344b97e03
28070 changed files with 7995182 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
swift_library(
name = "StringPluralization",
module_name = "StringPluralization",
srcs = glob([
"Sources/**/*.swift",
]),
copts = [
"-warnings-as-errors",
],
deps = [
"//submodules/NumberPluralizationForm:NumberPluralizationForm",
"//submodules/AppBundle:AppBundle",
],
visibility = [
"//visibility:public",
],
)
@@ -0,0 +1,47 @@
import Foundation
import NumberPluralizationForm
public enum PluralizationForm: Int32 {
case zero = 0
case one = 1
case two = 2
case few = 3
case many = 4
case other = 5
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"
}
}
}
public func getPluralizationForm(_ 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
@unknown default:
fatalError()
}
}