Skip to content
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

Improve error message language and polishing #5635

Draft
wants to merge 32 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
04637cc
Draft Errors
May 21, 2024
33ba955
Shortened the error messsages
May 28, 2024
22e0104
🤖 Automatically update generated files
ArtV11 May 28, 2024
b52e02d
Merge branch 'main' into Artun-test-branch
ArtV11 May 29, 2024
4e4750d
Structure and consistency
Jun 16, 2024
111c477
Merge branch 'main' into Artun-test-branch
Jun 18, 2024
b5aec3f
Alternative messages
Jun 18, 2024
a0c08c7
🤖 Automatically update generated files
ArtV11 Jun 18, 2024
491f8e0
Merge branch 'main' into Artun-test-branch
Jun 21, 2024
a41835e
Alternative message structure applied to each error message
Jun 22, 2024
b08ab5e
🤖 Automatically update generated files
ArtV11 Jun 22, 2024
cceef39
Merge branch 'main' into Artun-test-branch
Jun 25, 2024
a630e0e
Merge branch 'main' into Artun-test-branch
jpelay Jun 25, 2024
5c9d0c7
fix empty msgstr
jpelay Jun 25, 2024
655b9b8
fix cypress tests
jpelay Jun 25, 2024
bd17dd1
Removed complex words
Jun 26, 2024
c9b33d7
Update messages.po
Jun 26, 2024
7f0cb83
Updated messages and the test
Jun 26, 2024
d74ea07
Update invalid_program.cy.js
Jun 26, 2024
be80e05
Update translations/en/LC_MESSAGES/messages.po
Felienne Jun 27, 2024
855fb57
Update translations/en/LC_MESSAGES/messages.po
Felienne Jun 27, 2024
c7b4fa8
Update translations/en/LC_MESSAGES/messages.po
Felienne Jun 27, 2024
48c747d
Update translations/en/LC_MESSAGES/messages.po
Felienne Jun 27, 2024
790a9e9
Update translations/en/LC_MESSAGES/messages.po
Felienne Jun 27, 2024
9271bfe
Merge branch 'main' into Artun-test-branch
Jun 27, 2024
6fa1f8c
Merge branch 'main' into Artun-test-branch
Jun 27, 2024
b49a78a
Cypress test fix next to language and consistency
Jun 27, 2024
cca8d57
🤖 Automatically update generated files
ArtV11 Jun 27, 2024
ca2da41
Update invalid_program.cy.js
Jun 27, 2024
afc55da
Merge branch 'Artun-test-branch' of https://github.com/hedyorg/hedy i…
Jun 27, 2024
dd83072
Applying the suggestions
Jul 1, 2024
bbfa3bb
Merge branch 'main' into Artun-test-branch
Jul 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/cypress/e2e/hedy_page/invalid_program.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Error code gives correct error', () => {

it('Missing Command', () => {
const error_code = "hello world"
const error_message = `We detected that the code seems to be missing a command on line 1. Can you try looking at the exercise section to find which command to use?`;
const error_message = `We detected that the code seems to be missing a command on line 1. Can you try looking at the adventure section to find which command to use?`;
goToHedyPage();

cy.get('#editor > .cm-editor > .cm-scroller > .cm-content').click();
Expand All @@ -47,7 +47,7 @@ describe('Error code gives correct error', () => {

it('Invalid Argument Type', () => {
const error_code = "forward lalala"
const error_message = `We detected that forward doesn't work with lalala because it is text. Can you try changing lalala to a number or input from ask?`;
const error_message = `We detected that forward may not be used with lalala because it is text. Can you try changing lalala to a number or input from ask?`;
goToHedyPage();

cy.get('#editor > .cm-editor > .cm-scroller > .cm-content').click();
Expand All @@ -61,7 +61,7 @@ describe('Error code gives correct error', () => {

it('Invalid Argument', () => {
const error_code = "turn test"
const error_message = `We detected that turn is not usable with test. Can you try changing test to right or left?`;
const error_message = `We detected that turn may not be used with test. Can you try changing test to right or left?`;
goToHedyPage();

cy.get('#editor > .cm-editor > .cm-scroller > .cm-content').click();
Expand Down
64 changes: 32 additions & 32 deletions translations/en/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -19,49 +19,49 @@ msgstr ""
"Generated-By: Babel 2.14.0\n"

msgid "Access Before Assign"
msgstr "We detected that a variable `{name}` is being used on line {access_line_number} before being set. Can you set the variable before it is used?"
msgstr "We detected that a variable `{name}` is being used on line {access_line_number} before being set. Can you set the variable first?"

msgid "Cyclic Var Definition"
msgstr "We detected that a variable `{variable}` is being used on the right-hand side of the `{is}` command before being set. Can you set the variable before it is used?"
msgstr "We detected that a variable `{variable}` is being used on the right-hand side of the `{is}` before being set. Can you set the variable first?"

msgid "Else Without If Error"
msgstr "We detected that there is an `{else}` being used before an `{if}` on line {line_number}. Can you try writing an `{if}` before the `{else}`?"

msgid "Function Undefined"
msgstr "We detected that a function {name} is being used without being defined. Can you define the function before it is used?"
msgstr "We detected that a function `{name}` is being used without being defined. Can you define the function first?"

msgid "Has Blanks"
msgstr "We detected that the code seems to be incomplete. Can you fill in the blanks with code?"

msgid "Incomplete"
msgstr "We detected that part of the code seems to be missing from the `{incomplete_command}` on line {line_number}. Can you try adding the what's missing?"
msgstr "We detected that part of the code seems to be missing from the `{incomplete_command}`, on line {line_number}. Can you try adding what's missing?"

msgid "Incomplete Repeat"
msgstr "We detected that the `{repeat}` on line {line_number} is missing a `{command}` command. Can you try adding it?"
msgstr "We detected that the `{repeat}` seems to be missing a `{command}` command, on line {line_number}. Can you try adding `{repeat}` with `{command}`?"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'seems to be' part is a bit long and doen not add something perse. We could make it shorter without losing info?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made a suggestion, also moving the line number into the sentence, which I find reads nicer? If you want to move it back, feel free to do so!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
msgstr "We detected that the `{repeat}` seems to be missing a `{command}` command, on line {line_number}. Can you try adding `{repeat}` with `{command}`?"
msgstr "We detected that the `{repeat}` on line {line_number} is missing a `{command}` command. Can you try adding `{repeat}` with `{command}`?"


msgid "Invalid"
msgstr "We detected that `{invalid_command}` is not a Hedy level {level} command. Can you try using `{guessed_command}`?"

msgid "Invalid Argument"
msgstr "We detected that `{command}` is not usable with `{invalid_argument}`. Can you try changing `{invalid_argument}` to {allowed_types}?"
msgstr "We detected that `{command}` may not be used with `{invalid_argument}`. Can you try changing `{invalid_argument}` to {allowed_types}?"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
msgstr "We detected that `{command}` may not be used with `{invalid_argument}`. Can you try changing `{invalid_argument}` to {allowed_types}?"
msgstr "We detected a `{command}` that can't be used with `{invalid_argument}`. Can you try changing `{invalid_argument}` to {allowed_types}?"


msgid "Invalid Argument Type"
msgstr "We detected that `{command}` doesn't work with `{invalid_argument}` because it is {invalid_type}. Can you try changing `{invalid_argument}` to {allowed_types}?"
msgstr "We detected that `{command}` may not be used with `{invalid_argument}` because it is {invalid_type}. Can you try changing `{invalid_argument}` to {allowed_types}?"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The may phrasing is a bit weird. I think we should rephrase (see above)


msgid "Invalid At Command"
msgstr "We detected that `{command}` may not be used from level 16 onward. Can you try using square brackets `[]` for lists?"
msgstr "We detected that `{command}` may not be used from level 16 onward. Can you try adding square brackets around `[]` the list?\""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the " needed?


msgid "Invalid Space"
msgstr "We detected that line {line_number} started with a space. Can you try removing the space?"
msgstr "We detected that line {line_number} started with a space. Can you remove the space?"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we are removing try, which is think is good, but it still is there in other places.


msgid "Invalid Type Combination"
msgstr "We detected that `{invalid_argument}` and `{invalid_argument_2}` cannot be used with `{command}` because one is {invalid_type} and the other is {invalid_type_2}. Can you try changing `{invalid_argument}` to {invalid_type_2} or `{invalid_argument_2}` to {invalid_type}?"
msgstr "We detected that `{invalid_argument}` and `{invalid_argument_2}` may not be used with `{command}` because one is {invalid_type} and the other is {invalid_type_2}. Can you try changing `{invalid_argument}` to {invalid_type_2} or `{invalid_argument_2}` to {invalid_type}?"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may does not mean what you think is means. Can't is fine as it is!


msgid "Lonely Echo"
msgstr "We detected that an `{echo}` is being used before or without using an `{ask}`. Can you try writing an `{ask}` before the `{echo}`?"
msgstr "We detected that an `{echo}` is being used before or without an `{ask}`. Can you try writing an `{ask}` before the `{echo}`?"

msgid "Lonely Text"
msgstr "We detected that the code seems to be missing a command with the text that was used in line {line_number}. Can you try writing the needed command with the text"
msgstr "We detected that the code seems to be missing a command with the text that was used on line {line_number}. Can you try writing the needed command with the text"

msgid "Missing Additional Command"
msgstr "We detected that the code seems to be missing a `{command}` on line {line_number}. Can you try using `{missing_command}` in your code."
Expand All @@ -70,40 +70,40 @@ msgid "Missing Colon Error"
msgstr "We detected that `{command}` needs a `:` at the end of line {line_number}. Starting from level 17, can you start adding a `:` at the end of line with commands?"

msgid "Missing Command"
msgstr "We detected that the code seems to be missing a command on line {line_number}. Can you try looking at the exercise section to find which command to use?"
msgstr "We detected that the code seems to be missing a command on line {line_number}. Can you try looking at the adventure section to find which command to use?"

msgid "Missing Inner Command"
msgstr "We detected that the code seems to be missing a command for the `{command}` statement on line {line_number}. Can you try looking at the exercise section to find which command to use?"
msgstr "We detected that the code seems to be missing a command for the `{command}` on line {line_number}. Can you try looking at the adventure section to find which command to use?"

msgid "Missing Square Brackets"
msgstr "We detected that the list you created on line {line_number} is missing square brackets `[]`. Can you try adding square brackets around `[]` the list?"
msgstr "We detected that the list you created on line {line_number} seems to be missing square brackets `[]`. Can you try adding square brackets around `[]` the list?"

msgid "Missing Variable"
msgstr "We detected that `{command}` is missing a variable at the start of the line. Can you try writing the variable before the `{command}?`"
msgstr "We detected that `{command}` seems to be missing a variable at the start of the line. Can you try writing the variable before the `{command}?`"

msgid "Misspelled At Command"
msgstr "We detected that `{invalid_argument}` seems to have a spelling mistake on line {line_number}. Can you try writing `{command}` instead."
msgstr "We detected that `{invalid_argument}` seems to have a spelling error on line {line_number}. Can you try writing `{command}` instead."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is error better than mistake? Why?


msgid "No Indentation"
msgstr "We detected that there seems to be too few {leading_spaces} spaces used on line {line_number}. Can you try increasing indentation by {indent_size} for each new block."

msgid "Non Decimal Variable"
msgstr "We detected that at line {line_number} you used a number Hedy does not support! Can you try a decimal number, like 2?"
msgstr "We detected that a number is being used which Hedy does not support, on line {line_number}! Can you try a decimal number, like 2?"

msgid "Parse"
msgstr "We detected that `{character_found}` is being used on line {location[0]} which is not allowed. Can you try looking for a missing or an extra character on your code?"
msgstr "We detected that `{character_found}` is being used on line {location[0]} which is not possible. Can you try looking for a missing or an extra character on your code?"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well it is possible, because the kid did it :)

Maybe we can say: which hedy can't process or something like that?


msgid "Pressit Missing Else"
msgstr "We detected that the code is missing an `{else}` to handle other key presses. Can you try adding an `{else}` to your code?"
msgstr "We detected that the code seems to be missing an `{else}` to handle other key presses. Can you try adding an `{else}` to your code?"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is is more concise then seems to?


msgid "Runtime Index Error"
msgstr "We detected that the list {name} is empty or its index is missing. Can you make sure that the list is not empty or try writing a number inside the `[]` for the missing index?"
msgstr "We detected that the list `{name}` is empty or its index is missing. Can you make sure that the list is not empty or try writing a number inside the `[]` for the missing index?"

msgid "Runtime Value Error"
msgstr "We detected that `{command}` received disallowed value `{value}`. {tip}."
msgstr "We detected that `{command}` received an unexpected value `{value}`. {tip}."

msgid "Runtime Values Error"
msgstr "We detected that `{command}` received disallowed values `{value}` and `{value}`. {tip}."
msgstr "We detected that `{command}` received unexpected values `{value}` and `{value}`. {tip}."

msgid "Save Microbit code "
msgstr "Save Microbit code"
Expand All @@ -112,40 +112,40 @@ msgid "Too Big"
msgstr "We detected that the program has {lines_of_code} lines, but we can only process {max_lines} lines. Can you try to shorten your program?"

msgid "Too Few Indents"
msgstr "We detected that line {line_number} has too few ({leading_spaces}) spaces. Can you try to add an extra space?"
msgstr "We detected that line {line_number} has too few ({leading_spaces}) leading spaces. Can you try to add an extra space?"

msgid "Too Many Indents"
msgstr "We detected that line {line_number} has too many ({leading_spaces}) spaces. Can you try to remove the extra space?"
msgstr "We detected that line {line_number} has too many ({leading_spaces}) leading spaces. Can you try to remove the extra space?"

msgid "Unexpected Indentation"
msgstr "We detected that line {line_number} has too many ({leading_spaces}) spaces. Can you try adding {indent_size} more spaces per new block?"

msgid "Unquoted Assignment"
msgstr "We detected that the text to the right of the `{is}` is not written between quotes. This level requires you to start writing the text between quotes. Try doing that for the text {text}"
msgstr "We detected that the text to the right of the `{is}` is not written between quotes. Starting from this level, can you start writing the texts to the right of the `{is}` between quotes (Try doing that for the text {text})?"

msgid "Unquoted Equality Check"
msgstr "We detected that the code is trying to check if a variable equals multiple words. Can you try using quotation marks for the words you want to check?"

msgid "Unquoted Text"
msgstr "We detected that text for `{ask}` or `{print}` seems to be missing their quotation marks. Can you try adding quotes for {unquotedtext}?"
msgstr "We detected that the text for `{ask}` or `{print}` seems to be missing their quotation marks. Can you try adding quotes for `{unquotedtext}`?"

msgid "Unsupported Float"
msgstr "We detected that the code uses non-integer numbers which are not supported yet. Can you try changing `{value}` to an integer?"
msgstr "We detected that the code uses non-integer numbers which Hedy does not supported yet. Can you try changing `{value}` to an integer?"

msgid "Unsupported String Value"
msgstr "We detected that text uses values it cannot contain `{invalid_value}`. Can you try removing the written value or change its type?"
msgstr "We detected that the text uses values it cannot contain `{invalid_value}`. Can you try removing the written value or change its type?"

msgid "Unused Variable"
msgstr "We detected that variable {variable_name} defined on line {line_number}, but not used. Can you try using the defined variable or remove it?"
msgstr "We detected that variable `{variable_name}` defined on line {line_number}, but not used. Can you try using the defined variable or remove it?"

msgid "Var Undefined"
msgstr "We detected that variable `{name}` is being used before being set. Can you set the variable before it is used or use quotation marks for `{name}`?"
msgstr "We detected that variable `{name}` is being used before being set. Can you set the variable first or use quotation marks for `{name}`?"

msgid "Wrong Level"
msgstr "We detected that the written code is correct Hedy code, but `{offending_keyword}` is used on level {working_level}. {tip}"

msgid "Wrong Number of Arguments"
msgstr "We detected that function {name} has wrong number of arguments which is {used_number}. Can you try writing {defined_number} instead?"
msgstr "We detected that function `{name}` has wrong number of arguments which is `{used_number}`. Can you try writing {defined_number} instead?"

msgid "account_overview"
msgstr "Account overview"
Expand Down
Loading