I am an intern working at an internet company on a Javascript library. My employer ask me to “think about” how do we map translation strings from typically external files to templates
To be honest, I don’t know what does that mean. Can someone point me to the right resources? Better Still, can someone provide me with a scenario to explain the sentence and also propose an approach to solve that?
That’s more of a server side issue, and less of a JavaScript issue. As far as “map translation strings from typically external files to templates”, they’re most likely talking about gettext like functionality.
For example, in PHP there is the gettext series of functions. They use “external files” known as
.pofiles to provide translations. Translations are mapped depending on the user’s chosen locale by using thegettext()function (usually abbreviated as_()). JavaScript doesn’t really have this functionality, nor in my opinion should it.