-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from michaelmcmillan/languages
Support other locales than norwegian
- Loading branch information
Showing
12 changed files
with
155 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
var fs = require('fs'); | ||
|
||
function supportedLocales (allowedLocales, localesLocation, done) { | ||
|
||
var locales = []; | ||
|
||
fs.readdir(localesLocation, function(err, files) { | ||
if (err) return done(err); | ||
|
||
files.forEach(function(file) { | ||
if (allowedLocales[file] !== undefined) | ||
locales.push({ | ||
name: allowedLocales[file], | ||
file: file | ||
}); | ||
}); | ||
|
||
return done(undefined, locales); | ||
}); | ||
} | ||
|
||
module.exports = supportedLocales; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
var config = require('../config.js'); | ||
var supportedStyles = require('./supportedStyles.js'); | ||
var supportedLocales = require('./supportedLocales.js'); | ||
|
||
function supportedStylesAndLocales (done) { | ||
|
||
var allowedStyles = config.bibliography.styles.allowed; | ||
var allowedLocales = config.bibliography.locales.allowed; | ||
|
||
var stylesLocation = config.bibliography.styles.location; | ||
var localesLocation = config.bibliography.locales.location; | ||
|
||
supportedStyles(allowedStyles, stylesLocation, function (err, styles) { | ||
supportedLocales(allowedLocales, localesLocation, function (err, locales) { | ||
return done(undefined, styles, locales); | ||
}); | ||
}); | ||
} | ||
|
||
module.exports = supportedStylesAndLocales; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters