Render multiple translators in Credits (#701)

This commit is contained in:
Davide 2024-10-09 21:42:42 +02:00 committed by GitHub
parent df2fc54044
commit 6d479a7059
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 17 deletions

View File

@ -31,18 +31,18 @@
"message": "© Copyright 2015-2024 Jason A. Donenfeld. All Rights Reserved. \"WireGuard\" and the \"WireGuard\" logo are registered trademarks of Jason A. Donenfeld."
}],
"translations": {
"de": "Christian Lederer, Theodor Tietze",
"el": "Konstantinos Koukoulakis",
"en-US": "Davide De Rosa",
"es": "Davide De Rosa, Elena Vivó",
"fr-FR": "Julien Laniel",
"it": "Davide De Rosa",
"nl": "Norbert de Vreede",
"pl": "Piotr Książek",
"pt-BR": "Helder Santana",
"ru": "Alexander Korobynikov",
"sv": "Henry Gross-Hellsen",
"uk": "Dmitry Chirkin",
"zh-Hans": "OnlyThen"
"de": ["Christian Lederer", "Theodor Tietze"],
"el": ["Konstantinos Koukoulakis"],
"en-US": ["Davide De Rosa"],
"es": ["Davide De Rosa", "Elena Vivó"],
"fr-FR": ["Julien Laniel"],
"it": ["Davide De Rosa"],
"nl": ["Norbert de Vreede"],
"pl": ["Piotr Książek"],
"pt-BR": ["Helder Santana"],
"ru": ["Alexander Korobynikov"],
"sv": ["Henry Gross-Hellsen"],
"uk": ["Dmitry Chirkin"],
"zh-Hans": ["OnlyThen"]
}
}

View File

@ -46,7 +46,7 @@ public struct Credits: Decodable {
public let notices: [Notice]
public let translations: [String: String]
public let translations: [String: [String]]
}
public struct GenericCreditsView: View {
@ -180,9 +180,13 @@ private extension GenericCreditsView {
HStack {
Text(code.localizedAsCountryCode)
Spacer()
credits.translations[code].map { author in
Text(author)
.padding()
credits.translations[code].map { authors in
VStack(spacing: 4) {
ForEach(authors, id: \.self) {
Text($0)
.frame(maxWidth: .infinity, alignment: .trailing)
}
}
}
}
}