Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial support for VideoPress v5 #6634

Merged
merged 21 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion bundle/android/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
<!-- translators: displays audio file extension. e.g. MP3 audio file -->
<string name="gutenberg_native_audio_file" tools:ignore="UnusedResources">audio file</string>
<string name="gutenberg_native_audio_player" tools:ignore="UnusedResources">Audio Player</string>
<string name="gutenberg_native_auto" tools:ignore="UnusedResources">Auto</string>
<string name="gutenberg_native_autoplay_may_cause_usability_issues_for_some_users" tools:ignore="UnusedResources">Autoplay may cause usability issues for some users</string>
<string name="gutenberg_native_block_cannot_be_rendered_because_it_is_deeply_nested_tap_here_for" tools:ignore="UnusedResources">Block cannot be rendered because it is deeply nested. Tap here for more details.</string>
<!-- translators: displayed right after the block is copied. -->
<string name="gutenberg_native_block_copied" tools:ignore="UnusedResources">Block copied</string>
Expand Down Expand Up @@ -160,6 +162,7 @@
<string name="gutenberg_native_edit_media" tools:ignore="UnusedResources">Edit media</string>
<string name="gutenberg_native_edit_using_web_editor" tools:ignore="UnusedResources">Edit using web editor</string>
<string name="gutenberg_native_edit_video" tools:ignore="UnusedResources">Edit video</string>
<string name="gutenberg_native_edit_video_024aee6d" tools:ignore="UnusedResources">Edit video</string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following strings are duplicated on Android, however, they are not on iOS. Seems that form some reason, the i18n update scripts are identifying these strings as new. I'd like to explore this further but in the meantime, I wouldn't block the PR due to this.

  • Edit video
  • Video caption. Empty
  • Video caption. %s

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One option I'm considering is that since they are associated with the Jetpack plugin, they should be considered different from the ones provided in Gutenberg. However, I noticed that something similar is happening on the Jetpack VideoPress plugin (example) and they weren't marked as new 🤔.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for flagging this, Carlos. I'm going to go ahead to begin the merge domino for this PR, and it's associated changes as you mentioned this is non-blocking. But, will be happy to help look further into this specific issue with you next week.

