-
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
RTL/LTR button missing from Paragraph block #28221
Comments
It seems this should be returning "rtl" for these languages but when looking in glotpress, I don't see the string in the Gutenberg plugin https://translate.wordpress.org/projects/wp-plugins/gutenberg/stable/ar/default/?filters%5Bterm%5D=ltr&filters%5Bterm_scope%5D=scope_any&filters%5Bstatus%5D=current_or_waiting_or_fuzzy_or_untranslated&filters%5Buser_login%5D=&filter=Apply+Filters&sort%5Bby%5D=priority&sort%5Bhow%5D=desc Could this be a bug with the string extraction. cc @swissspidy |
While files like // ...
isRTL:function(){return"rtl"===i("ltr","text direction")}
// ... There's no way string extraction can know that this is a translation call. Maybe you can tweak the webpack config to not mangle function names there or something? |
Interesting, I guess it's because the function is defined in the same module. |
We came across an issue like this in Calypso and solved it by reserving translation functions from mangling. It would be a good idea for // webpack config
optimization: {
terserOptions: {
mangle: { reserved: [ '__', '_n', '_nx', '_x' ] },
},
} |
I'll file a PR to reserve the names. |
A patch release will be prepared for this, so the issue should be fixed in Gutenberg 9.7.3 or greater. It does depend on translations being extracted and then updated, however. |
The fix in #28231 appears to have been insufficient. Although strings are now correctly extracted and translations have been updated and published with the appropriate translations for Gutenberg in |
These lines may be related: gutenberg/lib/client-assets.php Lines 87 to 97 in 9b323e8
|
Description
The LTR button has gone missing from paragraph blocks in sites with RTL locales.
This button was added in #10663
This seems to be a regression from #27838
The
isRTL
check returns false, causing the LTR button not to render:gutenberg/packages/block-library/src/paragraph/edit.js
Line 33 in 8b30eda
The following can also be observed in the JavaScript console, which suggests the issue is related to the locale:
Yet, the locales I've tested appear to have the correct "ltr" setting, for
ar
andhe
.Step-by-step reproduction instructions
ar
orhe
.There should be an LTR button like this (installed Gutenberg 9.6 on the same site):
Expected behaviour
LTR button should be present
Actual behaviour
LTR button is missing
WordPress information
The text was updated successfully, but these errors were encountered: