1602/express-on-railway — pull request #100 by VladimirTechMan (2012-01-14 17:04:04+00:00)
Title: Some optimizations in locales.T.translate

I would like to suggest making locales.T.translate slightly more efficient in the case when the required path (chain of keys in the tree of assoc. arrays) does not exist for the specific locale: Currently, even if the traversal fails in the middle of the path, the forEach loop will force try-and-fail for all the remaining path tokens -- plus on each of those extra iterations both defaultValue and translationMissing will be called repeatedly. This is what the proposed changes address.

Also, adding an extra check to avoid an attempt to substitute params if the required translation was not found.