Some fixes for spanish localization and double done button on QuickLook preview (#343)

* Fixed spanish location plural for single new post

* - Fix for double Done button appearing on iPhone.
- Added localized text for "Done" on QuickLook preview navigation bar.

Co-authored-by: Roberto Pastor <roberto.pastor@cabify.com>
This commit is contained in:
Roberto Pastor 2023-01-24 09:27:02 +01:00 committed by GitHub
parent b68d91044d
commit 204427c1e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View file

@ -51,19 +51,19 @@ struct QuickLookPreview: UIViewControllerRepresentable {
class AppQLPreviewController: QLPreviewController {
private var closeButton: UIBarButtonItem {
.init(title: "Done", style: .plain, target: self, action: #selector(onCloseButton))
}
override func viewDidLoad() {
super.viewDidLoad()
if UIDevice.current.userInterfaceIdiom != .pad {
navigationItem.rightBarButtonItem = closeButton
}
.init(
title: NSLocalizedString("action.done", comment: ""),
style: .plain,
target: self,
action: #selector(onCloseButton)
)
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
navigationItem.rightBarButtonItem = closeButton
if UIDevice.current.userInterfaceIdiom != .pad {
navigationItem.rightBarButtonItem = closeButton
}
}
@objc private func onCloseButton() {

View file

@ -13,7 +13,7 @@
<key>NSStringFormatValueTypeKey</key>
<string>lld</string>
<key>one</key>
<string>%lld new post</string>
<string>%lld nueva publicación</string>
<key>other</key>
<string>%lld nuevas publicaciones</string>
</dict>