Skip to content

Commit 364cee2

Browse files
authored
Merge pull request #357 from code-payments/chore/strings-update
chore: update strings from localise
2 parents 2c09469 + 2eff14e commit 364cee2

8 files changed

Lines changed: 63 additions & 44 deletions

File tree

app/src/main/java/com/getcode/navigation/screens/MainScreens.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
package com.getcode.navigation.screens
22

33
import androidx.compose.runtime.Composable
4-
import androidx.compose.runtime.CompositionLocalProvider
5-
import androidx.compose.runtime.collectAsState
6-
import androidx.compose.runtime.getValue
74
import androidx.compose.ui.platform.LocalLifecycleOwner
85
import androidx.compose.ui.res.stringResource
96
import androidx.lifecycle.Lifecycle
107
import cafe.adriel.voyager.core.screen.ScreenKey
118
import cafe.adriel.voyager.core.screen.uniqueScreenKey
129
import cafe.adriel.voyager.hilt.getViewModel
13-
import com.getcode.LocalBetaFlags
14-
import com.getcode.LocalBuyModuleAvailable
1510
import com.getcode.R
16-
import com.getcode.TopLevelViewModel
1711
import com.getcode.analytics.AnalyticsManager
1812
import com.getcode.analytics.AnalyticsScreenWatcher
1913
import com.getcode.model.KinAmount

