[Client] set lang
This commit is contained in:
parent
5f56d474eb
commit
9fe9d0d746
4 changed files with 10 additions and 4 deletions
|
@ -21,6 +21,11 @@ require('./common/tags');
|
||||||
|
|
||||||
console.info(`Misskey v${VERSION} (葵 aoi)`);
|
console.info(`Misskey v${VERSION} (葵 aoi)`);
|
||||||
|
|
||||||
|
{ // Set lang attr
|
||||||
|
const html = document.documentElement;
|
||||||
|
html.setAttribute('lang', LANG);
|
||||||
|
}
|
||||||
|
|
||||||
{ // Set description meta tag
|
{ // Set description meta tag
|
||||||
const head = document.getElementsByTagName('head')[0];
|
const head = document.getElementsByTagName('head')[0];
|
||||||
const meta = document.createElement('meta');
|
const meta = document.createElement('meta');
|
||||||
|
|
|
@ -7,7 +7,8 @@ import * as webpack from 'webpack';
|
||||||
import version from '../../src/version';
|
import version from '../../src/version';
|
||||||
const constants = require('../../src/const.json');
|
const constants = require('../../src/const.json');
|
||||||
|
|
||||||
export default () => new webpack.DefinePlugin({
|
export default lang => new webpack.DefinePlugin({
|
||||||
VERSION: JSON.stringify(version),
|
VERSION: JSON.stringify(version),
|
||||||
|
LANG: JSON.stringify(lang),
|
||||||
THEME_COLOR: JSON.stringify(constants.themeColor)
|
THEME_COLOR: JSON.stringify(constants.themeColor)
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,9 +8,9 @@ import banner from './banner';
|
||||||
const env = process.env.NODE_ENV;
|
const env = process.env.NODE_ENV;
|
||||||
const isProduction = env === 'production';
|
const isProduction = env === 'production';
|
||||||
|
|
||||||
export default version => {
|
export default (version, lang) => {
|
||||||
const plugins = [
|
const plugins = [
|
||||||
constant(),
|
constant(lang),
|
||||||
new StringReplacePlugin(),
|
new StringReplacePlugin(),
|
||||||
hoist()
|
hoist()
|
||||||
];
|
];
|
||||||
|
|
|
@ -32,7 +32,7 @@ module.exports = langs.map(([lang, locale]) => {
|
||||||
name,
|
name,
|
||||||
entry,
|
entry,
|
||||||
module: module_(lang, locale),
|
module: module_(lang, locale),
|
||||||
plugins: plugins(version),
|
plugins: plugins(version, lang),
|
||||||
output
|
output
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue