sensei icon indicating copy to clipboard operation
sensei copied to clipboard

Some texts are not translated

Open amroland opened this issue 3 years ago • 11 comments

Some text does not translate even after running the CLI. Texts are the following:

"Contact Teacher" on Learning mode screen: Képernyőfotó 2023-01-05 - 15 40 21

"Interactive Video - Timeline" "Interactive Video" "Interactive Video Block." Képernyőfotó 2023-01-05 - 15 50 41

Képernyőfotó 2023-01-05 - 15 51 28

Képernyőfotó 2023-01-05 - 15 51 51

"Course Actions" icon name Képernyőfotó 2023-01-05 - 15 57 35

"Quiz" "Evaluate progress and strengthen understanding of course concepts." "Answers" "Question Answers." Képernyőfotó 2023-01-05 - 15 53 55

"Point" "Points" Képernyőfotó 2023-01-05 - 16 06 08

"Break Point" "Break Point for the Interactive Video Block." Képernyőfotó 2023-01-06 - 11 23 41

"Accordion" Képernyőfotó 2023-07-11 - 23 23 53

PHP / WordPress / Sensei LMS version

PHP 7.4.26 WordPress 6.1.1 Sensei LMS Version: 4.9.1 | Sensei Pro Version: 1.9.1 - Sensei LMS Version: 4.15.1 | Sensei Pro Version: 1.15.1

amroland avatar Jan 05 '23 15:01 amroland

I added another one: texts of "break point"

amroland avatar Jan 06 '23 10:01 amroland

Note that some of these strings are in Sensei Pro, not Sensei LMS.

donnapep avatar May 19 '23 18:05 donnapep

As for the "Contact Teacher" button, it is a normal block with a title. The title on it is translatable. But is translated at the moment of adding the block. So if the user switches language after adding the block, the title remains in the original language.

I see two ways to fix the button: 1) remove the old button and add a new one immediately; 2) just update the text on the button in the Editor.

--

At the moment, I'm looking at Interactive Block. And it looks tricky. There is a translation for the text, but is not used for some reason. So I'm looking for that reason.

merkushin avatar Jun 16 '23 14:06 merkushin

I was trying to find a clue why title and description are not translated in some cases, but didn't make progress. Then I noticed that core blocks are translated in the same conditions. I took a look at core blocks and found they don't use block.json at all... Here is the Video block, for example. Even though they promise that fields like title and description are localized, it doesn't work in some cases.

merkushin avatar Jun 16 '23 22:06 merkushin

As we could notice in that Video block, they already call the __() function.

Here is the block type switcher (Transform to), no translation function here: https://github.com/WordPress/gutenberg/blob/1d9288443b38d254092f38d0d818f96be22346ad/packages/editor/src/components/block-switcher/index.js#LL109C1-L109C1

And also no call to the translation function later in the block type list: https://github.com/WordPress/gutenberg/blob/1d9288443b38d254092f38d0d818f96be22346ad/packages/editor/src/components/block-types-list/index.js#LL74C1-L74C1

merkushin avatar Jun 16 '23 22:06 merkushin

Here are PR that fix title and description translations in Sensei LMS and Sensei Pro. https://github.com/Automattic/sensei/pull/6994 https://github.com/Automattic/sensei-pro/pull/2338

As for Points, I couldn't reproduce the issue. I set Russian translation for corresponding strings for "sensei-lms" and "sensei-pro" domains via Loco Translate: CleanShot 2023-06-30 at 02 00 40@2x

merkushin avatar Jun 29 '23 23:06 merkushin

@merkushin Only "Point" and "Points" were fixed. Every other translation are still missing. Plus now I added "Accordion", too! (Sensei LMS Version: 4.15.1 | Sensei Pro Version: 1.15.1) Képernyőfotó 2023-07-11 - 23 23 53

amroland avatar Jul 11 '23 21:07 amroland

@amroland Glad to hear the problem with points was solved for you. As for other translations, the work is still in progress yet. Hopefully, we release them soon-ish.

merkushin avatar Jul 11 '23 23:07 merkushin

The following texts are still not translated. (Even after running CLI):

  1. Quiz block and its texts: Képernyőfotó 2023-11-11 - 16 08 00

  2. Course Actions block and its texts: Képernyőfotó 2023-11-11 - 16 09 04

  3. Accordion block and its texts (Sensei PRO): Képernyőfotó 2023-11-11 - 16 03 07

amroland avatar Nov 11 '23 15:11 amroland

+1 in 8157220-zd-a8c

image

joashrajin avatar May 09 '24 08:05 joashrajin

Support References

This comment is automatically generated. Please do not edit it.

  • [ ] 8157220-zen

github-actions[bot] avatar May 09 '24 08:05 github-actions[bot]

Solution for this issue is documented here.

donnapep avatar Jul 19 '24 15:07 donnapep

Reopening this issue as we're going to have to revert the fix that we made in #7643 as it introduced a regression.

donnapep avatar Aug 16 '24 16:08 donnapep

Closing as we no longer need to revert this as the regression was fixed in https://github.com/Automattic/sensei/pull/7669 without affecting translations.

donnapep avatar Aug 20 '24 12:08 donnapep