From f4c477560ad93dbbd270386bb24a94d2e2e5e659 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Menu?= Date: Mon, 1 Nov 2021 13:30:10 +0100 Subject: [PATCH] Add translate editing action for iOS 15 (#209) --- .github/workflows/build.yml | 3 +-- CHANGELOG.md | 7 ++++++- r2-navigator-swift/EditingAction.swift | 5 ++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79aab7ae..dca2089b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,7 @@ jobs: env: scheme: ${{ 'r2-navigator-swift' }} platform: ${{ 'iOS Simulator' }} + device: ${{ 'iPhone 13' }} steps: - name: Checkout @@ -31,9 +32,7 @@ jobs: rm -rf r2-navigator-swift.xcodeproj - name: Build run: | - device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}'` xcodebuild build-for-testing -scheme "$scheme" -destination "platform=$platform,name=$device" - name: Test run: | - device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}'` xcodebuild test-without-building -scheme "$scheme" -destination "platform=$platform,name=$device" diff --git a/CHANGELOG.md b/CHANGELOG.md index a638250c..8893529c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,12 @@ All notable changes to this project will be documented in this file. **Warning:** Features marked as *alpha* may change or be removed in a future release without notice. Use with *caution. - +## [Unreleased] + +### Added + +* A new `translate` EPUB and PDF editing action is available for iOS 15. + ## [2.1.0] diff --git a/r2-navigator-swift/EditingAction.swift b/r2-navigator-swift/EditingAction.swift index cb6121d8..fb5c49d3 100644 --- a/r2-navigator-swift/EditingAction.swift +++ b/r2-navigator-swift/EditingAction.swift @@ -17,7 +17,7 @@ public struct EditingAction: Hashable { /// Default editing actions enabled in the navigator. public static var defaultActions: [EditingAction] { - [copy, share, lookup] + [copy, share, lookup, translate] } /// Copy the text selection. @@ -26,6 +26,9 @@ public struct EditingAction: Hashable { /// Look up the text selection in the dictionary. public static let lookup = EditingAction(kind: .native("_lookup:")) + /// Translate the text selection. + public static let translate = EditingAction(kind: .native("_translate:")) + /// Share the text selection. /// /// Implementation detail: We use a custom share action to make sure the user is allowed to share the content. We