very alpha
String build tool for internationalisation i18n.
html
head
title __(app.title)
body
h1 __(app.heading)
p __(app.intro)
run stringting
{
app: {
title: {
locations: ['app.jade:3'],
msgid: "__(app.title)",
msgstr: "",
comments: ""
},
heading: {
locations: ['app.jade:5'],
msgid: "__(app.heading)",
msgstr: "",
comments: ""
},
intro: {
locations: ['app.jade:6'],
msgid: "__(app.intro)",
msgstr: "",
comments: ""
}
}
}
{
app: {
title: {
locations: ['app.jade:3'],
msgid: "__(app.title)",
msgstr: "Demo site",
comments: ""
},
heading: {
locations: ['app.jade:5'],
msgid: "__(app.heading)",
msgstr: "Demonstrating Stringting",
comments: ""
},
intro: {
locations: ['app.jade:6'],
msgid: "__(app.intro)",
msgstr: "Just a quick little demo.",
comments: ""
}
}
}
Run stringting
again and get a template like:
html
head
title Demo site
body
h1 Demonstrating Stringting
p Just a quick little demo.
To run stringting you will need a .stringtingrc
file at your project root.
The minimum settings you will need to run a build are:
Path to your master templates. e.g.
"src": "src/templates"
Path to your json translation files. e.g.
"translations": "src/translations"
The locales to map translations and production templates to. e.g.
"locales": ["dev", "en", "fr"]
Destination folder for your final compiled templates.
"templates": "views"
So your finished .strintingrc
file would look something like:
{
"src": "src/templates",
"translations": "src/translations",
"locales": ["dev", "en"],
"templates": "views"
}
If you have Stringting installed as a project dependency you will most likely want an npm or gulp task that runs the command:
node node_modules/stringting/bin/stringting
Or you might have it installed globally then you can just run:
stringting