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

View file

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