diff --git a/src/web/app/init.js b/src/web/app/init.js index cb661c2595..5a6899ed4f 100644 --- a/src/web/app/init.js +++ b/src/web/app/init.js @@ -21,6 +21,11 @@ require('./common/tags'); console.info(`Misskey v${VERSION} (葵 aoi)`); +{ // Set lang attr + const html = document.documentElement; + html.setAttribute('lang', LANG); +} + { // Set description meta tag const head = document.getElementsByTagName('head')[0]; const meta = document.createElement('meta'); diff --git a/webpack/plugins/const.ts b/webpack/plugins/const.ts index ccfcb45260..f64160b01a 100644 --- a/webpack/plugins/const.ts +++ b/webpack/plugins/const.ts @@ -7,7 +7,8 @@ import * as webpack from 'webpack'; import version from '../../src/version'; const constants = require('../../src/const.json'); -export default () => new webpack.DefinePlugin({ +export default lang => new webpack.DefinePlugin({ VERSION: JSON.stringify(version), + LANG: JSON.stringify(lang), THEME_COLOR: JSON.stringify(constants.themeColor) }); diff --git a/webpack/plugins/index.ts b/webpack/plugins/index.ts index d5191f1555..345af7df9e 100644 --- a/webpack/plugins/index.ts +++ b/webpack/plugins/index.ts @@ -8,9 +8,9 @@ import banner from './banner'; const env = process.env.NODE_ENV; const isProduction = env === 'production'; -export default version => { +export default (version, lang) => { const plugins = [ - constant(), + constant(lang), new StringReplacePlugin(), hoist() ]; diff --git a/webpack/webpack.config.ts b/webpack/webpack.config.ts index 066df18157..97782a4102 100644 --- a/webpack/webpack.config.ts +++ b/webpack/webpack.config.ts @@ -32,7 +32,7 @@ module.exports = langs.map(([lang, locale]) => { name, entry, module: module_(lang, locale), - plugins: plugins(version), + plugins: plugins(version, lang), output }; });