Skip to content

Commit 910977d

Browse files
dmitrysimkincaldrian
authored andcommitted
fix: max participants 2000 formatting with locale - WPB-17344 (#3058)
1 parent e06527e commit 910977d

File tree

7 files changed

+25
-21
lines changed

7 files changed

+25
-21
lines changed

wire-ios/Wire-iOS/Generated/Strings+Generated.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,13 +1172,13 @@ internal enum L10n {
11721172
/// The conversation is full
11731173
internal static let title = L10n.tr("Localizable", "add_participants.alert.title", fallback: "The conversation is full")
11741174
internal enum Message {
1175-
/// Up to %1$d people can join a conversation. Currently there is only room for %2$d more.
1176-
internal static func existingConversation(_ p1: Int, _ p2: Int) -> String {
1177-
return L10n.tr("Localizable", "add_participants.alert.message.existing_conversation", p1, p2, fallback: "Up to %1$d people can join a conversation. Currently there is only room for %2$d more.")
1175+
/// Up to %@ people can join a conversation. Currently there is only room for %@ more.
1176+
internal static func existingConversation(_ p1: Any, _ p2: Any) -> String {
1177+
return L10n.tr("Localizable", "add_participants.alert.message.existing_conversation", String(describing: p1), String(describing: p2), fallback: "Up to %@ people can join a conversation. Currently there is only room for %@ more.")
11781178
}
1179-
/// Up to %d people can join a conversation.
1180-
internal static func newConversation(_ p1: Int) -> String {
1181-
return L10n.tr("Localizable", "add_participants.alert.message.new_conversation", p1, fallback: "Up to %d people can join a conversation.")
1179+
/// Up to %@ people can join a conversation.
1180+
internal static func newConversation(_ p1: Any) -> String {
1181+
return L10n.tr("Localizable", "add_participants.alert.message.new_conversation", String(describing: p1), fallback: "Up to %@ people can join a conversation.")
11821182
}
11831183
}
11841184
}
@@ -4469,9 +4469,9 @@ internal enum L10n {
44694469
internal static let footer = L10n.tr("Localizable", "participants.section.members.footer", fallback: "There are no members.")
44704470
}
44714471
internal enum Name {
4472-
/// Up to %1$d participants can join a conversation.
4473-
internal static func footer(_ p1: Int) -> String {
4474-
return L10n.tr("Localizable", "participants.section.name.footer", p1, fallback: "Up to %1$d participants can join a conversation.")
4472+
/// Up to %@ participants can join a conversation.
4473+
internal static func footer(_ p1: Any) -> String {
4474+
return L10n.tr("Localizable", "participants.section.name.footer", String(describing: p1), fallback: "Up to %@ participants can join a conversation.")
44754475
}
44764476
}
44774477
}

wire-ios/Wire-iOS/Resources/Localization/Base.lproj/Localizable.strings

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@
102102
"peoplepicker.federation.domain_unvailable" = "The federated domain is currently not available. [Learn more](%@)";
103103

104104
"add_participants.alert.title" = "The conversation is full";
105-
"add_participants.alert.message.new_conversation" = "Up to %d people can join a conversation.";
106-
"add_participants.alert.message.existing_conversation" = "Up to %1$d people can join a conversation. Currently there is only room for %2$d more.";
105+
"add_participants.alert.message.new_conversation" = "Up to %@ people can join a conversation.";
106+
"add_participants.alert.message.existing_conversation" = "Up to %@ people can join a conversation. Currently there is only room for %@ more.";
107107

108108
// Channel Creation UI - Navigation
109109
"conversation.create.channel.title" = "New channel";
@@ -860,7 +860,7 @@
860860
"participants.section.services" = "Services (%d)";
861861
"participants.section.settings" = "Options";
862862
"participants.footer.add_title" = "Add Participants";
863-
"participants.section.name.footer" = "Up to %1$d participants can join a conversation.";
863+
"participants.section.name.footer" = "Up to %@ participants can join a conversation.";
864864
"participants.section.admins.footer" = "There are no admins.";
865865
"participants.section.members.footer" = "There are no members.";
866866

wire-ios/Wire-iOS/Resources/Localization/de.lproj/Localizable.strings

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@
102102
"peoplepicker.federation.domain_unvailable" = "Die föderierte Domain ist derzeit nicht verfügbar. [Mehr erfahren](%@)";
103103

104104
"add_participants.alert.title" = "Die Unterhaltung ist voll";
105-
"add_participants.alert.message.new_conversation" = "Bis zu %d Personen können an einer Unterhaltung teilnehmen.";
106-
"add_participants.alert.message.existing_conversation" = "Bis zu %1$d Personen können an einer Unterhaltung teilnehmen. Jetzt ist noch Platz für %2$d weitere.";
105+
"add_participants.alert.message.new_conversation" = "Bis zu %@ Personen können an einer Unterhaltung teilnehmen.";
106+
"add_participants.alert.message.existing_conversation" = "Bis zu %@ Personen können an einer Unterhaltung teilnehmen. Jetzt ist noch Platz für %2$d weitere.";
107107

108108
// Channel Creation UI - Navigation
109109
"conversation.create.channel.title" = "Neuer Channel";
@@ -860,7 +860,7 @@
860860
"participants.section.services" = "Dienste (%d)";
861861
"participants.section.settings" = "Optionen";
862862
"participants.footer.add_title" = "Teilnehmer hinzufügen";
863-
"participants.section.name.footer" = "Bis zu %1$d Personen können an einer Unterhaltung teilnehmen.";
863+
"participants.section.name.footer" = "Bis zu %@ Personen können an einer Unterhaltung teilnehmen.";
864864
"participants.section.admins.footer" = "Es gibt keine Admins.";
865865
"participants.section.members.footer" = "Es gibt keine Mitglieder.";
866866

wire-ios/Wire-iOS/Resources/Localization/ru.lproj/Localizable.strings

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
"peoplepicker.federation.domain_unvailable" = "Федеративный домен в настоящее время недоступен. [Подробнее](%@)";
103103

104104
"add_participants.alert.title" = "Беседа переполнена";
105-
"add_participants.alert.message.new_conversation" = "К беседе могут присоединиться до %d человек.";
105+
"add_participants.alert.message.new_conversation" = "К беседе могут присоединиться до %@ человек.";
106106
"add_participants.alert.message.existing_conversation" = "К беседе может присоединиться до %1$d человек. На текущий момент в комнате есть места еще для %2$d.";
107107

108108
// Channel Creation UI - Navigation
@@ -860,7 +860,7 @@
860860
"participants.section.services" = "Сервисы (%d)";
861861
"participants.section.settings" = "Настройки";
862862
"participants.footer.add_title" = "Добавить участников";
863-
"participants.section.name.footer" = "К беседе могут присоединиться до %1$d участников.";
863+
"participants.section.name.footer" = "К беседе могут присоединиться до %@ участников.";
864864
"participants.section.admins.footer" = "Здесь нет администраторов.";
865865
"participants.section.members.footer" = "Здесь нет участников.";
866866

wire-ios/Wire-iOS/Sources/UserInterface/AddContacts/AddParticipantsViewController.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,14 @@ extension AddParticipantsViewController.Context {
7777
case let .add(conversation):
7878
let freeSpace = conversation.freeParticipantSlots
7979
let max = ZMConversation.getMaxParticipants(isChannel: conversation.isChannel)
80-
message = AddParticipantsAlert.Message.existingConversation(max, freeSpace)
80+
message = AddParticipantsAlert.Message
81+
.existingConversation(
82+
max.formatted(.number),
83+
freeSpace.formatted(.number)
84+
)
8185
case let .create(context):
8286
message = AddParticipantsAlert.Message
83-
.newConversation(ZMConversation.getMaxParticipants(isChannel: context.isChannel))
87+
.newConversation(ZMConversation.getMaxParticipants(isChannel: context.isChannel).formatted(.number))
8488
}
8589

8690
let controller = UIAlertController(

wire-ios/Wire-iOS/Sources/UserInterface/Conversation/Create/Sections/ConversationCreateNameSectionController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ final class ConversationCreateNameSectionController: NSObject, CollectionViewSec
3838
private let isChannel: Bool
3939

4040
private lazy var footerText: String = L10n.Localizable.Participants.Section.Name
41-
.footer(ZMConversation.getMaxParticipants(isChannel: isChannel))
41+
.footer(ZMConversation.getMaxParticipants(isChannel: isChannel).formatted(.number))
4242

4343
init(
4444
selfUser: UserType,

wire-ios/Wire-iOS/Sources/UserInterface/GroupDetails/Sections/RenameGroupSectionController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class RenameGroupSectionController: NSObject, CollectionViewSectionControl
3535

3636
var titleFooter: String {
3737
L10n.Localizable.Participants.Section.Name
38-
.footer(ZMConversation.getMaxParticipants(isChannel: conversation.isChannel))
38+
.footer(ZMConversation.getMaxParticipants(isChannel: conversation.isChannel).formatted(.number))
3939
}
4040

4141
init(conversation: GroupDetailsConversationType, userSession: UserSession) {

0 commit comments

Comments
 (0)