Open
Description
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:
- 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.
- This file must ONLY be modified programmatically.
- 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;
}