Skip to content

Dynamic output does not work with hoganjs templates #13

@yar0d

Description

@yar0d

Hello,

I'm using Express + Hogan + Lingua for my application. Static translations works well, but dynamic output always results in an empty translation.

Can you help me, please ?

Here is my template test.hjs

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>{{lingua.application.title}}</title>
</head>
<body>
    <div>{{lingua.application.title}}</div>
    <div>{{lingua.application.name(app)}}</div>
</body>
</html>

And the nodejs module test.js

exports.dialog = function () {
    var show = function (req, res) {
        res.render('test', {
            app: {
                version: '0.0.1'
            }
        });
    }

    return {
        show: show
    };
};

My en.json file

{
    "application": {
        "title": "My i18n test app",
        "name": "Test version {version}"
    }
}

The rendered result :

My i18n test app

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions