From 2f4e33fc9ff2fb6ec6bc98e191bc81704a70af01 Mon Sep 17 00:00:00 2001 From: Terry Yiu <963907+tyiu@users.noreply.github.com> Date: Tue, 4 Apr 2023 10:26:02 -0400 Subject: [PATCH] Fix localization issues and export strings for translation --- damus/Models/Wallet.swift | 26 +-- damus/Views/ReplyView.swift | 15 +- .../Localized Contents/en-US.xliff | 158 +++++++----------- .../damus/en-US.lproj/Localizable.strings | Bin 77876 -> 77480 bytes 4 files changed, 87 insertions(+), 112 deletions(-) diff --git a/damus/Models/Wallet.swift b/damus/Models/Wallet.swift index 4d430dd6..d436135d 100644 --- a/damus/Models/Wallet.swift +++ b/damus/Models/Wallet.swift @@ -42,42 +42,42 @@ enum Wallet: String, CaseIterable, Identifiable { return .init(index: -1, tag: "systemdefaultwallet", displayName: NSLocalizedString("Local default", comment: "Dropdown option label for system default for Lightning wallet."), link: "lightning:", appStoreLink: "lightning:", image: "") case .strike: - return .init(index: 0, tag: "strike", displayName: NSLocalizedString("Strike", comment: "Dropdown option label for Lightning wallet, Strike."), link: "strike:", + return .init(index: 0, tag: "strike", displayName: "Strike", link: "strike:", appStoreLink: "https://apps.apple.com/us/app/strike-bitcoin-payments/id1488724463", image: "strike") case .cashapp: - return .init(index: 1, tag: "cashapp", displayName: NSLocalizedString("Cash App", comment: "Dropdown option label for Lightning wallet, Cash App."), link: "https://cash.app/launch/lightning/", + return .init(index: 1, tag: "cashapp", displayName: "Cash App", link: "https://cash.app/launch/lightning/", appStoreLink: "https://apps.apple.com/us/app/cash-app/id711923939", image: "cashapp") case .muun: - return .init(index: 2, tag: "muun", displayName: NSLocalizedString("Muun", comment: "Dropdown option label for Lightning wallet, Muun."), link: "muun:", appStoreLink: "https://apps.apple.com/us/app/muun-wallet/id1482037683", image: "muun") + return .init(index: 2, tag: "muun", displayName: "Muun", link: "muun:", appStoreLink: "https://apps.apple.com/us/app/muun-wallet/id1482037683", image: "muun") case .bluewallet: - return .init(index: 3, tag: "bluewallet", displayName: NSLocalizedString("Blue Wallet", comment: "Dropdown option label for Lightning wallet, Blue Wallet."), link: "bluewallet:lightning:", + return .init(index: 3, tag: "bluewallet", displayName: "Blue Wallet", link: "bluewallet:lightning:", appStoreLink: "https://apps.apple.com/us/app/bluewallet-bitcoin-wallet/id1376878040", image: "bluewallet") case .walletofsatoshi: - return .init(index: 4, tag: "walletofsatoshi", displayName: NSLocalizedString("Wallet of Satoshi", comment: "Dropdown option label for Lightning wallet, Wallet of Satoshi."), link: "walletofsatoshi:lightning:", + return .init(index: 4, tag: "walletofsatoshi", displayName: "Wallet of Satoshi", link: "walletofsatoshi:lightning:", appStoreLink: "https://apps.apple.com/us/app/wallet-of-satoshi/id1438599608", image: "walletofsatoshi") case .zebedee: - return .init(index: 5, tag: "zebedee", displayName: NSLocalizedString("Zebedee", comment: "Dropdown option label for Lightning wallet, Zebedee."), link: "zebedee:lightning:", + return .init(index: 5, tag: "zebedee", displayName: "Zebedee", link: "zebedee:lightning:", appStoreLink: "https://apps.apple.com/us/app/zebedee-wallet/id1484394401", image: "zebedee") case .zeusln: - return .init(index: 6, tag: "zeusln", displayName: NSLocalizedString("Zeus LN", comment: "Dropdown option label for Lightning wallet, Zeus LN."), link: "zeusln:lightning:", + return .init(index: 6, tag: "zeusln", displayName: "Zeus LN", link: "zeusln:lightning:", appStoreLink: "https://apps.apple.com/us/app/zeus-ln/id1456038895", image: "zeusln") case .lnlink: - return .init(index: 7, tag: "lnlink", displayName: NSLocalizedString("LNLink", comment: "Dropdown option label for Lightning wallet, LNLink."), link: "lnlink:lightning:", + return .init(index: 7, tag: "lnlink", displayName: "LNLink", link: "lnlink:lightning:", appStoreLink: "https://testflight.apple.com/join/aNY4yuuZ", image: "lnlink") case .phoenix: - return .init(index: 8, tag: "phoenix", displayName: NSLocalizedString("Phoenix", comment: "Dropdown option label for Lightning wallet, Phoenix."), link: "phoenix://", + return .init(index: 8, tag: "phoenix", displayName: "Phoenix", link: "phoenix://", appStoreLink: "https://apps.apple.com/us/app/phoenix-wallet/id1544097028", image: "phoenix") case .breez: - return .init(index: 9, tag: "breez", displayName: NSLocalizedString("Breez", comment: "Dropdown option label for Lightning wallet, Breez."), link: "breez:", + return .init(index: 9, tag: "breez", displayName: "Breez", link: "breez:", appStoreLink: "https://apps.apple.com/us/app/breez-lightning-client-pos/id1463604142", image: "breez") case .bitcoinbeach: - return .init(index: 10, tag: "bitcoinbeach", displayName: NSLocalizedString("Bitcoin Beach", comment: "Dropdown option label for Lightning wallet, Bitcoin Beach."), link: "bitcoinbeach://", + return .init(index: 10, tag: "bitcoinbeach", displayName: "Bitcoin Beach", link: "bitcoinbeach://", appStoreLink: "https://apps.apple.com/sv/app/bitcoin-beach-wallet/id1531383905", image: "bbw") case .blixtwallet: - return .init(index: 11, tag: "blixtwallet", displayName: NSLocalizedString("Blixt Wallet", comment: "Dropdown option label for Lightning wallet, Blixt Wallet"), link: "blixtwallet:lightning:", + return .init(index: 11, tag: "blixtwallet", displayName: "Blixt Wallet", link: "blixtwallet:lightning:", appStoreLink: "https://testflight.apple.com/join/EXvGhRzS", image: "blixt-wallet") case .river: - return .init(index: 12, tag: "river", displayName: NSLocalizedString("River", comment: "Dropdown option label for Lightning wallet, River"), link: "river://", + return .init(index: 12, tag: "river", displayName: "River", link: "river://", appStoreLink: "https://apps.apple.com/us/app/river-buy-mine-bitcoin/id1536176542", image: "river") } diff --git a/damus/Views/ReplyView.swift b/damus/Views/ReplyView.swift index 410af4a6..d90de481 100644 --- a/damus/Views/ReplyView.swift +++ b/damus/Views/ReplyView.swift @@ -25,12 +25,15 @@ struct ReplyView: View { return "@" + Profile.displayName(profile: prof, pubkey: pk).username } .joined(separator: " ") - Text("Replying to ", comment: "Indicating that the user is replying to the following listed people.") - .foregroundColor(.gray) - .font(.footnote) + - Text(names.isEmpty ? "self" : names) - .foregroundColor(.accentColor) - .font(.footnote) + if names.isEmpty { + Text("Replying to \(Text("self", comment: "Part of a larger sentence 'Replying to self' in US English. 'self' indicates that the user is replying to themself and no one else.").foregroundColor(.accentColor).font(.footnote))", comment: "Indicating that the user is replying to the themself and no one else, where the parameter is 'self' in US English.") + .foregroundColor(.gray) + .font(.footnote) + } else { + Text("Replying to \(Text(verbatim: names).foregroundColor(.accentColor).font(.footnote))", comment: "Indicating that the user is replying to the following listed people.") + .foregroundColor(.gray) + .font(.footnote) + } } .onTapGesture { participantsShown.toggle() diff --git a/damus/en-US.xcloc/Localized Contents/en-US.xliff b/damus/en-US.xcloc/Localized Contents/en-US.xliff index 904e084f..01a64340 100644 --- a/damus/en-US.xcloc/Localized Contents/en-US.xliff +++ b/damus/en-US.xcloc/Localized Contents/en-US.xliff @@ -205,21 +205,11 @@ Sentence composed of 2 variables to describe how many people are following a use Before we get started, you'll need to save your account info, otherwise you won't be able to login in the future if you ever uninstall Damus. Reminder to user that they should save their account information. - - Bitcoin Beach - Bitcoin Beach - Dropdown option label for Lightning wallet, Bitcoin Beach. - Bitcoin Lightning Tips Bitcoin Lightning Tips Label for Bitcoin Lightning Tips section of user profile form. - - Blixt Wallet - Blixt Wallet - Dropdown option label for Lightning wallet, Blixt Wallet - Block Block @@ -247,11 +237,6 @@ Sentence composed of 2 variables to describe how many people are following a use Blocked Users Navigation title of view to see list of blocked users. - - Blue Wallet - Blue Wallet - Dropdown option label for Lightning wallet, Blue Wallet. - Bookmarks Bookmarks @@ -263,11 +248,6 @@ Sentence composed of 2 variables to describe how many people are following a use Boosts Accessibility label for boosts button - - Breez - Breez - Dropdown option label for Lightning wallet, Breez. - Broadcast Broadcast @@ -286,10 +266,10 @@ Sentence composed of 2 variables to describe how many people are following a use Cancel deleting the user. Cancel out of logging out the user. - - Cash App - Cash App - Dropdown option label for Lightning wallet, Cash App. + + Choose from Library + Choose from Library + Option to select photo from library Clear All @@ -349,8 +329,7 @@ Sentence composed of 2 variables to describe how many people are following a use Copy Image Copy Image - Context menu option to copy an image into clipboard. - Context menu option to copy an image to clipboard. + Context menu option to copy an image into clipboard. Copy Image URL @@ -397,6 +376,11 @@ Sentence composed of 2 variables to describe how many people are following a use Copy invoice Title of section for copying a Lightning invoice identifier. + + Could not find the user you're looking for + Could not find the user you're looking for + Indicates that there are no users found. + Could not find user to block... Could not find user to block... @@ -432,11 +416,17 @@ Sentence composed of 2 variables to describe how many people are following a use Custom Zap Amount Header text to indicate that the text field below it is to enter a custom zap amount. + + DM by %@ + DM by %@ + DM by heading in local notification + DMs DMs Navigation title for DMs view, where DM is the English abbreviation for Direct Message. Navigation title for view of DMs, where DM is an English abbreviation for Direct Message. + Setting to enable DM Local Notification Toolbar label for DMs view, where DM is the English abbreviation for Direct Message. @@ -525,11 +515,6 @@ Sentence composed of 2 variables to describe how many people are following a use Edit Button to edit user's profile. - - Edit participants - Edit participants - Text indicating that the view is used for editing which participants are replied to in a note. - Encrypted Encrypted @@ -651,11 +636,6 @@ Sentence composed of 2 variables to describe how many people are following a use It's spam Button for user to report that the account or content has spam. - - LNLink - LNLink - Dropdown option label for Lightning wallet, LNLink. - Left Handed Left Handed @@ -686,11 +666,26 @@ Sentence composed of 2 variables to describe how many people are following a use Like Accessibility Label for Like button + + Liked by %@ + Liked by %@ + Liked by heading in local notification + + + Likes + Likes + Setting to enable Like Local Notification + Load %lld more Load %lld more Button text for loading more events, where the variable is the number of events. + + Local Notifications + Local Notifications + Section header for damus local notifications user configuration + Local authentication to access private key Local authentication to access private key @@ -724,20 +719,15 @@ Sentence composed of 2 variables to describe how many people are following a use Make sure your nsec account key is saved before you logout or you will lose access to this account Reminder message in alert to get customer to verify that their private security account key is saved saved before logging out. + + Mentioned by %@ + Mentioned by %@ + Mentioned by heading in local notification + Mentions Mentions - Label for filter for seeing mention notifications (replies, etc). - - - Miscellaneous - Miscellaneous - Section header for miscellaneous user configuration - - - Muun - Muun - Dropdown option label for Lightning wallet, Muun. + Setting to enable Mention Local Notification NIP-05 Verification @@ -825,11 +815,6 @@ Sentence composed of 2 variables to describe how many people are following a use Alert for deleting the users account. Section title for deleting the user - - Phoenix - Phoenix - Dropdown option label for Lightning wallet, Phoenix. - Plan Plan @@ -967,6 +952,11 @@ Picker option to indicate that a zap should be sent privately and not identify t Reply Accessibility label for reply button + + Replying to + Replying to + Text indicating that the view is used for editing which participants are replied to in a note. + Replying to %@ Replying to %@ @@ -982,11 +972,6 @@ Picker option to indicate that a zap should be sent privately and not identify t Replying to self Label to indicate that the user is replying to themself. - - Replying to: - Replying to: - Indicating that the user is replying to the following listed people. - Report Report @@ -1014,10 +999,16 @@ Picker option to indicate that a zap should be sent privately and not identify t Reposted Text indicating that the post was reposted (i.e. re-shared). + + Reposted by %@ + Reposted by %@ + Reposted by heading in local notification + Reposts Reposts - Navigation bar title for Reposts view. + Navigation bar title for Reposts view. + Setting to enable Repost Local Notification Requests @@ -1029,11 +1020,6 @@ Picker option to indicate that a zap should be sent privately and not identify t Retry Button to retry completing account creation after an error occurred. - - River - River - Dropdown option label for Lightning wallet, River - Satoshi Nakamoto Satoshi Nakamoto @@ -1169,16 +1155,16 @@ Picker option to indicate that a zap should be sent privately and not identify t Software Label to display relay software. - - Strike - Strike - Dropdown option label for Lightning wallet, Strike. - Supported NIPs Supported NIPs Label to display relay's supported NIPs. + + Take Photo + Take Photo + Option to take a photo with the camera + Thanks! Thanks! @@ -1234,11 +1220,6 @@ Picker option to indicate that a zap should be sent privately and not identify t Translated from %@ Button to indicate that the note has been translated from a different language. - - Translating from %@... - Translating from %@... - Button to indicate that the note is in the process of being translated from a different language. - Translations Translations @@ -1318,15 +1299,10 @@ YOU WILL NO LONGER BE ABLE TO LOG INTO DAMUS USING THIS ACCOUNT KEY. Wallet Sidebar menu label for Wallet view. - - Wallet Selector - Wallet Selector - Section title for selection of wallet. - - - Wallet of Satoshi - Wallet of Satoshi - Dropdown option label for Lightning wallet, Wallet of Satoshi. + + Wallet and others + Wallet and others + Section header for miscellaneous user configuration Website @@ -1408,17 +1384,8 @@ YOU WILL NO LONGER BE ABLE TO LOG INTO DAMUS USING THIS ACCOUNT KEY. Zaps Zaps - Navigation bar title for the Zaps view. - - - Zebedee - Zebedee - Dropdown option label for Lightning wallet, Zebedee. - - - Zeus LN - Zeus LN - Dropdown option label for Lightning wallet, Zeus LN. + Navigation bar title for the Zaps view. + Setting to enable Zap Local Notification https://example.com/pic.jpg @@ -1535,6 +1502,11 @@ YOU WILL NO LONGER BE ABLE TO LOG INTO DAMUS USING THIS ACCOUNT KEY. satoshi Example username of Bitcoin creator(s), Satoshi Nakamoto. + + self + self + Part of a larger sentence 'Replying to self' in US English. 'self' indicates that the user is replying to themself and no one else. + wss://some.relay.com wss://some.relay.com diff --git a/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.strings b/damus/en-US.xcloc/Source Contents/damus/en-US.lproj/Localizable.strings index 26972180a4d79e6da57e60d3d68e720873dc3368..18b326bdcef3495583614eb38b6aa9cd324b0bc6 100644 GIT binary patch delta 1676 zcma)6T})eL82%0%$Z1pBGfI2tO4*T3i<7}v=QJ_85t%^)TA8~sA?^o|W~DSO3v%Jy zyzuA7R3G##v0KdIh1tl091{{V7cO?=VhoxwrU7ktIgS!k!k{V~k_i^Ls1u zTPXG-DA+;6yQai4- z_|bZ+$sx*7$!C#Ig?S{R6Y&wMIx2=YPFtmudI@pk2@*hG7eS|-xX5Y4R~NLdq}VpD z^AI5n3Eg8t@o)(#OkWr0_Aom{=Yxd%s@T>v8^LH)gZ}jnGr8DXCAR+Jtvj->pRkft zGc8azojZKzT`wN5(guof7D z*?wbLliXfw0=d`o=_FG%IyFi2lw}ej{QSBP^IfjFLZfuIq2hA4yi9D9#NNK~!cvUe MyQEg*NQZReAG}1q7XSbN delta 1524 zcmZ{kTS!zv7{_OH({h5NbvdBw9~}nGa$TVSVT5dS;6_%rf);W`6VCX77H~jLc{v z`#iAFEy2p54fcXWb73NooK!+W%LP*bGw8hOaM3d=atd;Z zL`q0KsUsbv4d+$JtH&>-thSMSq9dEd9jw$r9f@m4AP~$1|6M)zdVAwVt|`jBfFz{C z<0S`rR8N$(%D^R@2xi`JU_e8YW+?ROxzQI#Mb@5GRtu6sq?6ib)fGBJOXS3jNChmwIz}{~@~;tdnl=eolaCzaBcu&HQ@# zVuG9z){~4OJvnUTGu3S-7=Lbu>p>e&2>avMiiKwL@rKcO*5jgX@b_8a=9^wP-mHZk z6R8&U)&ryl3)2P#6KTx1joNu%^FoFgQIQ@WeO@E=+BG?DbL0u zL$5c0`_^T!4wpa#wy--6dZ?%rp{>|mA*CZu;RPYmh!t$bEJw5b-#swfogeL1rOQh3 z&!%59^7i2?PBG&Ba>RbDUn4qmUTIqq7;90nF*^S?65hllEw%E6 zx98%Z=a>i