Skip to content

Empty English strings localized into "<!-- -->" in French #5399

@echoix

Description

@echoix

Describe the bug

Some blocks, like the function block with or without outputs, are displayed differently in English and in French.
In French, there is an extra <!-- --> on the left of the block.

To Reproduce

Steps to reproduce the behavior:

  1. Open Blockly Code Editor demo, in English.
  2. Add a function block with an output and place it on the screen.
  3. In the top right corner, change the language to French
  4. Observe the left side of the block with an additional <!-- -->

You can also use the two following links to open the shared demo illustrating the problem:
https://blockly-demo.appspot.com/static/demos/code/index.html?lang=fr#czndiz
https://blockly-demo.appspot.com/static/demos/code/index.html?lang=en#czndiz

Expected behavior

There is no <!-- --> text displayed when not needed

Screenshots

image
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Google Chrome
  • Version 92.0.4515.159 (Build officiel) (64 bits)

Stack Traces

No error in stack trace if I looked at the good place.

Additional context

I did a little bit of investigation since I observed the problem when localizing a downstream project that we are about to release our version 2, that is using Blockly version 6.20210701.0.
In French, there was an extra <!-- --> that weren't in my translated strings.
The original problematic French string was Blockly.Msg["PROCEDURES_DEFNORETURN_DO"] = "<!-- -->";
When searching in this repository's msg folder for <!-- -->, I didn't find any other language that was affected except French, where the following 7 strings have this value:

  1. Blockly.Msg["LISTS_GET_INDEX_TAIL"]
  2. Blockly.Msg["LISTS_GET_SUBLIST_TAIL"]
  3. Blockly.Msg["MATH_ONLIST_HELPURL"]
  4. Blockly.Msg["ORDINAL_NUMBER_SUFFIX"]
  5. Blockly.Msg["PROCEDURES_DEFNORETURN_DO"]
  6. Blockly.Msg["TEXT_CHARAT_TAIL"]
  7. Blockly.Msg["TEXT_GET_SUBSTRING_TAIL"]

image

Other languages have some text in some of these 7 strings, and others leave it blank and have a comment saying it's untranslated (Blockly.Msg["TEXT_GET_SUBSTRING_TAIL"] = ""; // untranslated).

Looking at the git history, the <!-- --> were introduced in commit aed9ba1 (Rebuild (#4733)) on 2021-03-25 at 12:37 for the msg/js/fr.js file. For the msg/json/fr.json file, the commit introducing the changes was 21fd86a on 2021-02-15 at 08:40 (a translatewiki update).
Before the introduction of changes, there was either nothing, an empty string with the untranslated comment, or at one point "ORDINAL_NUMBER_SUFFIX": "<!-- ---->".

In the issues I looked for, I couldn't see anything related except the discussion about the ordinal number suffix.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions