You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use another translators, that can also do variable replacements and can translate a schema (labels) to a given language. It also sets all messages to the proper translation. For this I just used the messages-function on simple-schema 1 and on version 2 i now use schema.messageBox.messages({ en: i18n.t('simpleSchema')}) (where i18n.t returns an object with all messages).
However, I do not need the features of messagebox and in paticular i do not want to have the huge handlebars depencency. So i think it would be best to have messagebox completly optional.
It could be a function that you had to implement, like getMessage(field, errorType)
The text was updated successfully, but these errors were encountered:
maybe you can define messageBox as peer dependency, so that at least one could just override messageForError(errorInfo) and throw an error if someone did not install messagebox and did not define messageForError-
Edit: you could do:
let MessageBox = null;
try {
MessageBox = require("message-box");
} catch(e) {
// messagebox not installed, use has to provide own implementation
}
I use another translators, that can also do variable replacements and can translate a schema (labels) to a given language. It also sets all messages to the proper translation. For this I just used the messages-function on simple-schema 1 and on version 2 i now use
schema.messageBox.messages({ en: i18n.t('simpleSchema')})
(where i18n.t returns an object with all messages).However, I do not need the features of messagebox and in paticular i do not want to have the huge handlebars depencency. So i think it would be best to have messagebox completly optional.
It could be a function that you had to implement, like
getMessage(field, errorType)
The text was updated successfully, but these errors were encountered: