Skip to content

Commit

Permalink
0.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
masylum committed Dec 15, 2010
1 parent 8cae4f7 commit 58c57c7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
38 changes: 23 additions & 15 deletions lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,24 @@ module.exports = function (app, dialect, options) {

app.get('', authenticate, function (req, res) {
res.render('index', {
title: 'Edit your translations',
locale: null
locals: {
title: 'Edit your translations',
locale: null
}
});
});

app.get('/:locale', authenticate, function (req, res) {
dialect.config('store').get({locale: req.param('locale')}, function (error, translations) {
dialect.config('store').count({locale: req.param('locale'), translation: {'$ne' : null}}, function (error, count) {
res.render('locale', {
title: title + 'Translate ' + req.param('locale'),
translations: translations,
count: count,
category: 'All',
locale: req.param('locale')
locals: {
title: title + 'Translate ' + req.param('locale'),
translations: translations,
count: count,
category: 'All',
locale: req.param('locale')
}
});
});
});
Expand All @@ -35,21 +39,25 @@ module.exports = function (app, dialect, options) {
app.get('/:locale/translated', authenticate, function (req, res) {
dialect.config('store').get({locale: req.param('locale'), translation: {'$ne': null}}, function (error, translations) {
res.render('locale', {
title: title + 'Translated ' + req.param('locale'),
translations: translations,
category: 'Translated',
locale: req.param('locale')
locals: {
title: title + 'Translated ' + req.param('locale'),
translations: translations,
category: 'Translated',
locale: req.param('locale')
}
});
});
});

app.get('/:locale/untranslated', authenticate, function (req, res) {
dialect.config('store').get({locale: req.param('locale'), translation: null}, function (error, translations) {
res.render('locale', {
title: title + 'Untranslated ' + req.param('locale'),
translations: translations,
category: 'Untranslated',
locale: req.param('locale')
locals: {
title: title + 'Untranslated ' + req.param('locale'),
translations: translations,
category: 'Untranslated',
locale: req.param('locale')
}
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion lib/helpers/dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
return function () {
var messages = req.flash();

return res.partial('partials/flash_messages', {
return res.partial('flash_messages', {
object: messages,
as: 'types',
locals: {hasFlashMessages: Object.keys(messages).length},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "express-dialect",
"description": "Pluggable express translation tool.",
"version": "0.0.7",
"version": "0.0.8",
"author": "Pau Ramon <masylum@gmail.com>",
"dependencies": { "dialect": ">=0.0.4", "connect": ">=0.2.5", "express": ">=1.0.0", "connect-auth": "0.2.1", "connect-i18n": "0.0.1"},
"main": "./lib/express-dialect",
Expand Down

0 comments on commit 58c57c7

Please sign in to comment.