Translate helper issues with route models
Overview
There's an exception in the handlebars translate
function when used with in a component that is rendered via a route. Likely something is not getting setup / wired correctly.
Reproduce
- Create a component that uses the
translate
HBS helper - Create a route that creates an instance of that component (using
$.componentTemplate
or some other means) - Render that component in the route HBS using the component helper.
Sample Error
ERROR: 20200419-14:26:09 default: process/warning.js:25: (node:6487) UnhandledPromiseRejectionWarning: Error: No staticTranslation method provided for site 'undefined'. Please include bl-plugin-translate-static or some other implementation plugin via site.js
at Object.<anonymous> (/mnt/c/work/git_workspace/fs-blacklight/node_modules/blacklight-core/lib/blacklight-handlebars.js:217:32)
at eval (eval at createFunctionContext (/mnt/c/work/git_workspace/fs-blacklight/node_modules/blacklight-core/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:10:76)
at Object.prog [as fn] (/mnt/c/work/git_workspace/fs-blacklight/node_modules/blacklight-core/node_modules/handlebars/dist/cjs/handlebars/runtime.js:219:12)
at Object.<anonymous> (/mnt/c/work/git_workspace/fs-blacklight/node_modules/blacklight-core/node_modules/handlebars/dist/cjs/handlebars/helpers/if.js:19:22)
at Object.eval [as main] (eval at createFunctionContext (/mnt/c/work/git_workspace/fs-blacklight/node_modules/blacklight-core/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), <anonymous>:5:35)
at main (/mnt/c/work/git_workspace/fs-blacklight/node_modules/blacklight-core/node_modules/handlebars/dist/cjs/handlebars/runtime.js:173:32)
at Object.ret (/mnt/c/work/git_workspace/fs-blacklight/node_modules/blacklight-core/node_modules/handlebars/dist/cjs/handlebars/runtime.js:176:12)
at Object.ret [as fn] (/mnt/c/work/git_workspace/fs-blacklight/node_modules/blacklight-core/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:525:21)
at ComponentType.render (/mnt/c/work/git_workspace/fs-blacklight/node_modules/blacklight-core/lib/component-types.js:127:45)
at Object.<anonymous> (/mnt/c/work/git_workspace/fs-blacklight/node_modules/blacklight-core/lib/blacklight-handlebars.js:75:45)