Skip to content

Commit

Permalink
fix strings
Browse files Browse the repository at this point in the history
Signed-off-by: Vadym Struts <[email protected]>
  • Loading branch information
vadimstruts committed Jan 8, 2025
1 parent d478494 commit 665778f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

import android.content.SharedPreferences;
import android.os.Bundle;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;

import androidx.preference.Preference;
Expand Down Expand Up @@ -298,17 +296,15 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
mBlockCrosssiteCookiesLearnMore =
(TextMessagePreference) findPreference(BLOCK_CROSS_SITE_COOKIES_LEARN_MORE);
if (mBlockCrosssiteCookiesLearnMore != null) {
SpannableString blockAllCookiesDeprecatedWarning =
new SpannableString(getString(R.string.block_cookies_deprecated_label));
blockAllCookiesDeprecatedWarning.setSpan(
new ForegroundColorSpan(getContext().getColor(R.color.wallet_error_text_color)),
0,
blockAllCookiesDeprecatedWarning.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);

SpannableString learnMoreDesc =
SpanApplier.applySpans(
getString(R.string.block_cookies_deprecated_link_label),
getString(R.string.block_cookies_deprecated_label),
new SpanApplier.SpanInfo(
"<LINK_0>",
"</LINK_0>",
new ForegroundColorSpan(
getContext()
.getColor(R.color.wallet_error_text_color))),
new SpanApplier.SpanInfo(
"<LINK_1>",
"</LINK_1>",
Expand All @@ -320,10 +316,7 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
requireContext(),
BLOCK_ALL_COOKIES_LEARN_MORE_LINK);
})));
SpannableStringBuilder spannableBuilder = new SpannableStringBuilder();
spannableBuilder.append(blockAllCookiesDeprecatedWarning);
spannableBuilder.append(learnMoreDesc);
mBlockCrosssiteCookiesLearnMore.setSummary(spannableBuilder);
mBlockCrosssiteCookiesLearnMore.setSummary(learnMoreDesc);
}

mBlockScriptsPref = (ChromeSwitchPreference) findPreference(PREF_BLOCK_SCRIPTS);
Expand Down
5 changes: 1 addition & 4 deletions browser/ui/android/strings/android_brave_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -1550,10 +1550,7 @@ Are you sure you want to do this?
Allow all trackers &amp; ads
</message>
<message name="IDS_BLOCK_COOKIES_DEPRECATED_LABEL" desc="Block all cookies deprecation warning">
The "Block all Cookies" option has been deprecated. To learn how to force-enable this option, visit
</message>
<message name="IDS_BLOCK_COOKIES_DEPRECATED_LINK_LABEL" desc="Block all cookies deprecation warning link">
<ph name="BEGIN_LINK_1">&lt;LINK_1&gt;</ph> our help page<ph name="END_LINK_1">&lt;/LINK_1&gt;</ph>
<ph name="BEGIN_LINK_0">&lt;LINK_0&gt;</ph>The "Block all Cookies" option has been deprecated. To learn how to force-enable this option, visit<ph name="END_LINK_0">&lt;/LINK_0&gt;</ph> <ph name="BEGIN_LINK_1">&lt;LINK_1&gt;</ph>our help page<ph name="END_LINK_1">&lt;/LINK_1&gt;</ph>
</message>
<message name="IDS_BLOCK_COOKIES" desc="Title for shields option.">
Block Cookies
Expand Down

0 comments on commit 665778f

Please sign in to comment.