Open frederikbrinck opened 6 years ago
Hmm I think I need a more concrete explanation of this to understand exactly what you mean.
Language change should never be relevant though (except for maybe in the distant future where it could very theoretically become a fully fledged open source framework for newspapers)
I.e. have a file called message.json /.js which contains all the messages used throughout the code base, such as
{
adminNoAuthorsOnArticle: "You have not added any authors to ... ",
...
}
And then it can be called with
import messagesObject from '...messages.js';
//...
if (error) this.props.alertDisplay(messagesObject.adminNoAuthorsOnArticles);
or something similar.
Yeah sure, I wouldn't mind that, definitely good practice.
Don't think it's very high priority though, but it's definitely good practice
@emilgoldsmith I'm not sure if you want this, but going over the different controllers, it seems that it would be nice to factor out all the user feedback messages to a common list. This would compile every feedback message in one place and allow for easy editing and, in case needed, language change. It will also make the controllers source code more readable.