The 'complete' (or almost perfect separation) would go one step further: extract the internationalization (i18n) out of the formatter itself and have it as a separate modules, one for each language... loaded automatically correctly by the locale information by the system or overridable (with a parm in require module and/or constructor. Since the argument in require(argument) as a literal ("xxx...") works on build time (upload time), for runtime - when it is a variable - Espruino firmware tries to read from the memory card (as present in original Espruino board).
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The 'complete' (or almost perfect separation) would go one step further: extract the internationalization (i18n) out of the formatter itself and have it as a separate modules, one for each language... loaded automatically correctly by the locale information by the system or overridable (with a parm in require module and/or constructor. Since the argument in
require(argument)
as a literal ("xxx...") works on build time (upload time), for runtime - when it is a variable - Espruino firmware tries to read from the memory card (as present in original Espruino board).