Skip to content

Generate static files automatically #6

@juhamust

Description

@juhamust

As it can be seen from the related discussion (globalizejs/globalize#481 (comment)), the requirement of static formatting rules took me by surprise.

Now the globalization works as expected, but to get there I had to generate following JavaScript code from all the messages. This is something I'd expect Globalize Webpack plugin to do for me.

// jscs:disable
// NOTE: This file is generated. Do not modify.
var Globalize = require('globalize');
var lookupTable = {};
Globalize.locale("en");
lookupTable["en"] = {};
lookupTable["en"]["app.calc.button"] = Globalize.messageFormatter("app.calc.button");
lookupTable["en"]["app.dates.day"] = Globalize.messageFormatter("app.dates.day");
lookupTable["en"]["app.dates.days"] = Globalize.messageFormatter("app.dates.days");
lookupTable["en"]["app.dates.month"] = Globalize.messageFormatter("app.dates.month");
lookupTable["en"]["app.dates.months"] = Globalize.messageFormatter("app.dates.months");
lookupTable["en"]["app.dates.year"] = Globalize.messageFormatter("app.dates.year");
// .... goes on for 2000+ of lines ...

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