-
Notifications
You must be signed in to change notification settings - Fork 893
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update localizations and translation settings. Obey translate setting…
…s when disabled so URL-Bar doesn't show the button when disabled
- Loading branch information
Showing
18 changed files
with
448 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
ios/brave-ios/Sources/Brave/Frontend/Browser/Translate/BraveTranslateSettingsView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright 2024 The Brave Authors. All rights reserved. | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
import BraveStrings | ||
import BraveUI | ||
import Preferences | ||
import Shared | ||
import SwiftUI | ||
|
||
struct BraveTranslateSettingsView: View { | ||
@ObservedObject | ||
private var translateEnabled = Preferences.Translate.translateEnabled | ||
|
||
var body: some View { | ||
Form { | ||
Section { | ||
Toggle(isOn: $translateEnabled.value) { | ||
Text(Strings.BraveTranslate.settingsTranslateEnabledOptionTitle) | ||
} | ||
.toggleStyle(SwitchToggleStyle(tint: .accentColor)) | ||
.listRowBackground(Color(.secondaryBraveGroupedBackground)) | ||
} footer: { | ||
Text(Strings.BraveTranslate.settingsTranslateEnabledOptionDescription) | ||
} | ||
} | ||
.listStyle(.insetGrouped) | ||
.listBackgroundColor(Color(UIColor.braveGroupedBackground)) | ||
.navigationTitle(Strings.BraveTranslate.settingsScreenTitle) | ||
} | ||
} | ||
|
||
#if DEBUG | ||
struct BraveTranslateSettingsView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
BraveTranslateSettingsView() | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.