From 94a2ba3cecfd6fd1d51f824945903fdcaed1c235 Mon Sep 17 00:00:00 2001 From: Brad Slayter Date: Tue, 31 Oct 2023 09:36:42 -0500 Subject: [PATCH 1/2] Only show DBP for US users --- .../NavigationBar/View/MoreOptionsMenu.swift | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/DuckDuckGo/NavigationBar/View/MoreOptionsMenu.swift b/DuckDuckGo/NavigationBar/View/MoreOptionsMenu.swift index bfdc4978f3..cd04538ae4 100644 --- a/DuckDuckGo/NavigationBar/View/MoreOptionsMenu.swift +++ b/DuckDuckGo/NavigationBar/View/MoreOptionsMenu.swift @@ -328,12 +328,22 @@ final class MoreOptionsMenu: NSMenu { #endif // NETWORK_PROTECTION #if DBP - let dataBrokerProtectionItem = NSMenuItem(title: UserText.dataBrokerProtectionOptionsMenuItem, - action: #selector(openDataBrokerProtection), - keyEquivalent: "") - .targetting(self) - .withImage(NSImage(named: "BurnerWindowIcon2")) // PLACEHOLDER: Change it once we have the final icon - items.append(dataBrokerProtectionItem) + var regionCode: String? + if #available(macOS 13, *) { + regionCode = Locale.current.region?.identifier + } else { + regionCode = Locale.current.regionCode + } + + // Only show Private Information Removal (DBP) for US based users + if (regionCode ?? "US") == "US" { + let dataBrokerProtectionItem = NSMenuItem(title: UserText.dataBrokerProtectionOptionsMenuItem, + action: #selector(openDataBrokerProtection), + keyEquivalent: "") + .targetting(self) + .withImage(NSImage(named: "BurnerWindowIcon2")) // PLACEHOLDER: Change it once we have the final icon + items.append(dataBrokerProtectionItem) + } #endif // DBP #if SUBSCRIPTION From 628522b2ac454a843b36c517f66457271c486d80 Mon Sep 17 00:00:00 2001 From: Brad Slayter Date: Tue, 31 Oct 2023 11:51:26 -0500 Subject: [PATCH 2/2] Set to US for debug builds --- DuckDuckGo/NavigationBar/View/MoreOptionsMenu.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DuckDuckGo/NavigationBar/View/MoreOptionsMenu.swift b/DuckDuckGo/NavigationBar/View/MoreOptionsMenu.swift index cd04538ae4..8a9da7f16f 100644 --- a/DuckDuckGo/NavigationBar/View/MoreOptionsMenu.swift +++ b/DuckDuckGo/NavigationBar/View/MoreOptionsMenu.swift @@ -335,6 +335,10 @@ final class MoreOptionsMenu: NSMenu { regionCode = Locale.current.regionCode } + #if DEBUG // Always assume US for debug builds + regionCode = "US" + #endif + // Only show Private Information Removal (DBP) for US based users if (regionCode ?? "US") == "US" { let dataBrokerProtectionItem = NSMenuItem(title: UserText.dataBrokerProtectionOptionsMenuItem,