Skip to content

Commit c81c9ef

Browse files
authored
Add translate editing action for iOS 15 (#209)
Former-commit-id: f602277
1 parent 14bf81c commit c81c9ef

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

navigator/.github/workflows/build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
env:
1414
scheme: ${{ 'r2-navigator-swift' }}
1515
platform: ${{ 'iOS Simulator' }}
16+
device: ${{ 'iPhone 13' }}
1617

1718
steps:
1819
- name: Checkout
@@ -31,9 +32,7 @@ jobs:
3132
rm -rf r2-navigator-swift.xcodeproj
3233
- name: Build
3334
run: |
34-
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}'`
3535
xcodebuild build-for-testing -scheme "$scheme" -destination "platform=$platform,name=$device"
3636
- name: Test
3737
run: |
38-
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}'`
3938
xcodebuild test-without-building -scheme "$scheme" -destination "platform=$platform,name=$device"

navigator/CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ All notable changes to this project will be documented in this file.
55
**Warning:** Features marked as *alpha* may change or be removed in a future release without notice. Use with
66
*caution.
77

8-
<!--## [Unreleased]-->
8+
## [Unreleased]
9+
10+
### Added
11+
12+
* A new `translate` EPUB and PDF editing action is available for iOS 15.
13+
914

1015
## [2.1.0]
1116

navigator/r2-navigator-swift/EditingAction.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public struct EditingAction: Hashable {
1717

1818
/// Default editing actions enabled in the navigator.
1919
public static var defaultActions: [EditingAction] {
20-
[copy, share, lookup]
20+
[copy, share, lookup, translate]
2121
}
2222

2323
/// Copy the text selection.
@@ -26,6 +26,9 @@ public struct EditingAction: Hashable {
2626
/// Look up the text selection in the dictionary.
2727
public static let lookup = EditingAction(kind: .native("_lookup:"))
2828

29+
/// Translate the text selection.
30+
public static let translate = EditingAction(kind: .native("_translate:"))
31+
2932
/// Share the text selection.
3033
///
3134
/// Implementation detail: We use a custom share action to make sure the user is allowed to share the content. We

0 commit comments

Comments
 (0)