Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Commit

Permalink
Add translate editing action for iOS 15 (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
mickael-menu authored Nov 1, 2021
1 parent ad94c0c commit f4c4775
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
env:
scheme: ${{ 'r2-navigator-swift' }}
platform: ${{ 'iOS Simulator' }}
device: ${{ 'iPhone 13' }}

steps:
- name: Checkout
Expand All @@ -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"
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]-->
## [Unreleased]

### Added

* A new `translate` EPUB and PDF editing action is available for iOS 15.


## [2.1.0]

Expand Down
5 changes: 4 additions & 1 deletion r2-navigator-swift/EditingAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit f4c4775

Please sign in to comment.