Fix localization issues and export strings for translation

This commit is contained in:
2023-12-07 14:49:07 -08:00
parent 14fd06c052
commit 9d42715d76
14 changed files with 463 additions and 43 deletions

View File

@@ -361,7 +361,7 @@ struct SignInEntry: View {
shouldSaveKey: shouldSaveKey,
privKeyFound: $privKeyFound)
if privKeyFound {
Toggle("Save Key in Secure Keychain", isOn: shouldSaveKey)
Toggle(NSLocalizedString("Save Key in Secure Keychain", comment: "Toggle to save private key to the Apple secure keychain."), isOn: shouldSaveKey)
}
}
}

View File

@@ -188,7 +188,7 @@ struct NoteContentView: View {
.frame(height: 1)
switch artifacts.media[index] {
case .image(let url), .video(let url):
Text("\(url)")
Text(url.absoluteString)
.font(eventviewsize_to_font(size, font_size: damus_state.settings.font_size))
.foregroundStyle(DamusColors.neutral6)
.multilineTextAlignment(.leading)

View File

@@ -55,7 +55,7 @@ struct PullDownSearchView: View {
var body: some View {
VStack(alignment: .leading) {
HStack {
TextField("Search", text: $search_text)
TextField(NSLocalizedString("Search", comment: "Title of the text field for searching."), text: $search_text)
.textFieldStyle(RoundedBorderTextFieldStyle())
.onChange(of: search_text) { query in
debouncer.debounce {
@@ -75,7 +75,7 @@ struct PullDownSearchView: View {
end_editing()
on_cancel()
}, label: {
Text("Cancel")
Text("Cancel", comment: "Button to cancel out of search text entry mode.")
})
}
}

View File

@@ -17,12 +17,12 @@ struct DeveloperSettingsView: View {
Toggle(NSLocalizedString("Developer Mode", comment: "Setting to enable developer mode"), isOn: $settings.developer_mode)
.toggleStyle(.switch)
if settings.developer_mode {
Toggle("Always show onboarding", isOn: $settings.always_show_onboarding_suggestions)
Toggle(NSLocalizedString("Always show onboarding", comment: "Developer mode setting to always show onboarding suggestions."), isOn: $settings.always_show_onboarding_suggestions)
Toggle("Enable experimental push notifications", isOn: $settings.enable_experimental_push_notifications)
Toggle(NSLocalizedString("Enable experimental push notifications", comment: "Developer mode setting to enable experimental push notifications."), isOn: $settings.enable_experimental_push_notifications)
.toggleStyle(.switch)
Toggle("Send device token to localhost", isOn: $settings.send_device_token_to_localhost)
Toggle(NSLocalizedString("Send device token to localhost", comment: "Developer mode setting to send device token metadata to a local server instead of the damus.io server."), isOn: $settings.send_device_token_to_localhost)
.toggleStyle(.switch)
}
}

View File

@@ -102,14 +102,11 @@ struct SuggestedHashtagsView: View {
SingleCharacterAvatar(character: "#")
VStack(alignment: .leading, spacing: 10) {
Text("#\(hashtag)")
Text(verbatim: "#\(hashtag)")
.bold()
Text(self.count != 1 ? String(
format: NSLocalizedString("%d users talking about it", comment: "A label indicating how many users have been talking about a hashtag"),
self.count
) : NSLocalizedString("1 user talking about it", comment: "A label indicating 1 user has been talking about a hashtag"))
.foregroundStyle(.secondary)
Text(pluralizedString(key: "users_talking_about_it", count: self.count))
.foregroundStyle(.secondary)
}
Spacer()

View File

@@ -100,7 +100,7 @@ struct DamusVideoPlayer: View {
private var live_indicator: some View {
VStack {
HStack {
Text("LIVE")
Text("LIVE", comment: "Text indicator that the video is a livestream.")
.bold()
.foregroundColor(.red)
.padding(.horizontal)