Commit ffae1c3d authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

UI: check localization

Check if all strings could be localized

Change-Id: If11a6f5ea709e4c95659cab01b4928973302c98d
parent 2f1a6a61
......@@ -37,6 +37,10 @@ internal enum L10n {
internal static let enableNotifications = L10n.tr("Localizable", "accountPage.enableNotifications")
/// Enable Proxy
internal static let enableProxy = L10n.tr("Localizable", "accountPage.enableProxy")
/// Link another device
internal static let linkDeviceTitle = L10n.tr("Localizable", "accountPage.linkDeviceTitle")
/// Name
internal static let namePlaceholder = L10n.tr("Localizable", "accountPage.namePlaceholder")
/// Your device won't receive notifications when proxy is disabled
internal static let noProxyExplanationLabel = L10n.tr("Localizable", "accountPage.noProxyExplanationLabel")
/// Provide proxy address
......@@ -127,6 +131,11 @@ internal enum L10n {
internal static let profileUploadPhoto = L10n.tr("Localizable", "alerts.profileUploadPhoto")
}
internal enum BlockListPage {
/// No blocked contacts
internal static let noBlockedContacts = L10n.tr("Localizable", "blockListPage.noBlockedContacts")
}
internal enum Calls {
/// Call finished
internal static let callFinished = L10n.tr("Localizable", "calls.callFinished")
......@@ -157,6 +166,11 @@ internal enum L10n {
internal static let startVideoCall = L10n.tr("Localizable", "contactPage.startVideoCall")
}
internal enum Conversation {
/// Type your message...
internal static let messagePlaceholder = L10n.tr("Localizable", "conversation.messagePlaceholder")
}
internal enum CreateAccount {
/// Encrypt my account
internal static let chooseAPassword = L10n.tr("Localizable", "createAccount.ChooseAPassword")
......@@ -243,6 +257,11 @@ internal enum L10n {
internal static let ok = L10n.tr("Localizable", "global.ok")
}
internal enum Invitations {
/// No invitations
internal static let noInvitations = L10n.tr("Localizable", "invitations.noInvitations")
}
internal enum LinkDevice {
/// An error occured during the export
internal static let defaultError = L10n.tr("Localizable", "linkDevice.defaultError")
......@@ -275,6 +294,17 @@ internal enum L10n {
internal static let waitLinkToAccountTitle = L10n.tr("Localizable", "linkToAccount.waitLinkToAccountTitle")
}
internal enum Notifications {
/// ACCEPT
internal static let acceptCall = L10n.tr("Localizable", "notifications.acceptCall")
/// Incoming Call
internal static let incomingCall = L10n.tr("Localizable", "notifications.incomingCall")
/// Missed Call
internal static let missedCall = L10n.tr("Localizable", "notifications.missedCall")
/// REFUSE
internal static let refuseCall = L10n.tr("Localizable", "notifications.refuseCall")
}
internal enum Scan {
/// Bad QR code
internal static let badQrCode = L10n.tr("Localizable", "scan.badQrCode")
......@@ -287,12 +317,16 @@ internal enum L10n {
internal static let cellularAccess = L10n.tr("Localizable", "smartlist.cellularAccess")
/// Conversations
internal static let conversations = L10n.tr("Localizable", "smartlist.conversations")
/// No conversations
internal static let noConversation = L10n.tr("Localizable", "smartlist.noConversation")
/// No network connectivity
internal static let noNetworkConnectivity = L10n.tr("Localizable", "smartlist.noNetworkConnectivity")
/// No results
internal static let noResults = L10n.tr("Localizable", "smartlist.noResults")
/// Search Result
internal static let results = L10n.tr("Localizable", "smartlist.results")
/// Enter name...
internal static let searchBarPlaceholder = L10n.tr("Localizable", "smartlist.searchBarPlaceholder")
/// Searching...
internal static let searching = L10n.tr("Localizable", "smartlist.searching")
/// Yesterday
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="gUS-mM-rdY">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="gUS-mM-rdY">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13174"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
......@@ -29,7 +29,7 @@
<rect key="frame" x="0.0" y="20" width="375" height="647"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="No invitations" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pSV-RV-i1C">
<rect key="frame" x="135" y="312.5" width="104" height="21"/>
<rect key="frame" x="135.5" y="313" width="104" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
......@@ -58,6 +58,7 @@
<navigationItem key="navigationItem" id="dMs-kf-EuK"/>
<connections>
<outlet property="noInvitationsPlaceholder" destination="cXe-K6-eM8" id="fuk-gt-pdZ"/>
<outlet property="noRequestsLabel" destination="pSV-RV-i1C" id="g1Z-Au-yNa"/>
<outlet property="tableView" destination="bPe-Vn-J7U" id="rc3-OT-FCs"/>
</connections>
</viewController>
......
......@@ -31,6 +31,7 @@ class ContactRequestsViewController: UIViewController, StoryboardBased, ViewMode
@IBOutlet weak var tableView: UITableView!
@IBOutlet weak var noInvitationsPlaceholder: UIView!
@IBOutlet weak var noRequestsLabel: UILabel!
fileprivate let disposeBag = DisposeBag()
fileprivate let cellIdentifier = "ContactRequestCell"
......@@ -50,7 +51,7 @@ class ContactRequestsViewController: UIViewController, StoryboardBased, ViewMode
self.viewModel.showConversation(forRingId: ringId)
}
}).disposed(by: disposeBag)
self.navigationItem.title = L10n.Global.contactRequestsTabBarTitle
self.applyL10n()
}
override func viewWillAppear(_ animated: Bool) {
......@@ -62,6 +63,11 @@ class ContactRequestsViewController: UIViewController, StoryboardBased, ViewMode
NSAttributedStringKey.foregroundColor: UIColor.jamiMain]
}
func applyL10n() {
self.navigationItem.title = L10n.Global.contactRequestsTabBarTitle
self.noRequestsLabel.text = L10n.Invitations.noInvitations
}
func setupTableView() {
self.tableView.estimatedRowHeight = 100.0
self.tableView.rowHeight = UITableViewAutomaticDimension
......
......@@ -53,7 +53,7 @@ class MessageAccessoryView: UIView, NibLoadable, GrowingTextViewDelegate {
func setupMessageTextView() {
self.messageTextView.delegate = self
self.messageTextView.placeholder = "Type your message..."
self.messageTextView.placeholder = L10n.Conversation.messagePlaceholder
self.messageTextView.layer.cornerRadius = 18
self.messageTextView.tintColor = UIColor.jamiMain
self.messageTextView.textContainerInset = UIEdgeInsets(top: 8, left: 7, bottom: 8, right: 7)
......
......@@ -149,6 +149,7 @@
<outlet property="conversationsTableView" destination="HFM-G6-hMN" id="M97-IB-NUZ"/>
<outlet property="networkAlertLabel" destination="Fu7-Dr-XvA" id="0qV-lk-9mE"/>
<outlet property="networkAlertViewTopConstraint" destination="CLm-6J-lYv" id="LEO-Ep-Gpx"/>
<outlet property="noConversationLabel" destination="8bB-XU-6gh" id="n4g-mz-w7z"/>
<outlet property="noConversationsView" destination="EvL-Bu-O1T" id="tVV-6a-4Xg"/>
<outlet property="searchBar" destination="xPr-nI-I35" id="Y3U-rV-yfc"/>
<outlet property="searchResultsTableView" destination="opE-y7-3Rm" id="F3g-9d-IQt"/>
......
......@@ -44,6 +44,7 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased
@IBOutlet weak var searchResultsTableView: UITableView!
@IBOutlet weak var searchBar: UISearchBar!
@IBOutlet weak var noConversationsView: UIView!
@IBOutlet weak var noConversationLabel: UILabel!
@IBOutlet weak var searchTableViewLabel: UILabel!
@IBOutlet weak var networkAlertLabel: UILabel!
@IBOutlet weak var cellularAlertLabel: UILabel!
......@@ -69,6 +70,7 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased
self.setupTableViews()
self.setupSearchBar()
self.setupUI()
self.applyL10n()
self.configureRingNavigationBar()
/*
......@@ -94,17 +96,21 @@ class SmartlistViewController: UIViewController, StoryboardBased, ViewModelBased
}
}
func setupUI() {
func applyL10n() {
self.navigationItem.title = L10n.Global.homeTabBarTitle
noConversationLabel.text = L10n.Smartlist.searchBarPlaceholder
self.searchBar.placeholder = L10n.Smartlist.noConversation
self.networkAlertLabel.text = L10n.Smartlist.noNetworkConnectivity
self.cellularAlertLabel.text = L10n.Smartlist.cellularAccess
}
func setupUI() {
self.viewModel.hideNoConversationsMessage
.bind(to: self.noConversationsView.rx.isHidden)
.disposed(by: disposeBag)
self.networkAlertViewTopConstraint.constant = self.viewModel.networkConnectionState() == .none ? 0.0 : -56.0
self.networkAlertLabel.text = L10n.Smartlist.noNetworkConnectivity
self.cellularAlertLabel.text = L10n.Smartlist.cellularAccess
self.viewModel.connectionState
.subscribe(onNext: { connectionState in
let newAlertHeight = connectionState == .none ? 0.0 : -56.0
......
......@@ -46,6 +46,7 @@ class BlockListViewController: UIViewController, StoryboardBased, ViewModelBased
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.setupTableView()
noBlockedContactLabel.text = L10n.BlockListPage.noBlockedContacts
self.viewModel.contactListNotEmpty
.observeOn(MainScheduler.instance)
......
......@@ -46,8 +46,7 @@ class MeViewController: EditProfileViewController, StoryboardBased, ViewModelBas
override func viewDidLoad() {
super.viewDidLoad()
self.addHeaderView()
self.navigationItem.title = L10n.Global.meTabBarTitle
self.applyL10n()
self.configureBindings()
self.configureRingNavigationBar()
self.adaptTableToKeyboardState(for: self.settingsTable, with: self.disposeBag, topOffset: self.stretchyHeader.minimumContentHeight)
......@@ -60,6 +59,11 @@ class MeViewController: EditProfileViewController, StoryboardBased, ViewModelBas
NSAttributedStringKey.foregroundColor: UIColor.jamiMain]
}
func applyL10n() {
self.navigationItem.title = L10n.Global.meTabBarTitle
self.profileName.placeholder = L10n.AccountPage.namePlaceholder
}
private func addHeaderView() {
guard let nibViews = Bundle.main
.loadNibNamed("AccountHeader", owner: self, options: nil) else {
......@@ -282,6 +286,7 @@ class MeViewController: EditProfileViewController, StoryboardBased, ViewModelBas
cell.addDeviceTitle.rx.tap.subscribe(onNext: { [weak self] in
self?.viewModel.linkDevice()
}).disposed(by: cell.disposeBag)
cell.addDeviceTitle.setTitle(L10n.AccountPage.linkDeviceTitle, for: .normal)
cell.selectionStyle = .none
return cell
......
......@@ -31,8 +31,18 @@ enum NotificationUserInfoKeys: String {
enum NotificationCallTitle: String {
case incomingCall = "Incoming Call"
case missedCall = "Missed Call"
func getString()->String {
switch self {
case .incomingCall:
return L10n.Notifications.incomingCall
case .missedCall:
return L10n.Notifications.missedCall
}
}
}
//L10n.Calls.connecting
enum CallAcition: String {
case accept = "ACCEPT_ACTION"
case refuse = "REFUSE_ACTION"
......@@ -40,9 +50,9 @@ enum CallAcition: String {
func title() -> String {
switch self {
case .accept:
return "ACCEPT"
return L10n.Notifications.acceptCall
case .refuse:
return "REFUSE"
return L10n.Notifications.refuseCall
}
}
}
......@@ -141,7 +151,7 @@ class LocalNotificationsHelper {
}
func presentCallNotification(data: [String: String], callService: CallsService) {
let title = NotificationCallTitle.incomingCall.rawValue
let title = NotificationCallTitle.incomingCall.getString()
guard let name = data [NotificationUserInfoKeys.name.rawValue],
let callID = data [NotificationUserInfoKeys.callID.rawValue] else {
return
......@@ -169,7 +179,7 @@ class LocalNotificationsHelper {
}).single()
.subscribe(onNext: { _ in
let content = UNMutableNotificationContent()
content.title = NotificationCallTitle.missedCall.rawValue
content.title = NotificationCallTitle.missedCall.getString()
content.body = name
content.badge = UIApplication.shared.applicationIconBadgeNumber + 1 as NSNumber
let notificationTrigger = UNTimeIntervalNotificationTrigger(timeInterval: 0.01, repeats: false)
......@@ -194,7 +204,7 @@ class LocalNotificationsHelper {
.subscribe(onNext: { _ in
let notification = UILocalNotification()
notification.userInfo = data
notification.alertTitle = NotificationCallTitle.missedCall.rawValue
notification.alertTitle = NotificationCallTitle.missedCall.getString()
notification.alertBody = name
notification.applicationIconBadgeNumber = UIApplication.shared.applicationIconBadgeNumber + 1
UIApplication.shared.scheduleLocalNotification(notification)
......
......@@ -34,9 +34,17 @@
"smartlist.conversations" = "Conversations";
"smartlist.searching" = "Searching...";
"smartlist.noResults" = "No results";
"smartlist.noConversation" = "No conversations";
"smartlist.searchBarPlaceholder" = "Enter name...";
"smartlist.noNetworkConnectivity" = "No network connectivity";
"smartlist.cellularAccess" = "Be sure cellular access is granted in your settings";
//Conversation
"conversation.messagePlaceholder" = "Type your message...";
//Invitations
"invitations.noInvitations" = "No invitations";
// Walkthrough
//Welcome Screen
......@@ -149,6 +157,11 @@
"accountPage.deviceRevocationWrongPassword" = "Incorrect password";
"accountPage.deviceRevocationUnknownDevice" = "Unknown device";
"accountPage.deviceRevocationError" = "Device revocation error";
"accountPage.namePlaceholder" = "Name";
"accountPage.linkDeviceTitle" = "Link another device";
//Block List Page
"blockListPage.noBlockedContacts" = "No blocked contacts";
//Link New Device
"linkDevice.title" = "Link a new device";
......@@ -177,3 +190,16 @@
"dataTransfer.readableStatusAccept" = "Accept";
"dataTransfer.readableStatusCancel" = "Cancel";
//Notifications
"notifications.incomingCall" = "Incoming Call";
"notifications.missedCall" = "Missed Call";
"notifications.acceptCall" = "ACCEPT";
"notifications.refuseCall" = "REFUSE";
"dataTransfer.readableStatusAwaiting" = "Pending…";
"dataTransfer.readableStatusRefuse" = "Refuse";
"dataTransfer.readableStatusOngoing" = "Transferring";
"dataTransfer.readableStatusCanceled" = "Canceled";
"dataTransfer.readableStatusSuccess" = "Complete";
"dataTransfer.readableStatusAccept" = "Accept";
"dataTransfer.readableStatusCancel" = "Cancel";
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment