added language support

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-09-25 15:06:02 -05:00
parent 0372e278fc
commit fd7545159c
2 changed files with 15 additions and 0 deletions

View File

@ -145,6 +145,7 @@ class LabelViewController: BaseViewController<Label> {
override func setupForm(){
super.setupForm()
addFormRow(label: "Current Language", view: Label().with { $0.text = LanguageManager.currentLanguage.description })
addFormRow(label: "Disabled", view: disabledSwitch, pinTrailing: false)
addFormRow(label: "Bold", view: boldSwitch, pinTrailing: false)
addFormRow(label: "Surface", view: surfacePickerSelectorView)

View File

@ -127,6 +127,20 @@ class MenuViewController: UITableViewController, TooltipLaunchable {
navigationItem.rightBarButtonItem = UIBarButtonItem(customView: tooltip)
}
var useSpanish = Toggle().with {
$0.offText = "English"
$0.onText = "Spanish"
$0.showText = true
$0.textPosition = .right
}
useSpanish.isOn = LanguageManager.currentLanguage == .spanish
useSpanish.onChange = { control in
LanguageManager.currentLanguage = control.isOn ? .spanish : .english
}
navigationItem.leftBarButtonItem = UIBarButtonItem(customView: useSpanish)
super.viewDidLoad()
overrideUserInterfaceStyle = .light
tableView.register(MenuCell.self, forCellReuseIdentifier: "cell")