Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Note: text is displayed twice #17808

Merged
merged 1 commit into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,26 @@ public void OnGetExternalWallet(String externalWallet) {
setPublisherNoteText(pubStatus, walletStatus);
}

private String getWalletStringFromType(String walletType) {
if (walletType.equals(BraveWalletProvider.UPHOLD)) {
return getResources().getString(R.string.uphold);
} else if (walletType.equals(BraveWalletProvider.GEMINI)) {
return getResources().getString(R.string.gemini);
} else {
return getResources().getString(R.string.bitflyer);
}
}

private String getWalletStringFromStatus(int pubStatus) {
if (pubStatus == PublisherStatus.UPHOLD_VERIFIED) {
return getResources().getString(R.string.uphold);
} else if (pubStatus == PublisherStatus.GEMINI_VERIFIED) {
return getResources().getString(R.string.gemini);
} else {
return getResources().getString(R.string.bitflyer);
}
}

@SuppressLint("ClickableViewAccessibility")
private void setPublisherNoteText(int pubStatus, int walletStatus) {
String notePart1 = "";
Expand All @@ -300,10 +320,9 @@ private void setPublisherNoteText(int pubStatus, int walletStatus) {
&& !walletType.equals(BraveWalletProvider.BITFLYER))
|| (pubStatus == PublisherStatus.GEMINI_VERIFIED
&& !walletType.equals(BraveWalletProvider.GEMINI))) {
notePart1 = getResources().getString(
R.string.brave_ui_site_banner_different_verified_notice_text);
Log.d(TAG,
"User is verified and publisher is verified but not with the same provider");
notePart1 = String.format(
getString(R.string.brave_ui_site_banner_different_verified_notice_text1),
getWalletStringFromType(walletType), getWalletStringFromStatus(pubStatus));
}
}

Expand Down
4 changes: 2 additions & 2 deletions browser/ui/android/strings/android_brave_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -838,8 +838,8 @@ This file contains all "about" strings. It is set to NOT be translated, in tran
<message name="IDS_BRAVE_UI_SITE_BANNER_UNVERIFIED_NOTICE_TEXT" desc="A message on tipping page when a creator is not verified yet">
This creator has not yet signed up to receive contributions from Brave users. We'll keep trying to contribute until they verify, or until 90 days have passed.
</message>
<message name="IDS_BRAVE_UI_SITE_BANNER_DIFFERENT_VERIFIED_NOTICE_TEXT" desc="A message on tipping page when a creator is not verified yet">
NOTE: This creator is currently not configured to receive tips from your Rewards custodial wallet service. Any tip you make will remain pending and retry automatically for 90 days.
<message name="IDS_BRAVE_UI_SITE_BANNER_DIFFERENT_VERIFIED_NOTICE_TEXT1" desc="A message on tipping page when a creator is not verified yet">
You're connected to <ph name="WALLET_PROVIDER">%1$s</ph>, but this creator is connected to <ph name="SUPPORTED_WALLET_PROVIDER">%2$s</ph>. This means your tip can't reach this creator. For now, any tip you make will remain pending and retry automatically for 90 days.
</message>
<message name="IDS_BRAVE_UI_SITE_BANNER_WELCOME" desc="Tipping page title">
Welcome!
Expand Down