The localization runs before the script's beforeRender so it is too late to change the language there.
I would personally, in this case, don't use the extra extension and do it exclusively just by script.
const jsreport = require('jsreport-proxy')
async function beforeRender(req, res) {
const localizedResource = await jsreport.documentStore.collection('data').findOne({
name: 'en' + '-data' // your condition to find the right resource
})
Object.assign(req.data, {
$localizedResource: JSON.parse(localizedResource.dataJson)
})
}