Skip to content

Commit

Permalink
minor UI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Mar 7, 2022
1 parent 256fb34 commit f5fa87d
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 7 deletions.
5 changes: 5 additions & 0 deletions Localizations/en.xcloc/Localized Contents/en.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,11 @@
<target>confirm</target>
<note>Button text</note>
</trans-unit>
<trans-unit id="online now" xml:space="preserve">
<source>online now</source>
<target>online now</target>
<note>The topic or user is currently online</note>
</trans-unit>
<trans-unit id="undefined" xml:space="preserve">
<source>undefined</source>
<target>undefined</target>
Expand Down
5 changes: 5 additions & 0 deletions Localizations/es.xcloc/Localized Contents/es.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,11 @@
<target>confirmar</target>
<note>Button text</note>
</trans-unit>
<trans-unit id="online now" xml:space="preserve">
<source>online now</source>
<target>en línea ahora</target>
<note>The topic or user is currently online</note>
</trans-unit>
<trans-unit id="undefined" xml:space="preserve">
<source>undefined</source>
<target>indefinido</target>
Expand Down
5 changes: 5 additions & 0 deletions Localizations/ru.xcloc/Localized Contents/ru.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,11 @@
<target>подтвердить</target>
<note>Button text</note>
</trans-unit>
<trans-unit id="online now" xml:space="preserve">
<source>online now</source>
<target>сейчас онлайн</target>
<note>The topic or user is currently online</note>
</trans-unit>
<trans-unit id="undefined" xml:space="preserve">
<source>undefined</source>
<target>без названия</target>
Expand Down
5 changes: 5 additions & 0 deletions Localizations/zh-Hans.xcloc/Localized Contents/zh-Hans.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,11 @@
<target>确认</target>
<note>Button text</note>
</trans-unit>
<trans-unit id="online now" xml:space="preserve">
<source>online now</source>
<target>现在在线</target>
<note>The topic or user is currently online</note>
</trans-unit>
<trans-unit id="undefined" xml:space="preserve">
<source>undefined</source>
<target>未定义</target>
Expand Down
5 changes: 5 additions & 0 deletions Localizations/zh-Hant.xcloc/Localized Contents/zh-Hant.xliff
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,11 @@
<target>確認</target>
<note>Button text</note>
</trans-unit>
<trans-unit id="online now" xml:space="preserve">
<source>online now</source>
<target>現在線上</target>
<note>The topic or user is currently online</note>
</trans-unit>
<trans-unit id="undefined" xml:space="preserve">
<source>undefined</source>
<target>未定義</target>
Expand Down
9 changes: 5 additions & 4 deletions Tinodios/TopicGeneralViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ class TopicGeneralViewController: UITableViewController {
private func reloadData() {
topicTitleLabel.text = (topic.pub?.fn ?? "").isEmpty ? NSLocalizedString("Unknown", comment: "Placeholder for missing user name") : topic.pub?.fn

topicDescriptionLabel.textColor = topic?.pub?.note?.isEmpty ?? true ? .placeholderText : .secondaryLabel
if topic.isOwner {
let isEmpty = topic?.pub?.note?.isEmpty ?? true
topicDescriptionLabel.textColor = isEmpty ? .placeholderText : .secondaryLabel
if topic.isOwner || !isEmpty {
topicDescriptionLabel.isHidden = false
topicDescriptionLabel.text = (topic.pub?.note ?? "").isEmpty ? NSLocalizedString("Add optional description", comment: "Placeholder for missing topic description") : topic.pub?.note
topicDescriptionLabel.text = isEmpty ? NSLocalizedString("Add optional description", comment: "Placeholder for missing topic description") : topic.pub?.note
} else {
topicDescriptionLabel.isHidden = topic?.pub?.note?.isEmpty ?? true
topicDescriptionLabel.isHidden = true
}

topicPrivateLabel.textColor = topic?.comment?.isEmpty ?? true ? .placeholderText : .secondaryLabel
Expand Down
10 changes: 7 additions & 3 deletions Tinodios/TopicInfoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ class TopicInfoViewController: UITableViewController {
topicTitleTextView.sizeToFit()

let descPlaceholder: String? = topic.isOwner ? NSLocalizedString("Add optional description", comment: "Placeholder for missing topic description") : nil
topicDescriptionTextView.text = !(topic.pub?.note ?? "").isEmpty ? descPlaceholder : topic.pub?.note
topicDescriptionTextView.textColor = (topic.pub?.note ?? "").isEmpty ? .placeholderText : .secondaryLabel
topicDescriptionTextView.text = (topic.pub?.note ?? "").isEmpty ? descPlaceholder : topic.pub?.note
topicDescriptionTextView.sizeToFit()

topicPrivateTextView.text = !(topic.comment ?? "").isEmpty ? NSLocalizedString("Private info: not set", comment: "Placeholder text in editor") : topic.comment
topicPrivateTextView.textColor = (topic.comment ?? "").isEmpty ? .placeholderText : .secondaryLabel
topicPrivateTextView.text = (topic.comment ?? "").isEmpty ? NSLocalizedString("Private info: not set", comment: "Placeholder text in editor") : topic.comment
topicPrivateTextView.sizeToFit()

topicIDLabel.text = topic?.name
Expand All @@ -90,7 +92,9 @@ class TopicInfoViewController: UITableViewController {
mutedSwitch.isOn = topic.isMuted
archivedSwitch.isOn = topic.isArchived

if let ts = topic?.lastSeen?.when {
if topic.online {
self.lastSeenTimestampLabel?.text = NSLocalizedString("online now", comment: "The topic or user is currently online")
} else if let ts = topic?.lastSeen?.when {
var date: String
let formatter = RelativeDateTimeFormatter()
formatter.unitsStyle = .short
Expand Down
3 changes: 3 additions & 0 deletions es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@
/* Alert action */
"OK" = "OK";

/* The topic or user is currently online */
"online now" = "en línea ahora";

/* Toast notification */
"Only Owner can delete group" = "Sólo el propietario puede eliminar el grupo";

Expand Down
3 changes: 3 additions & 0 deletions ru.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@
/* Alert action */
"OK" = "OK";

/* The topic or user is currently online */
"online now" = "сейчас онлайн";

/* Toast notification */
"Only Owner can delete group" = "Только владелец может удалить группу";

Expand Down
3 changes: 3 additions & 0 deletions zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@
/* Alert action */
"OK" = "好";

/* The topic or user is currently online */
"online now" = "现在在线";

/* Toast notification */
"Only Owner can delete group" = "只有所有者可以删除组";

Expand Down
3 changes: 3 additions & 0 deletions zh-Hant.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@
/* Alert action */
"OK" = "OK";

/* The topic or user is currently online */
"online now" = "現在線上";

/* Toast notification */
"Only Owner can delete group" = "只有擁有者能夠刪除群組";

Expand Down

0 comments on commit f5fa87d

Please sign in to comment.