<!-- translators: %s: name of the host app (e.g. WordPress) -->
<string name="gutenberg_native_editing_synced_patterns_is_not_yet_supported_on_s_for_android" tools:ignore="UnusedResources">Editing synced patterns is not yet supported on %s for Android</string>
<!-- translators: %s: name of the host app (e.g. WordPress) -->
Expand Down Expand Up @@ -290,7 +293,9 @@ translators: %s: Select control button label e.g. "Button width" -->
<string name="gutenberg_native_page_title_s" tools:ignore="UnusedResources">Page title. %s</string>
<string name="gutenberg_native_paste_block_after" tools:ignore="UnusedResources">Paste block after</string>
<string name="gutenberg_native_paste_url" tools:ignore="UnusedResources">Paste URL</string>
<string name="gutenberg_native_play_inline" tools:ignore="UnusedResources">Play inline</string>
<string name="gutenberg_native_playback_bar_color" tools:ignore="UnusedResources">Playback Bar Color</string>
<string name="gutenberg_native_playback_controls" tools:ignore="UnusedResources">Playback controls</string>
<string name="gutenberg_native_playback_settings" tools:ignore="UnusedResources">Playback Settings</string>
<!-- translators: accessibility text. empty post title. -->
<string name="gutenberg_native_post_title_empty" tools:ignore="UnusedResources">Post title. Empty</string>
Expand Down Expand Up @@ -389,10 +394,13 @@ translators: %s: Select control option value e.g: "Auto, 25%". -->
<string name="gutenberg_native_upgrade_your_plan_to_use_video_covers" tools:ignore="UnusedResources">Upgrade your plan to use video covers</string>
<string name="gutenberg_native_uploading" tools:ignore="UnusedResources">Uploading…</string>
<string name="gutenberg_native_use_icon_button" tools:ignore="UnusedResources">Use icon button</string>
<!-- translators: accessibility text. Empty video caption. -->
<string name="gutenberg_native_video_caption_empty" tools:ignore="UnusedResources">Video caption. Empty</string>
<!-- translators: accessibility text. Empty video caption. -->
<string name="gutenberg_native_video_caption_empty_663aab49" tools:ignore="UnusedResources">Video caption. Empty</string>
<!-- translators: accessibility text. %s: video caption. -->
<string name="gutenberg_native_video_caption_s" tools:ignore="UnusedResources">Video caption. %s</string>
<!-- translators: accessibility text. %s: video caption. -->
<string name="gutenberg_native_video_caption_s_0141bd20" tools:ignore="UnusedResources">Video caption. %s</string>
<string name="gutenberg_native_waiting_for_connection" tools:ignore="UnusedResources">Waiting for connection</string>
<string name="gutenberg_native_warning_message" tools:ignore="UnusedResources">Warning message</string>
<string name="gutenberg_native_we_are_working_hard_to_add_more_blocks_with_each_release" tools:ignore="UnusedResources">We are working hard to add more blocks with each release.</string>
Expand Down
4 changes: 4 additions & 0 deletions bundle/ios/GutenbergNativeTranslations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ private func dummy() {
_ = NSLocalizedString("Audio caption. Empty", comment: "translators: accessibility text. Empty Audio caption.")
_ = NSLocalizedString("audio file", comment: "translators: displays audio file extension. e.g. MP3 audio file")
_ = NSLocalizedString("Audio Player", comment: "")
_ = NSLocalizedString("Auto", comment: "")
_ = NSLocalizedString("Autoplay may cause usability issues for some users", comment: "")
_ = NSLocalizedString("Block cannot be rendered because it is deeply nested. Tap here for more details.", comment: "")
_ = NSLocalizedString("Block copied", comment: "translators: displayed right after the block is copied.")
_ = NSLocalizedString("Block cut", comment: "translators: displayed right after the block is cut.")
Expand Down Expand Up @@ -261,7 +263,9 @@ private func dummy() {
_ = NSLocalizedString("Page title. Empty", comment: "translators: accessibility text. empty page title.")
_ = NSLocalizedString("Paste block after", comment: "")
_ = NSLocalizedString("Paste URL", comment: "")
_ = NSLocalizedString("Play inline", comment: "")
_ = NSLocalizedString("Playback Bar Color", comment: "")
_ = NSLocalizedString("Playback controls", comment: "")
_ = NSLocalizedString("Playback Settings", comment: "")
_ = NSLocalizedString("Post title. %s", comment: "translators: accessibility text. %s: text content of the post title.")
_ = NSLocalizedString("Post title. Empty", comment: "translators: accessibility text. empty post title.")
Expand Down
2 changes: 1 addition & 1 deletion jetpack
Submodule jetpack updated 1461 files
14 changes: 13 additions & 1 deletion src/jetpack-editor-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
registerLoomVariation,
registerSmartframeVariation,
} from '../jetpack/projects/plugins/jetpack/extensions/extended-blocks/core-embed';
import '../jetpack/projects/plugins/jetpack/extensions/blocks/videopress/editor';

// When adding new blocks to this list please also consider updating `./block-support/supported-blocks.json`
const supportedJetpackBlocks = {
Expand Down Expand Up @@ -129,6 +128,14 @@ export function registerJetpackEmbedVariations( { capabilities } ) {
} );
}

export function enableVideoPressV5Support( { capabilities } ) {
if ( ! isActive() || ! capabilities.videoPressV5Support ) {
return;
}

require( '../jetpack/projects/plugins/jetpack/extensions/blocks/videopress/editor' );
}
Comment on lines +131 to +137
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a side note, it would be great if we could cover this logic in a test case here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I'll add this to my list to follow up on next week.


const setupHooks = () => {
// Hook triggered before the editor is rendered
addAction( 'native.pre-render', 'gutenberg-mobile-jetpack', ( props ) => {
Expand All @@ -142,6 +149,11 @@ const setupHooks = () => {
// block type registration, so it’s required to add them before
// the core blocks are registered.
registerJetpackEmbedVariations( props );

// VideoPress v5 conversion also uses WP hooks that are attached to
// block type registration, so it’s required to add them before
// the core blocks are registered.
enableVideoPressV5Support( props );
} );

// Hook triggered after the editor is rendered
Expand Down