processing / processing/p5.js-web-editor

Translation for Server-Side Messages

Open
#1,587 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area: Translation Feature Request
Dominant language
JavaScript
Stars
1.7k
Forks
1.7k
Avg merge
3d 4h
Merged PRs (30d)
8

Description

  • Existing feature enhancement

Messages from server-side operations are not translated
For instance:

https://github.com/processing/p5.js-web-editor/blob/develop/server/controllers/user.controller.js#L60-L61

https://github.com/processing/p5.js-web-editor/blob/develop/server/controllers/user.controller.js#L147

https://github.com/processing/p5.js-web-editor/blob/develop/server/controllers/user.controller.js#L176

Feature enhancement details:

In order to not break the API, maybe introducing an extra field in the response to identify the string to display, and the field that triggers that response, and get the translation in the client, according to the language of the client.

For example , an extract from these lines
https://github.com/processing/p5.js-web-editor/blob/develop/server/controllers/user.controller.js#L102-L108


 if (user) {
      return res.json({
        exists: true,
        message: `This ${checkType} is already taken.`,
        type: checkType
      });
    }

would be


 if (user) {
      return res.json({
        exists: true,
        message: `This ${checkType} is already taken.`,
        messageKey: ServerTranslation.UserTaken,
        type: checkType
      });
    }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the referenced branches in server/controllers/user.controller.js, especially the responses around lines 60-61, 102-108, 147, and 176. Determine how to expose translation keys without breaking the existing API, then verify that the client can select the corresponding translated message for its language while preserving the current response fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend-api-design, internationalization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.