code-blocks containg punctuation are broken in multiple translation strings in Crowdin
See original GitHub issueDescribe the Issue
Code blocks containing punctuation (e.g. dot and question mark) get broken in Crowdin into more than one translation string, when should be contained in a single translation string.
This is same issue as #47775 but for other strings and files, and it was solved (without editing the source code) by applying the proper setting in Crowdin as can read in that issue’s comments.
Also please notice that all the problematic strings reported below are from Learn Basic JavaScript by Building a Role Playing Game challenge. (source directory)
I divided this report per source file. Each source file have one or more problematic string referenced in “Source sentence” (I didn’t always referenced the whole paragraph!) with the respective current URL to source string in Crowdin.
Source file: 62ba17beef16c563069a65d8.md
Source sentence:String in source file: Set the `name` property to `lose`, set `button text` to an array with three `REPLAY?` strings, set `button functions` to an array with three `restart` variables, and set `text` to `You die. ☠️`.
Crowding string URL that starts the code block:
https://freecodecamp.crowdin.com/translate/690087755819f2f67b26dbee3be0eb53/34521/en-ptbr/132#1214165
Source sentence:Your sixth `locations` value should have a `text` property with the value `You die. ☠️`.
Crowding string URL that starts the code block:
https://freecodecamp.crowdin.com/translate/690087755819f2f67b26dbee3be0eb53/34521/en-ptbr/132#1214193
Source file: 62aa25fcb5837d43b4d9873d.md
Source sentence:Set `name` to `easter egg`, set `button text` to an array with the strings `2`, `8`, and `Go to town square?`, set `button functions` to an array with the variables `pickTwo`, `pickEight`, and `goTown`, and `text` to `You find a secret game. Pick a number above. Ten numbers will be randomly chosen between 0 and 10. If the number you choose matches one of the random numbers, you win!`.
Crowding string URL that starts the code block:
https://freecodecamp.crowdin.com/translate/690087755819f2f67b26dbee3be0eb53/34529/en-ptbr/132#1214489
Source sentence:Your eighth `locations` value should have a `text` property with the value `You find a secret game. Pick a number above. Ten numbers will be randomly chosen between 0 and 10. If the number you choose matches one of the random numbers, you win!`.
Crowding string URL that starts the code block:
https://freecodecamp.crowdin.com/translate/690087755819f2f67b26dbee3be0eb53/34529/en-ptbr/132#1214519
Source file: 62a94114ce0b8918b487390f.md
Source sentence:Everything should be the same as the `lose` object, except the `name` should be `win` and the `text` should be `You defeat the dragon! YOU WIN THE GAME! 🎉`.
Crowding string URL that starts the code block:
https://freecodecamp.crowdin.com/translate/690087755819f2f67b26dbee3be0eb53/34577/en-ptbr/132#1215973
Source sentence:Your seventh `locations` value should have a `text` property with the value `You defeat the dragon! YOU WIN THE GAME! 🎉`.
Crowding string URL that starts the code block:
https://freecodecamp.crowdin.com/translate/690087755819f2f67b26dbee3be0eb53/34577/en-ptbr/132#1216001
Source file: 62aa2999ec27ec516655eba6.md
Source sentence:Inside the `if` expression, add the string `Right! You win 20 gold!` to the end of `text.innerText`. Also, add `20` to the value of `gold` and update the `goldText.innerText`.
Crowding string URL that starts the code block:
https://freecodecamp.crowdin.com/translate/690087755819f2f67b26dbee3be0eb53/34655/en-ptbr/132#1218421
Source sentence:You should use compound assignment to add the string `Right! You win 20 gold!` to the end of `text.innerText`.
Crowding string URL that starts the code block:
https://freecodecamp.crowdin.com/translate/690087755819f2f67b26dbee3be0eb53/34655/en-ptbr/132#1218429
Source file: 62aa29d8f8f88152c91350ca.md
Source sentence:Inside, add `Wrong! You lose 10 health!` to the end of `text.innerText`.
Crowding string URL that starts the code block:
https://freecodecamp.crowdin.com/translate/690087755819f2f67b26dbee3be0eb53/34669/en-ptbr/132#1218859
Source sentence:Your `else` block should use compound assignment to add `Wrong! You lose 10 health!` to the end of `text.innerText`.
Crowding string URL that starts the code block:
https://freecodecamp.crowdin.com/translate/690087755819f2f67b26dbee3be0eb53/34669/en-ptbr/132#1218871
Source file: 62aa27227399d647e1c37a3c.md
Source sentence:After the `while` loop, set `text.innerText` to equal `You picked [guess]. Here are the random numbers:`. Replace `guess` with the player's guess.
Crowding string URL that starts the code block:
https://freecodecamp.crowdin.com/translate/690087755819f2f67b26dbee3be0eb53/34673/en-ptbr/132#1218997
Source sentence:You should use the concatenation operator to add the string `. Here are the random numbers:` to your `"You picked " + guess` string.
Crowding string URL that starts the code block:
https://freecodecamp.crowdin.com/translate/690087755819f2f67b26dbee3be0eb53/34673/en-ptbr/132#1219015
Source file: 62aa27560def7048d7b4a095.md
Source sentence:You should add the new line escape character `\n` to your `. Here are the random numbers: ` string.
Crowding string URL that starts the code block:
https://freecodecamp.crowdin.com/translate/690087755819f2f67b26dbee3be0eb53/34677/en-ptbr/132#1219175
Source file: 62a8f2bc37675e77d5835235.md
Source sentence:The syntax is: `condition ? true : false`.
Crowding string URL that starts the code block:
https://freecodecamp.crowdin.com/translate/690087755819f2f67b26dbee3be0eb53/34687/en-ptbr/132#1219469
Source file: 62a8eff21c0b0f6ebe5b8e38.md
Source sentence:Set `name` to `kill monster`, set `button text` to an array with three `Go to town square` strings, set `button functions` to an array with three `goTown` variables, and set `text` to `The monster screams Arg! as it dies. You gain experience points and find gold.`.
Crowding string URL that starts the code block:
https://freecodecamp.crowdin.com/translate/690087755819f2f67b26dbee3be0eb53/34755/en-ptbr/132#1221665
Source sentence:Your fifth `locations` value should have a `text` property with the value `The monster screams Arg! as it dies. You gain experience points and find gold.`.
Crowding string URL that starts the code block:
https://freecodecamp.crowdin.com/translate/690087755819f2f67b26dbee3be0eb53/34755/en-ptbr/132#1221693
Source file: 62a8f06fb318666fef69f91e.md
Source sentence:Change the double quotes around the string `The monster screams Arg! as it dies. You gain experience points and find gold.` to single quotes `'`, then add double quotes around `Arg!`.
Crowding string URL that starts the code block:
https://freecodecamp.crowdin.com/translate/690087755819f2f67b26dbee3be0eb53/34471/en-ptbr/132#1212629
Affected Page
I don’t think it has been published yet
Your code
N/A
Expected behavior
To have code blocks not broken in more than one translation string in Crowdin. These broken code blocks don’t seem to be intentional, and don’t help the translator to understand the context.
Screenshots
As an example of code block broken into multiple translation strings in Crowdin, see the images below that correspond to the source string Change the double quotes around the string `The monster screams Arg! as it dies. You gain experience points and find gold.` to single quotes `'`, then add double quotes around `Arg!`.
System
- Device: Laptop
- OS: Arch Linux
- Browser: Firefox
- Version: 105.0.2
Additional context
No response
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
Crowdin breaks by sentence, it doesn’t make any distinction on text inside a code block.
The global fix would be to find a way to not break strings if the punctuation is inside code blocks. (between
<code>
and</code>
)This should be the file that contains the segmantation rules https://github.com/freeCodeCamp/crowdin-config/blob/main/segmentation/segmentation.srx
I (or someone else) will change the segmentation rules of each file adding specific rules. A global fix would be awesome.
This is the documentation given by crowdin https://support.crowdin.com/custom-segmentation/
This doesn’t work.
And also this doesn’t work