app/src/main/java/com/getcode/navigation/screens/Modals.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import cafe.adriel.voyager.core.screen.Screen
2424
import cafe.adriel.voyager.core.screen.ScreenKey
2525
import cafe.adriel.voyager.core.screen.uniqueScreenKey
2626
import com.getcode.LocalBetaFlags
27-
import com.getcode.LocalBuyModuleAvailable
2827
import com.getcode.TopLevelViewModel
2928
import com.getcode.navigation.core.CodeNavigator
3029
import com.getcode.navigation.core.LocalCodeNavigator
@@ -138,7 +137,6 @@ internal fun Screen.ModalContainer(
138137
CompositionLocalProvider(
139138
LocalOverscrollConfiguration provides null,
140139
LocalBetaFlags provides state.betaFlags,
141-
LocalBuyModuleAvailable provides state.buyModuleAvailable
142140
) {
143141
screenContent()
144142
}

app/src/main/java/com/getcode/ui/components/chat/utils/LocalizedText.kt

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,27 @@ fun Verb.localizedText(resources: ResourceHelper): String {
152152
Verb.Received,
153153
Verb.Sent,
154154
Verb.Spent,
155-
Verb.Withdrew,
156-
Verb.ReceivedTip,
157-
Verb.SentTip -> {
155+
Verb.Withdrew -> {
158156
resources.getIdentifier(
159157
"subtitle_you${this@localizedText.toString().capitalize(Locale.ENGLISH)}",
160158
ResourceType.String,
161159
).let { if (it == 0) null else it }
162160
}
163161

162+
Verb.ReceivedTip -> {
163+
resources.getIdentifier(
164+
"subtitle_someoneTippedYou",
165+
ResourceType.String,
166+
).let { if (it == 0) null else it }
167+
}
168+
169+
Verb.SentTip -> {
170+
resources.getIdentifier(
171+
"subtitle_youTipped",
172+
ResourceType.String,
173+
).let { if (it == 0) null else it }
174+
}
175+
164176
Verb.Returned -> {
165177
resources.getIdentifier(
166178
"subtitle_was${this@localizedText.toString().capitalize(Locale.ENGLISH)}ToYou",
@@ -187,16 +199,30 @@ val Verb.localizedText: String
187199
Verb.Received,
188200
Verb.Sent,
189201
Verb.Spent,
190-
Verb.Withdrew,
191-
Verb.ReceivedTip,
192-
Verb.SentTip -> {
202+
Verb.Withdrew -> {
193203
resources.getIdentifier(
194204
"subtitle_you${this@localizedText.toString().capitalize(Locale.ENGLISH)}",
195205
"string",
196206
BuildConfig.APPLICATION_ID
197207
).let { if (it == 0) null else it }
198208
}
199209

210+
Verb.ReceivedTip -> {
211+
resources.getIdentifier(
212+
"subtitle_someoneTippedYou",
213+
"string",
214+
BuildConfig.APPLICATION_ID
215+
).let { if (it == 0) null else it }
216+
}
217+
218+
Verb.SentTip -> {
219+
resources.getIdentifier(
220+
"subtitle_youTipped",
221+
"string",
222+
BuildConfig.APPLICATION_ID
223+
).let { if (it == 0) null else it }
224+
}
225+
200226
Verb.Returned -> {
201227
resources.getIdentifier(
202228
"subtitle_was${this@localizedText.toString().capitalize(Locale.ENGLISH)}ToYou",

app/src/main/java/com/getcode/view/main/home/HomeScan.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ import androidx.compose.ui.platform.LocalFocusManager
4444
import androidx.compose.ui.unit.dp
4545
import androidx.core.net.toUri
4646
import androidx.lifecycle.Lifecycle
47-
import com.getcode.LocalBetaFlags
48-
import com.getcode.LocalBuyModuleAvailable
4947
import com.getcode.R
5048
import com.getcode.manager.TopBarManager
5149
import com.getcode.models.Bill

app/src/main/java/com/getcode/view/main/tip/RequestTipScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private fun ColumnScope.RequestContent(state: TipConnectViewModel.State, onClick
8080
style = CodeTheme.typography.h1
8181
)
8282
Text(
83-
text = stringResource(id = R.string.subtitle_requestTip),
83+
text = stringResource(id = R.string.subtitle_tipCardForX),
8484
style = CodeTheme.typography.body2
8585
)
8686
Spacer(modifier = Modifier.weight(0.3f))

app/src/main/java/com/getcode/view/main/tip/TipConnectViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class TipConnectViewModel @Inject constructor(
5858
).joinToString(":")
5959

6060
val message = """
61-
${resources.getString(R.string.action_connect_to_x_message)}
61+
${resources.getString(R.string.subtitle_linkingTwitter)}
6262
6363
$verificationMessage
6464
""".trimIndent()

app/src/main/res/values/strings-localized.xml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,21 @@
44
<string name="action_allowContacts">Allow Access to Contacts</string>
55
<string name="action_allowPushNotifications">Allow Push Notifications</string>
66
<string name="action_balance">Balance</string>
7+
<string name="action_buyKin">Buy Kin</string>
78
<string name="action_buyMoreKin">Buy More Kin</string>
89
<string name="action_cancel">Cancel</string>
910
<string name="action_cancelSend">Cancel Send</string>
1011
<string name="action_collectCash">Collect This Cash</string>
1112
<string name="action_confirm">Confirm</string>
13+
<string name="action_connectToX">Connect to X</string>
1214
<string name="action_continue">Continue</string>
1315
<string name="action_copied">Copied</string>
1416
<string name="action_copy">Copy</string>
1517
<string name="action_copyAddress">Copy Address</string>
1618
<string name="action_createAccount">Create an Account</string>
1719
<string name="action_createNewCodeAccount">Create a New Code Account</string>
1820
<string name="action_deleteAccount">Delete Account</string>
21+
<string name="action_done">Done</string>
1922
<string name="action_downloadNow">Download It Now</string>
2023
<string name="action_enableFaceID">Enable Face ID</string>
2124
<string name="action_enableTouchID">Enable Touch ID</string>
@@ -24,6 +27,7 @@
2427
<string name="action_invite">Invite</string>
2528
<string name="action_invites">Invites</string>
2629
<string name="action_joinWaitlist">Join the Waitlist</string>
30+
<string name="action_later">Later</string>
2731
<string name="action_learnBuyKin">Learn How to Buy Kin</string>
2832
<string name="action_learnSellKin">Learn How to Sell Kin</string>
2933
<string name="action_linkPhoneNumber">Link a Phone Number</string>
@@ -42,15 +46,19 @@
4246
<string name="action_remind">Remind</string>
4347
<string name="action_removePhoneNumber">Remove Phone Number</string>
4448
<string name="action_removeYourPhoneNumber">Remove Your Phone Number</string>
49+
<string name="action_requestTip">Request a Tip</string>
4550
<string name="action_saveAccessKey">Save Access Key to My Photos</string>
4651
<string name="action_saveToPhotos">Save to Photos</string>
4752
<string name="action_send">Send</string>
4853
<string name="action_sendVerificationCode">Send Verification Code</string>
54+
<string name="action_share">Share</string>
4955
<string name="action_shareDownloadLink">Share Download Link</string>
5056
<string name="action_shareVideo">Share This Video</string>
57+
<string name="action_showMyTipCard">Show My Tip Card</string>
5158
<string name="action_subscribe">Subscribe</string>
5259
<string name="action_swipeToLogin">Swipe to Login</string>
5360
<string name="action_swipeToPay">Swipe to Pay</string>
61+
<string name="action_swipeToTip">Swipe to Tip</string>
5462
<string name="action_tryDifferentCodeAccount">Try a Different Code Account</string>
5563
<string name="action_unmute">Unmute</string>
5664
<string name="action_unsubscribe">Unsubscribe</string>
@@ -86,6 +94,7 @@
8694
<string name="error_description_insuffiecientKin">To learn how to get more Kin go to the FAQ in Settings.</string>
8795
<string name="error_description_invalidInviteCode">Please enter a different Invite Code and try again.</string>
8896
<string name="error_description_invalidInvitePhone">Please enter a valid phone number and try again.</string>
97+
<string name="error_description_invalidTipCard">This is an invalid Tip Card.</string>
8998
<string name="error_description_invalidVerificationCode">Please enter a valid code and try again.</string>
9099
<string name="error_description_invitationFailed">Sorry, we experienced a network issue. Please try inviting your friend again.</string>
91100
<string name="error_description_linkExpired">This Kin was automatically returned to the sender because it wasn\'t collected within 24 hours. Please ask them to send the Kin again.</string>
@@ -96,6 +105,8 @@
96105
<string name="error_description_purchaseTooLarge">The maximum you can purchase is %1$s. Please enter a smaller amount.</string>
97106
<string name="error_description_purchaseTooSmall">The minimum you can purchase is %1$s. Please enter a larger amount.</string>
98107
<string name="error_description_timelockUnlocked">Your Access Key has initiated an unlock. As a result, you will no longer be able to use this Access Key in Code.</string>
108+
<string name="error_description_tipTooLarge">The maximum you can tip is %1$s. Please enter a smaller amount.</string>
109+
<string name="error_description_tipTooSmall">The minimum you can tip is %1$s. Please enter a larger amount.</string>
99110
<string name="error_description_tooManyAccounts">You can only create so many new accounts each day.</string>
100111
<string name="error_title_alreadyCollected">Kin Already Collected</string>
101112
<string name="error_title_alreadyCollectedBySomeone">Kin Already Collected</string>
@@ -113,16 +124,19 @@
113124
<string name="error_title_insuffiecientKin">Insufficient Kin</string>
114125
<string name="error_title_invalidInviteCode">Invite Code Invalid or Expired</string>
115126
<string name="error_title_invalidInvitePhone">Invalid Phone Number</string>
127+
<string name="error_title_invalidTipCard">Invalid Tip Card</string>
116128
<string name="error_title_invalidVerificationCode">Invalid Code</string>
117129
<string name="error_title_invitationFailed">Invitation Failed</string>
118130
<string name="error_title_linkExpired">Link Expired</string>
119131
<string name="error_title_maxAttemptsReached">Maximum Attempts Reached</string>
120132
<string name="error_title_noInternet">No Internet Connection</string>
121133
<string name="error_title_noInvitesLeft">You Have No Invites</string>
122134
<string name="error_title_notInvitedYet">You Haven\'t Been Invited Yet</string>
123-
<string name="error_title_purchaseTooLarge">Purchase Too Large</string>
124-
<string name="error_title_purchaseTooSmall">Purchase Too Small</string>
135+
<string name="error_title_purchaseTooLarge">Purchase Too large</string>
136+
<string name="error_title_purchaseTooSmall">Purchase Too small</string>
125137
<string name="error_title_timelockUnlocked">Access Key No Longer Usable in Code</string>
138+
<string name="error_title_tipTooLarge">Tip Too Large</string>
139+
<string name="error_title_tipTooSmall">Tip Too Small</string>
126140
<string name="error_title_tooManyAccounts">Too many accounts created</string>
127141
<string name="faq_a__1">Code is a payments app that makes it simple to send money to anyone, anywhere in the world.</string>
128142
<string name="faq_a__10">We plan to sustain ourselves through an upcoming subscription model, similar to what Signal and Twitter do.</string>
@@ -193,6 +207,7 @@
193207
<string name="subtitle_buyKinComingSoon">Buy Kin (Coming Soon)</string>
194208
<string name="subtitle_buySellDescription">Buying and selling Kin is currently a complex process. These processes will get simpler over time. If you want to learn how to buy and sell Kin today you can watch the walk through videos below.</string>
195209
<string name="subtitle_canOnlyGiveUpTo">You can only give up to %1$s</string>
210+
<string name="subtitle_canOnlyTipUpTo">You can only tip up to %1$s</string>
196211
<string name="subtitle_chat_kinAvailableForUse">Your Kin is now available for use in your Code App</string>
197212
<string name="subtitle_chat_referralBonus">You sent someone their first Kin! Here is your referral bonus:</string>
198213
<string name="subtitle_chat_usdcBeingConverted">Thank you for opening Code, your purchase is now being completed. Your Kin should be available soon</string>
@@ -223,6 +238,7 @@
223238
<string name="subtitle_inviteText">Code is a new crypto wallet app that is currently invite only. To download Code go to %1$s</string>
224239
<string name="subtitle_learnMore">Learn more</string>
225240
<string name="subtitle_linkedPhoneNumberDescription">Your phone number is linked with this Code account. Friends can find you using this phone number.</string>
241+
<string name="subtitle_linkingTwitter">I\'m connecting my X account with @getcode so I can receive tips from people all over the world.</string>
226242
<string name="subtitle_loadingBalance">Loading your balance and transaction history</string>
227243
<string name="subtitle_loginDescription">Check your photos for the Access Key you saved when you first created your account.</string>
228244
<string name="subtitle_logoutAndLoginConfirmation">You\'re currently logged into an account. Please ensure you have saved your Access Key before proceeding. Would you like to logout and login with a new account?</string>
@@ -235,6 +251,7 @@
235251
<string name="subtitle_phoneNotInContacts">This phone number is not in your Contacts. You can still invite them to Code.</string>
236252
<string name="subtitle_phoneVerificationDescription">Enter your phone number including the country code. Make sure you use the same phone number that received the invite.</string>
237253
<string name="subtitle_poweredBy">Powered by</string>
254+
<string name="subtitle_push_twitterAccountConnected">You can now request tips</string>
238255
<string name="subtitle_referralBonusReceived">Referral bonus received</string>
239256
<string name="subtitle_remoteSendShareSheetTitle">Send %1$s</string>
240257
<string name="subtitle_remoteSendSubject">Here\'s %1$s</string>
@@ -244,6 +261,8 @@
244261
<string name="subtitle_searchForContacts">Search for contacts</string>
245262
<string name="subtitle_smsWasSent">An SMS message was sent to your phone number with a verification code. Please enter the verification code above.</string>
246263
<string name="subtitle_someoneSendYouCash">Someone sent you cash</string>
264+
<string name="subtitle_someoneTippedYou">Someone tipped you</string>
265+
<string name="subtitle_tipCardForX">Your Tip Card lets you to receive tips from Code users all over the world. To access your Tip Card connect your X identity.</string>
247266
<string name="subtitle_typeDelete">Type \"%1$s\"</string>
248267
<string name="subtitle_updateRequiredDescription">We\'ve made some changes to improve the experience. You\'ll need to update the app to keep using Code.</string>
249268
<string name="subtitle_validOwnerAccount">Valid owner account</string>
@@ -261,9 +280,12 @@
261280
<string name="subtitle_youReceived">You received</string>
262281
<string name="subtitle_youSent">You sent</string>
263282
<string name="subtitle_youSpent">You spent</string>
283+
<string name="subtitle_youTipped">You tipped someone</string>
264284
<string name="subtitle_youWithdrew">You withdrew</string>
265285
<string name="success_description_withdrawalComplete">Your funds have been successfully withdrawn.</string>
286+
<string name="success_description_xConnected">Your X account has been successfully connected to your Code account. You can now request Tips.</string>
266287
<string name="success_title_withdrawalComplete">Withdrawal Successful</string>
288+
<string name="success_title_xConnected">X Account Successfully Connected</string>
267289
<string name="title_accessExpired">Access Expired</string>
268290
<string name="title_accessKey">Access Key</string>
269291
<string name="title_balance">Balance</string>
@@ -274,6 +296,7 @@
274296
<string name="title_chat_codeTeam">Code Team</string>
275297
<string name="title_chat_kinPurchases">Kin Purchases</string>
276298
<string name="title_chat_payments">Web Payments</string>
299+
<string name="title_chat_tips">Tips</string>
277300
<string name="title_debugOptions">Debug Options</string>
278301
<string name="title_depositKin">Deposit Kin</string>
279302
<string name="title_deposited">Deposited</string>
@@ -299,11 +322,13 @@
299322
<string name="title_phoneNumber">Phone Number</string>
300323
<string name="title_privacyPolicy">Privacy Policy</string>
301324
<string name="title_purchased">Purchased</string>
325+
<string name="title_push_twitterAccountConnected">X Account Successfully Connected</string>
302326
<string name="title_received">Received</string>
303327
<string name="title_recentCurrencies">Recent Currencies</string>
304328
<string name="title_referFriend">Refer a Friend, Get $5</string>
305329
<string name="title_referralBonus">Referral Bonus</string>
306330
<string name="title_requestKin">Request Kin</string>
331+
<string name="title_requestTip">Request a Tip</string>
307332
<string name="title_results">Results</string>
308333
<string name="title_returned">Returned</string>
309334
<string name="title_selectAccount">Select an Account</string>
@@ -313,6 +338,7 @@
313338
<string name="title_spentKin">Spent</string>
314339
<string name="title_switchAccounts">Switch Accounts</string>
315340
<string name="title_termsOfService">Terms of Service</string>
341+
<string name="title_tipKin">Tip Kin</string>
316342
<string name="title_unknown">Unknown</string>
317343
<string name="title_updateRequired">Update Required</string>
318344
<string name="title_verifyPhoneNumber">Verify Phone Number</string>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,14 @@
1717
<string name="today">Today</string>
1818
<string name="yesterday">Yesterday</string>
1919

20-
<string name="action_requestTip">Request a Tip</string>
21-
<string name="title_requestTip">Request a Tip</string>
2220
<string name="action_tipKin">Tip Kin</string>
23-
<string name="action_swipeToTip">Swipe to Tip</string>
24-
<string name="subtitle_canOnlyTipUpTo">You can only tip up to %1$s</string>
25-
<string name="error_title_invalidTipCard">Invalid Tip Card</string>
26-
<string name="error_description_invalidTipCard">This is an invalid Tip Card.</string>
21+
2722
<string name="error_title_buyModuleUnavailable">Temporarily Unavailable</string>
2823
<string name="error_description_buyModuleUnavailable">The ability to buy Kin is temporarily unavailable due to network congestion. Please try again later.</string>
29-
<string name="error_title_tipTooLarge">Tip Too Large</string>
30-
<string name="error_title_tipTooSmall">Tip Too Small</string>
31-
<string name="error_description_tipTooSmall">The minimum you can tip is %1$s. Please enter a larger amount.</string>
32-
<string name="error_description_tipTooLarge">The maximum you can tip is %1$s. Please enter a smaller amount.</string>
33-
<string name="subtitle_requestTip">Your Tip Card lets you to receive tips from Code users all over the world. To access your Tip Card post to X.</string>
3424
<string name="action_connectXAccount">Post to Connect Your Account</string>
35-
<string name="action_share">Share</string>
36-
<string name="action_done">Done</string>
37-
<string name="action_connect_to_x_message">I\’m connecting my X account with @getcode so I can receive tips from people all over the world.</string>
3825

3926
<string name="title_success">Success</string>
40-
<string name="subtitle_xAccountConnected">Your X account %1$s is now connected to your Code account.</string>
41-
42-
<string name="action_showMyTipCard">Show My Tip Card</string>
43-
44-
<string name="subtitle_youReceivedTip">Someone tipped you</string>
45-
<string name="subtitle_youSentTip">You tipped someone</string>
4627

47-
<string name="title_chat_tips">Tips</string>
4828
<string name="subtitle_tips_linked_to_account">Tips linked to %1$s account: %2$s</string>
49-
<string name="success_title_xConnected">X Account Successfully Connected</string>
50-
<string name="success_description_xConnected">Your X account has been successfully connected to your Code account. You can now request Tips.</string>
51-
<string name="action_later">Later</string>
5229
<string name="action_sayThankYou">Say Thank You</string>
5330
</resources>

0 commit comments

Comments
 (0)