added language support
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
0372e278fc
commit
fd7545159c
@ -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)
|
||||
|
||||
@ -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")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user