1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-11 11:14:04 +02:00

first zh-CN locale content

This commit is contained in:
Pomax
2017-02-16 10:21:04 -08:00
parent 7bc43cf9a8
commit 75fb647215
10 changed files with 1506 additions and 14 deletions

View File

@@ -2,6 +2,11 @@ var webpack = require('webpack');
var path = require('path');
var fs = require('fs');
const defaultLocale = "en-GB";
var locale = process.env.locale || defaultLocale;
console.log("Using locale: "+locale);
// Bundle entry point
var entry = ['./components/App.jsx'];
@@ -24,13 +29,29 @@ var webpackLoaders = [
__dirname + '/lib/textarea-loader'
];
console.log("content for entry:", entry);
var resolve = {
alias: {
LocalizedContent: path.resolve(__dirname, 'locales/en-GB/content.js')
}
};
// switch the locales
if (locale !== defaultLocale) {
resolve = {
alias: {
LocalizedContent: path.resolve(__dirname, 'locales/' + locale + '/content.js')
}
};
output.filename = 'article.' + locale + '.js';
console.log("using " + resolve.alias.LocalizedContent + " for output " + output.filename);
}
// And the final config that webpack will read in.
module.exports = {
entry: entry,
target: target,
output: output,
resolve: resolve,
module: {
loaders: [
{