-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[RNMobile] Fix missing title for some unsupported blocks #31743
Conversation
The block's title is now only translated when is gets registered, for unsupported blocks since they're not registered, title has be explicitly translated.
Size Change: 0 B Total Size: 1.32 MB ℹ️ View Unchanged
|
@@ -34,6 +34,7 @@ import styles from './style.scss'; | |||
|
|||
// Blocks that can't be edited through the Unsupported block editor identified by their name. | |||
const UBE_INCOMPATIBLE_BLOCKS = [ 'core/block' ]; | |||
const I18N_BLOCK_SCHEMA_TITLE = 'block title'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This value was taken from packages/blocks/src/api/i18n-block.json
file.
# Conflicts: # packages/react-native-editor/CHANGELOG.md
As @ceyhun pointed out in an internal conversation, the titles don't have the proper translations. This is caused by two different issues that are not related to this PR: Extra strings in the main apps (only happening on iOS)Although the unneeded extra strings were already fixed in Missing strings in GutenbergRecently, the block title strings are missing in the Gutenberg localization files so even if we don't overwrite them with the incoming strings from the main apps, we don't have locally the proper translations for the blocks. Here is the issue opened in WordPress.org related to this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this on iOS and Android. Titles were visible, but the translations were missing. Approving as the translation issues are not related to this repo.
* Add get title to missing block The block's title is now only translated when is gets registered, for unsupported blocks since they're not registered, title has be explicitly translated. * Update react-native-editor changelog
* Release script: Update react-native-editor version to 1.53.0 * Release script: Update with changes from 'npm run core preios' * Update changelog to reflect release * Release script: Update react-native-editor version to 1.53.1 * Release script: Update with changes from 'npm run core preios' * Update react-native-editor changelog * Gallery block: restore focus caption prop for native * [RNMobile] Fix missing title for some unsupported blocks (#31743) * Add get title to missing block The block's title is now only translated when is gets registered, for unsupported blocks since they're not registered, title has be explicitly translated. * Update react-native-editor changelog * Update lock files Co-authored-by: Ceyhun Ozugur <[email protected]> Co-authored-by: Carlos Garcia <[email protected]> Co-authored-by: Ella van Durpe <[email protected]>
gutenberg-mobile
PR: wordpress-mobile/gutenberg-mobile#3489Description
Block titles are now translated on the fly when they're registered so unsupported blocks, which are not registered, no longer will have the title translated.
This PR introduces the function
getTitle
into the missing block to translate the title the same way we're doing it for registered blocks.Code references:
How has this been tested?
NOTE: Only core blocks (defined here) will display the title, the rest will show the block's name (i.e.:
jetpack/gif
).Since this change is also related to translations, we should also perform a test using a different device's language:
Screenshots
In a non-English language:
Types of changes
Bug fix
Checklist:
*.native.js
files for terms that need renaming or removal).