Fix: access to localization strings for Dapp browser was not going through R

pull/717/head
Hwee-Boon Yar 6 years ago
parent 3eafebfc81
commit 8309301fa8
  1. 4
      AlphaWallet/Browser/ViewControllers/BookmarkViewController.swift
  2. 4
      AlphaWallet/Browser/ViewControllers/HistoryViewController.swift
  3. 2
      AlphaWallet/Browser/Views/BrowserErrorView.swift
  4. 2
      AlphaWallet/Browser/Views/BrowserNavigationBar.swift
  5. 5
      AlphaWallet/Localization/en.lproj/Localizable.strings
  6. 5
      AlphaWallet/Localization/es.lproj/Localizable.strings
  7. 5
      AlphaWallet/Localization/zh-Hans.lproj/Localizable.strings

@ -33,7 +33,7 @@ final class BookmarkViewController: UIViewController {
tableView.rowHeight = 60 tableView.rowHeight = 60
tableView.register(R.nib.bookmarkViewCell(), forCellReuseIdentifier: R.nib.bookmarkViewCell.name) tableView.register(R.nib.bookmarkViewCell(), forCellReuseIdentifier: R.nib.bookmarkViewCell.name)
view.addSubview(tableView) view.addSubview(tableView)
emptyView = EmptyView(title: NSLocalizedString("bookmarks.noBookmarks.label.title", value: "No bookmarks yet!", comment: "")) emptyView = EmptyView(title: R.string.localizable.browserNoBookmarksLabelTitle())
NSLayoutConstraint.activate([ NSLayoutConstraint.activate([
tableView.trailingAnchor.constraint(equalTo: view.trailingAnchor), tableView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
@ -55,7 +55,7 @@ final class BookmarkViewController: UIViewController {
} }
func confirmDelete(bookmark: Bookmark, index: IndexPath) { func confirmDelete(bookmark: Bookmark, index: IndexPath) {
confirm(title: NSLocalizedString("browser.bookmarks.confirm.delete.title", value: "Are you sure you would like to delete this bookmark?", comment: ""), confirm(title: R.string.localizable.browserBookmarksConfirmDeleteTitle(),
okTitle: R.string.localizable.delete(), okTitle: R.string.localizable.delete(),
okStyle: .destructive) { [weak self] result in okStyle: .destructive) { [weak self] result in
guard let strongSelf = self else { return } guard let strongSelf = self else { return }

@ -29,7 +29,7 @@ final class HistoryViewController: UIViewController {
tableView.rowHeight = 60 tableView.rowHeight = 60
tableView.register(R.nib.bookmarkViewCell(), forCellReuseIdentifier: R.nib.bookmarkViewCell.name) tableView.register(R.nib.bookmarkViewCell(), forCellReuseIdentifier: R.nib.bookmarkViewCell.name)
view.addSubview(tableView) view.addSubview(tableView)
emptyView = EmptyView(title: NSLocalizedString("history.noHistory.label.title", value: "No history yet!", comment: "")) emptyView = EmptyView(title: R.string.localizable.browserNoHistoryLabelTitle())
NSLayoutConstraint.activate([ NSLayoutConstraint.activate([
tableView.trailingAnchor.constraint(equalTo: view.trailingAnchor), tableView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
@ -98,7 +98,7 @@ extension HistoryViewController: UITableViewDelegate {
if editingStyle == .delete { if editingStyle == .delete {
let history = viewModel.item(for: indexPath) let history = viewModel.item(for: indexPath)
confirm( confirm(
title: NSLocalizedString("Are you sure you would like to delete?", value: "Are you sure you would like to delete?", comment: ""), title: R.string.localizable.browserHistoryConfirmDeleteTitle(),
okTitle: R.string.localizable.delete(), okTitle: R.string.localizable.delete(),
okStyle: .destructive okStyle: .destructive
) { [weak self] result in ) { [weak self] result in

@ -26,7 +26,7 @@ final class BrowserErrorView: UIView {
lazy var reloadButton: Button = { lazy var reloadButton: Button = {
let button = Button(size: .normal, style: .borderless) let button = Button(size: .normal, style: .borderless)
button.addTarget(self, action: #selector(reloadTapped), for: .touchUpInside) button.addTarget(self, action: #selector(reloadTapped), for: .touchUpInside)
button.setTitle(NSLocalizedString("browser.reload.button.title", value: "Reload", comment: ""), for: .normal) button.setTitle(R.string.localizable.browserReloadButtonTitle(), for: .normal)
button.translatesAutoresizingMaskIntoConstraints = false button.translatesAutoresizingMaskIntoConstraints = false
button.sizeToFit() button.sizeToFit()
return button return button

@ -36,7 +36,7 @@ final class BrowserNavigationBar: UINavigationBar {
textField.clearButtonMode = .whileEditing textField.clearButtonMode = .whileEditing
textField.leftView = UIView(frame: CGRect(x: 0, y: 0, width: 6, height: 30)) textField.leftView = UIView(frame: CGRect(x: 0, y: 0, width: 6, height: 30))
textField.leftViewMode = .always textField.leftViewMode = .always
textField.placeholder = NSLocalizedString("browser.url.textfield.placeholder", value: "Search or enter website url", comment: "") textField.placeholder = R.string.localizable.browserUrlTextfieldPlaceholder()
textField.keyboardType = .webSearch textField.keyboardType = .webSearch
moreButton.translatesAutoresizingMaskIntoConstraints = false moreButton.translatesAutoresizingMaskIntoConstraints = false

@ -133,6 +133,11 @@
"browser.reload.button.title" = "Reload"; "browser.reload.button.title" = "Reload";
"browser.addbookmark.button.title" = "Add Bookmark"; "browser.addbookmark.button.title" = "Add Bookmark";
"browser.tabbar.item.title" = "Browser"; "browser.tabbar.item.title" = "Browser";
"browser.history.confirm.delete.title" = "Are you sure you would like to delete?";
"browser.noHistory.label.title" = "No history yet";
"browser.bookmarks.confirm.delete.title" = "Are you sure you would like to delete this bookmark?";
"browser.noBookmarks.label.title" = "No bookmarks yet!";
"browser.url.textfield.placeholder" = "Search or enter website URL";
"configureTransaction.gasPriceGwei.label.title" = "Gas Price (Gwei)"; "configureTransaction.gasPriceGwei.label.title" = "Gas Price (Gwei)";
"enterPassword.confirmPassword.textField.placeholder" = "Confirm Password"; "enterPassword.confirmPassword.textField.placeholder" = "Confirm Password";
"enterPassword.navigation.title" = "Backup Password"; "enterPassword.navigation.title" = "Backup Password";

@ -89,6 +89,11 @@
"browser.reload.button.title" = "Reload"; "browser.reload.button.title" = "Reload";
"browser.addbookmark.button.title" = "Add Bookmark"; "browser.addbookmark.button.title" = "Add Bookmark";
"browser.tabbar.item.title" = "Browser"; "browser.tabbar.item.title" = "Browser";
"browser.history.confirm.delete.title" = "Are you sure you would like to delete?";
"browser.noHistory.label.title" = "No history yet";
"browser.bookmarks.confirm.delete.title" = "Are you sure you would like to delete this bookmark?";
"browser.noBookmarks.label.title" = "No bookmarks yet!";
"browser.url.textfield.placeholder" = "Search or enter website URL";
"configureTransaction.data.label.title" = "Datos de transacción (Opcional)"; "configureTransaction.data.label.title" = "Datos de transacción (Opcional)";
"confirmPayment.data.label.title" = "Datos"; "confirmPayment.data.label.title" = "Datos";
"Contract Address" = "Contract Address"; "Contract Address" = "Contract Address";

@ -133,6 +133,11 @@
"browser.reload.button.title" = "刷新"; "browser.reload.button.title" = "刷新";
"browser.addbookmark.button.title" = "添加书签"; "browser.addbookmark.button.title" = "添加书签";
"browser.tabbar.item.title" = "浏览器"; "browser.tabbar.item.title" = "浏览器";
"browser.history.confirm.delete.title" = "Are you sure you would like to delete?";
"browser.noHistory.label.title" = "No history yet";
"browser.bookmarks.confirm.delete.title" = "Are you sure you would like to delete this bookmark?";
"browser.noBookmarks.label.title" = "No bookmarks yet!";
"browser.url.textfield.placeholder" = "Search or enter website URL";
"configureTransaction.gasPriceGwei.label.title" = "Gas费用 (Gwei)"; "configureTransaction.gasPriceGwei.label.title" = "Gas费用 (Gwei)";
"enterPassword.confirmPassword.textField.placeholder" = "确认密码"; "enterPassword.confirmPassword.textField.placeholder" = "确认密码";
"enterPassword.navigation.title" = "备份密码"; "enterPassword.navigation.title" = "备份密码";

Loading…
Cancel
Save