Closed Shou closed 6 years ago
Would this change have any knock-on effects if/when we decide to localize Etcher? ( #308 )
Can't see how, I don't believe _.template
has any functionality that localization could leverage.
Edit: Ah, I see what you mean now. Because they're pure strings it would be possible to keep them in separate files and also without worrying about injection of other variables, assuming that could be dangerous.
Fair enough :) I just wondered if searching for _.template
might be a useful way to find strings that ought to be localised, but thinking about it a bit more I guess there'll also be plenty of strings that we need to localise that aren't templated.
In terms of localization, string templates could be easily fitted with it by sticking a tag function in front of it (see tagged template literals), far easier than mending lodash templates.
I would like to work on this.
Instead we could simply use lambdas and native template literals, e.g.