Skip to content

Commit 247ebba

Browse files
Update network Dax dialog copy (#907)
1 parent 8373695 commit 247ebba

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

app/src/main/java/com/duckduckgo/app/cta/ui/Cta.kt

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.duckduckgo.app.cta.ui
1818

19+
import android.annotation.SuppressLint
1920
import android.content.Context
2021
import android.net.Uri
2122
import android.view.View
@@ -212,21 +213,32 @@ sealed class DaxDialogCta(
212213
appInstallStore
213214
) {
214215

216+
@SuppressLint("StringFormatMatches")
215217
@ExperimentalStdlibApi
216218
override fun getDaxText(context: Context): String {
217219
val percentage = networkPropertyPercentages[network]
218220

219221
return if (isFromSameNetworkDomain()) {
220222
context.resources.getString(R.string.daxMainNetworkCtaText, network, percentage, network)
221223
} else {
222-
context.resources.getString(
223-
R.string.daxMainNetworkOwnedCtaText,
224-
Uri.parse(siteHost).baseHost?.removePrefix("m.")?.capitalize(Locale.getDefault()),
225-
network,
226-
network,
227-
percentage,
228-
network
229-
)
224+
val locale = Locale.getDefault()
225+
if (locale != null && locale.language == "en") {
226+
context.resources.getString(
227+
R.string.daxMainNetworkOwnedCtaText,
228+
network,
229+
Uri.parse(siteHost).baseHost?.removePrefix("m."),
230+
network
231+
)
232+
} else {
233+
context.resources.getString(
234+
R.string.daxMainNetworkOwnedCtaText,
235+
Uri.parse(siteHost).baseHost?.removePrefix("m.")?.capitalize(Locale.getDefault()),
236+
network,
237+
network,
238+
percentage,
239+
network
240+
)
241+
}
230242
}
231243
}
232244

app/src/main/res/values/string-untranslated.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,7 @@
5454
<!-- Dos Attack error-->
5555
<string name="dosErrorMessage">Connection aborted. This website could be harmful to your device.</string>
5656

57+
<!-- Dax Dialog, this string has changed. We have to translate and replace it!! -->
58+
<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>
59+
5760
</resources>

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@
404404
<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>
405405
</plurals>
406406
<string name="daxNonSerpCtaText"><![CDATA[As you tap and scroll, I\'ll block pesky trackers. <br/><br/>Go ahead — keep browsing!]]></string>
407-
<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>
408407
<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>
409408

410409
<!-- Download Confirmation -->

0 commit comments

Comments
 (0)