Two untranslatable strings in the block editor (FluentCommunity 2.10.01)
While translating 2.10.01 to German I found two places in the new Space Page
editor that stay English no matter what the catalogue says. Both are small and
easy to fix.
1. The editor's post type labels are hard-coded
The block editor shows the post type label as the heading of the first sidebar
tab. All three labels are plain strings without __():
fluent-community/app/Hooks/Handlers/FluentBlockEditorHandler.php, in
register():'fcom-dummy' => ['label' => 'Lesson', β¦]and
'fcom-lockscreen' => ['label' => 'Lockscreen', β¦]fluent-community-pro/app/Modules/SpacePages/SpacePagesModule.php:92,
inregisterEditorPostType():'label' => 'Space Page'
So a German site shows "Space Page" (or "Lesson") above an otherwise German
sidebar. Wrapping them would fix it:
'label' => __('Space Page', 'fluent-community-pro'),
Lesson and Lock Screen already exist in the fluent-community catalogue, so
those two would be translated immediately.
2. "Enable comments" is missing from the editor's i18n map
The editor bundle (Modules/Gutenberg/editor/index.js) takes its strings from
window.fcomEditorI18n, built in FluentBlockEditorHandler::getEditorI18nStrings().
The Space Page sidebar asks for Enable comments (lowercase c), but the map only
contains Enable Comments (capital C, used by lessons). Anything not in the map
is shown in English, even though Enable comments is translated in the
catalogue via TransStrings.php.
I checked all 40 strings the bundle requests against the map β this is the only
one missing. The fix is one line in getEditorI18nStrings():
'Enable comments' => __('Enable comments', 'fluent-community'),
Until then I am patching both through the existing filters
(fluent_community/block_editor_post_types and
fluent_community/editor_i18n_strings), so nothing urgent β but it would be
nice to drop the workaround.
Thanks for the quick fixes last time!
We will look into this, thanks for the detailed post.