Skip to content

Isolate strings in a strings.json file #33

Open
@carlos3g

Description

@carlos3g

Currently, the messages that must be returned to the end user are inserted directly into the code (see an example here). It is necessary to separate these strings in a .json file. Basically, the schema for this file should look something like the following:

{
  // ...
  commands: {
    // ...
  }
}
  • Any string that is NOT returned by a command must be outside commands key.
  • The commands has an object like value. The keys and values inside this object must be, respectively, the name of the correspondent command and an object with the strings.

Notes:

  1. The strings inside this file must be only strings returned to the end user. For example, strings passed to Error instances mustn't be in this file.
  2. This file must ONLY be modified programmatically.
  3. When importing this file, the const it will be attributed to must be uppercased. See the following example:
const STRINGS = JSON.parse(require('./strings.json'));

function sendMessageToUser() {
  return STRINGS.welcomeNewUser;
}

Metadata

Metadata

Assignees

Labels

ImproveImprove some featureNeeds: triageThis issue is still been discussing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions