Skip to content

Commit

Permalink
Email localisation using Crowdin. Rename all *.mu.html templates to *…
Browse files Browse the repository at this point in the history
….html so that Crowdin file name mapping would work- #41
  • Loading branch information
tiblu committed Nov 14, 2018
1 parent 6c478fe commit 396532a
Show file tree
Hide file tree
Showing 20 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ app.set('smartId', smartId);
if (typeof config.email === 'string') {
config.email = JSON.parse(config.email); // Support JSON string from ENV
}
config.email.layout = config.email.layout || path.join(EMAIL_TEMPLATE_ROOT, 'layouts/default.mu.html');
config.email.layout = config.email.layout || path.join(EMAIL_TEMPLATE_ROOT, 'layouts/default.html');
app.set('emailClient', require('./libs/campaign/emailClient')(config.email));
app.set('email', require('./libs/email')(app));

Expand Down
8 changes: 4 additions & 4 deletions libs/cosBdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@ module.exports = function (app) {
var FILE_CREATE_MODE = '0760';

var TOPIC_FILE = {
template: 'bdoc/document.mu.html',
template: 'bdoc/document.html',
name: 'document.docx',
mimeType: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
};

var METAINFO_FILE = {
template: 'bdoc/metainfo.mu.html',
template: 'bdoc/metainfo.html',
name: '__metainfo.html',
mimeType: 'text/html'
};

var VOTE_OPTION_FILE = {
template: 'bdoc/voteOption.mu.html',
template: 'bdoc/voteOption.html',
name: ':value.html', // ":value" is a placeholder to replace with sanitized file name
mimeType: 'text/html'
};

var USERINFO_FILE = {
template: 'bdoc/userinfo.mu.html',
template: 'bdoc/userinfo.html',
name: '__userinfo.html',
mimeType: 'text/html'
};
Expand Down
2 changes: 1 addition & 1 deletion libs/cosEtherpad.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module.exports = function (app) {
return Promise.resolve(html);
} else {
var stream = mu.compileAndRender(
'etherpad/default.mu.html',
'etherpad/default.html',
{
title: lang.PLACEHOLDER_TITLE,
description: lang.PLACEHOLDER_TOPIC_TEXT
Expand Down
2 changes: 1 addition & 1 deletion libs/email.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = function (app) {
var resolveTemplate = function (template, language) {
language = language ? language.toLowerCase() : 'en';

var pathTemplate = ':templateRoot/build/:template_:language.mu.html'
var pathTemplate = ':templateRoot/build/:template_:language.html'
.replace(':templateRoot', templateRoot)
.replace(':template', template)
.replace(':language', language);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions views/emails/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ We use Mustache templates.

The structure:

* `./*.mu.html` - Mu HTML template files with specific emails contents.
* `./*.html` - Mu HTML template files with specific emails contents.
* `layouts` - Common layout (headers, footers..) for emails. At the point of writing we had only 1 layout which all of the emails use.
* `languages` - Localization files.
* `images` - Images.
Expand All @@ -13,5 +13,5 @@ The structure:

## Development

* Modify `*.mu.html` or language files.
* Modify Mu templates `*.html` or language files.
* Translate in Crowdin - https://crowdin.com/translate/citizen-os-api
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 396532a

Please sign in to comment.