Skip to content
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
28 changes: 20 additions & 8 deletions app/src/main/java/com/duckduckgo/app/cta/ui/Cta.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.duckduckgo.app.cta.ui

import android.annotation.SuppressLint
import android.content.Context
import android.net.Uri
import android.view.View
Expand Down Expand Up @@ -212,21 +213,32 @@ sealed class DaxDialogCta(
appInstallStore
) {

@SuppressLint("StringFormatMatches")
@ExperimentalStdlibApi
override fun getDaxText(context: Context): String {
val percentage = networkPropertyPercentages[network]

return if (isFromSameNetworkDomain()) {
context.resources.getString(R.string.daxMainNetworkCtaText, network, percentage, network)
} else {
context.resources.getString(
R.string.daxMainNetworkOwnedCtaText,
Uri.parse(siteHost).baseHost?.removePrefix("m.")?.capitalize(Locale.getDefault()),
network,
network,
percentage,
network
)
val locale = Locale.getDefault()
if (locale != null && locale.language == "en") {
context.resources.getString(
R.string.daxMainNetworkOwnedCtaText,
network,
Uri.parse(siteHost).baseHost?.removePrefix("m."),
network
)
} else {
context.resources.getString(
R.string.daxMainNetworkOwnedCtaText,
Uri.parse(siteHost).baseHost?.removePrefix("m.")?.capitalize(Locale.getDefault()),
network,
network,
percentage,
network
)
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/string-untranslated.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,7 @@
<!-- Dos Attack error-->
<string name="dosErrorMessage">Connection aborted. This website could be harmful to your device.</string>

<!-- Dax Dialog, this string has changed. We have to translate and replace it!! -->
<string name="daxMainNetworkOwnedCtaText">Heads up! Since %s owns %s, I can\'t stop them from seeing your activity here.&lt;br/&gt;&lt;br/&gt;But browse with me, and I can reduce what %s knows about you overall by blocking their trackers on lots of other sites.</string>

</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@
<item quantity="other"><![CDATA[&#160;were trying to track you here. <br/><br/>I blocked it!<br/><br/> ☝️You can check the URL bar to see who is trying to track you when you visit a new site.️]]></item>
</plurals>
<string name="daxNonSerpCtaText"><![CDATA[As you tap and scroll, I\'ll block pesky trackers. <br/><br/>Go ahead — keep browsing!]]></string>
<string name="daxMainNetworkOwnedCtaText"><![CDATA[Heads up! %s is owned by %s.<br/><br/> %s\'s trackers lurk on about %s of top websites 😱 but don\'t worry!<br/><br/>I\'ll block %s from seeing your activity on those sites.]]></string>
<string name="daxMainNetworkCtaText"><![CDATA[Heads up! %s is a major tracking network.<br/><br/> Their trackers lurk on about %s of top sites 😱 but don\'t worry!<br/><br/>I\'ll block %s from seeing your activity on those sites.]]></string>

<!-- Download Confirmation -->
Expand Down