added icons to all h1s in admin panel
languages tab in ACP each language now also has a "language.json"v1.18.x
parent
119079ace5
commit
cd6af45afb
@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "German",
|
||||
"code": "de"
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "English",
|
||||
"code": "en"
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "Spanish",
|
||||
"code": "es"
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "French",
|
||||
"code": "fr"
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
define(['forum/admin/settings'], function(Settings) {
|
||||
jQuery('document').ready(function() {
|
||||
Settings.prepare();
|
||||
});
|
||||
});
|
@ -1,4 +1,4 @@
|
||||
<h1>Events</h1>
|
||||
<h1><i class="fa fa-calendar-o"></i> Events</h1>
|
||||
|
||||
<pre>
|
||||
{eventdata}
|
||||
|
@ -0,0 +1,24 @@
|
||||
|
||||
<div class="languages">
|
||||
<h1><i class="fa fa-comments-o"></i> Languages</h1>
|
||||
<hr />
|
||||
<p>
|
||||
The following setting(s) determine the language settings for your NodeBB.
|
||||
The default language determines the language settings for all users who
|
||||
are visiting your NodeBB. Keep in mind that individual users may decide
|
||||
to switch languages for their own accounts.
|
||||
</p>
|
||||
|
||||
<form class="row">
|
||||
<div class="form-group col-sm-6">
|
||||
<label for="defaultLang">Default Language</label>
|
||||
<select data-field="defaultLang" class="form-control">
|
||||
<!-- BEGIN languages -->
|
||||
<option value="{languages.code}">{languages.name}</option>
|
||||
<!-- END languages -->
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-lg btn-primary" id="save">Save</button>
|
@ -0,0 +1,51 @@
|
||||
var fs = require('fs'),
|
||||
path = require('path'),
|
||||
async = require('async'),
|
||||
|
||||
Languages = {};
|
||||
|
||||
Languages.list = function(callback) {
|
||||
var languagesPath = path.join(__dirname, '../public/language'),
|
||||
languages = [];
|
||||
|
||||
fs.readdir(languagesPath, function(err, files) {
|
||||
async.each(files, function(folder, next) {
|
||||
fs.stat(path.join(languagesPath, folder), function(err, stat) {
|
||||
if (!err) {
|
||||
if (stat.isDirectory()) {
|
||||
var configPath = path.join(languagesPath, folder, 'language.json');
|
||||
fs.exists(configPath, function(exists) {
|
||||
if (exists) {
|
||||
fs.readFile(configPath, function(err, stream) {
|
||||
languages.push(JSON.parse(stream.toString()));
|
||||
next();
|
||||
});
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
});
|
||||
}, function(err) {
|
||||
// Float "en" to the top
|
||||
languages = languages.sort(function(a, b) {
|
||||
if (a.code === 'en') {
|
||||
return -1;
|
||||
} else if (b.code === 'en') {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
|
||||
callback(err, languages);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = Languages;
|
Loading…
Reference in New Issue