Skip to content

FES: Simplifying parameter validation messages #4626

Closed
@akshay-99

Description

@akshay-99

Most appropriate sub-area of p5.js?

  • Other (Friendly errors)

Before starting out with the internationalization for validateParameters in #4616, I felt this needed to be discussed first. So the messages for the FES wrong arguments are still ( kind of ) cryptic in the way they describe the position of the arguments. It says something like parameter #3 (zero-based index), which could be changed to simply to state the ordinal form such as fourth parameter.
This is a very small change but would be nice to have.

The thing is how this would play out with different languages, as they have different ordinal representations. We could use something similar to the locales from numeral.js to display the ordinal short forms (1st, 2nd, 3rd, ...)

Or, since p5 functions don't usually have more than 10 arguments ( not the ones commonly used by beginners at least ), simply having a list of ordinal full forms (first, second, third, ...) for numbers 1 to 10 for all languages in the translation files won't consume much of extra space.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions