From f0528e9d43fb1ba416fc0cb459a387eb3f90af14 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 4 Jun 2020 17:29:00 -0500 Subject: [PATCH 01/14] Better locale detection --- app/soapbox/actions/settings.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/soapbox/actions/settings.js b/app/soapbox/actions/settings.js index 10005844c..815479b96 100644 --- a/app/soapbox/actions/settings.js +++ b/app/soapbox/actions/settings.js @@ -21,8 +21,7 @@ const defaultSettings = ImmutableMap({ deleteModal: true, defaultPrivacy: 'public', themeMode: 'light', - // locale: navigator.language.slice(0, 2) || 'en', // FIXME: Dynamic locales - locale: 'en', + locale: navigator.language.split(/[-_]/)[0] || 'en', systemFont: false, dyslexicFont: false, From e935fb90b91f164de6beedae41e0dfb815ca6f65 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 4 Jun 2020 17:31:17 -0500 Subject: [PATCH 02/14] Remove generateLocalePacks.js --- webpack/generateLocalePacks.js | 50 ---------------------------------- webpack/shared.js | 9 +----- 2 files changed, 1 insertion(+), 58 deletions(-) delete mode 100644 webpack/generateLocalePacks.js diff --git a/webpack/generateLocalePacks.js b/webpack/generateLocalePacks.js deleted file mode 100644 index 2a7f99b47..000000000 --- a/webpack/generateLocalePacks.js +++ /dev/null @@ -1,50 +0,0 @@ -// To avoid adding a lot of boilerplate, locale packs are -// automatically generated here. These are written into the tmp/ -// directory and then used to generate locale_en.js, locale_fr.js, etc. - -const fs = require('fs'); -const path = require('path'); -const rimraf = require('rimraf'); -const mkdirp = require('mkdirp'); - -const localesJsonPath = path.join(__dirname, '../app/soapbox/locales'); -const locales = fs.readdirSync(localesJsonPath).filter(filename => { - return /\.json$/.test(filename) && - !/defaultMessages/.test(filename) && - !/whitelist/.test(filename); -}).map(filename => filename.replace(/\.json$/, '')); - -const outPath = path.join(__dirname, '..', 'tmp', 'packs'); - -rimraf.sync(outPath); -mkdirp.sync(outPath); - -const outPaths = []; - -locales.forEach(locale => { - const localePath = path.join(outPath, `locale_${locale}.js`); - const baseLocale = locale.split('-')[0]; // e.g. 'zh-TW' -> 'zh' - const localeDataPath = [ - // first try react-intl - `../../node_modules/react-intl/locale-data/${baseLocale}.js`, - // then check locales/locale-data - `../../app/soapbox/locales/locale-data/${baseLocale}.js`, - // fall back to English (this is what react-intl does anyway) - '../../node_modules/react-intl/locale-data/en.js', - ].filter(filename => fs.existsSync(path.join(outPath, filename))) - .map(filename => filename.replace(/..\/..\/node_modules\//, ''))[0]; - - const localeContent = `// -// locale_${locale}.js -// automatically generated by generateLocalePacks.js -// -import messages from '../../app/soapbox/locales/${locale}.json'; -import localeData from ${JSON.stringify(localeDataPath)}; -import { setLocale } from '../../app/soapbox/locales'; -setLocale({messages, localeData}); -`; - fs.writeFileSync(localePath, localeContent, 'utf8'); - outPaths.push(localePath); -}); - -module.exports = outPaths; diff --git a/webpack/shared.js b/webpack/shared.js index 643309192..ca662d0a4 100644 --- a/webpack/shared.js +++ b/webpack/shared.js @@ -1,24 +1,17 @@ // Note: You must restart bin/webpack-dev-server for changes to take effect const webpack = require('webpack'); -const { basename, join, resolve } = require('path'); +const { join, resolve } = require('path'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const AssetsManifestPlugin = require('webpack-assets-manifest'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin'); -const extname = require('path-complete-extname'); const { env, settings, output } = require('./configuration'); const rules = require('./rules'); -const localePackPaths = require('./generateLocalePacks'); module.exports = { entry: Object.assign( { application: resolve('app/application.js') }, - localePackPaths.reduce((map, entry) => { - const localMap = map; - localMap[basename(entry, extname(entry, extname(entry)))] = resolve(entry); - return localMap; - }, {}), { styles: resolve(join(settings.source_path, 'styles/application.scss')) } ), From 0463a70d7eeb17dd8e30850f630c9b38b63abf8f Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 4 Jun 2020 17:57:31 -0500 Subject: [PATCH 03/14] Upgrade react-intl to 4.x --- package.json | 2 +- yarn.lock | 143 ++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 113 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index 8e700dc41..6171a01fe 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "react-hotkeys": "^1.1.4", "react-immutable-proptypes": "^2.1.0", "react-immutable-pure-component": "^1.1.1", - "react-intl": "^2.9.0", + "react-intl": "^4.6.6", "react-masonry-infinite": "^1.2.2", "react-motion": "^0.5.2", "react-notification": "^6.8.4", diff --git a/yarn.lock b/yarn.lock index 8185280d5..d3bb4b033 100644 --- a/yarn.lock +++ b/yarn.lock @@ -932,6 +932,41 @@ resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-0.8.2.tgz#576ff7fb1230185b619a75d258cbc98f0867a8dc" integrity sha512-rLu3wcBWH4P5q1CGoSSH/i9hrXs7SlbRLkoq9IGuoPYNGQvDJ3pt/wmOM+XgYjIDRMVIdkUWt0RsfzF50JfnCw== +"@formatjs/intl-displaynames@^2.2.4": + version "2.2.4" + resolved "https://registry.yarnpkg.com/@formatjs/intl-displaynames/-/intl-displaynames-2.2.4.tgz#c85d59b0d157470347fdfe86fb8fba7da998ebe1" + integrity sha512-/pRjDRcWub+JZ1B/oPHUhYdukyXoV28cyTMtSPNwEwxF1KIBz44X+EUaZuens9nM8DJtD3GvR9SnlicdT+tb9Q== + dependencies: + "@formatjs/intl-utils" "^3.3.1" + +"@formatjs/intl-listformat@^2.2.4": + version "2.2.4" + resolved "https://registry.yarnpkg.com/@formatjs/intl-listformat/-/intl-listformat-2.2.4.tgz#c7014ae7b593b9e20d24b6620e148122162903dc" + integrity sha512-sVKRJcrny4N/T2Z0k6qCfvYnl45zlPZcPWoafpLx7JDklWdhqIegdmtT6pncnDdCOLvV8AeyS9JHK3M6+UXWCg== + dependencies: + "@formatjs/intl-utils" "^3.3.1" + +"@formatjs/intl-numberformat@^4.2.4": + version "4.2.4" + resolved "https://registry.yarnpkg.com/@formatjs/intl-numberformat/-/intl-numberformat-4.2.4.tgz#8d8e5b7d3ac9a3ed651b7895c806355ca3d24bc4" + integrity sha512-uPaDLCIZn/ORqmFE56CorGIU0wZZFgc1h7sjZ2ARxL1BG1dZBI8bLYSdb243xZYU/b/1fnRTVpZi4UJjW9NEOw== + dependencies: + "@formatjs/intl-utils" "^3.3.1" + +"@formatjs/intl-relativetimeformat@^5.2.4": + version "5.2.4" + resolved "https://registry.yarnpkg.com/@formatjs/intl-relativetimeformat/-/intl-relativetimeformat-5.2.4.tgz#21465c3d4070c1a62abff531a9feec9390972bf8" + integrity sha512-dY3KBGWT6fPa+JM9zEUNOjfsKWJPd58lME0UdC10NidGzvQS74AmmUB06Fa3vRZm+u/1m6hJycIh7qy38MHnZA== + dependencies: + "@formatjs/intl-utils" "^3.3.1" + +"@formatjs/intl-utils@^3.3.1": + version "3.3.1" + resolved "https://registry.yarnpkg.com/@formatjs/intl-utils/-/intl-utils-3.3.1.tgz#7ceadbb7e251318729d9bf693731e1a5dcdfa15a" + integrity sha512-7AAicg2wqCJQ+gFEw5Nxp+ttavajBrPAD1HDmzA4jzvUCrF5a2NCJm/c5qON3VBubWWF2cu8HglEouj2h/l7KQ== + dependencies: + emojis-list "^3.0.0" + "@jest/console@^24.7.1": version "24.7.1" resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545" @@ -1135,11 +1170,24 @@ "@types/minimatch" "*" "@types/node" "*" +"@types/hoist-non-react-statics@^3.3.1": + version "3.3.1" + resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f" + integrity sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA== + dependencies: + "@types/react" "*" + hoist-non-react-statics "^3.3.0" + "@types/html-minifier-terser@^5.0.0": version "5.1.0" resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-5.1.0.tgz#551a4589b6ee2cc9c1dff08056128aec29b94880" integrity sha512-iYCgjm1dGPRuo12+BStjd1HiVQqhlRhWDOQigNxn023HcjnhsiFz9pc6CzJj4HwDCSQca9bxTL4PxJDbkdm3PA== +"@types/invariant@^2.2.31": + version "2.2.33" + resolved "https://registry.yarnpkg.com/@types/invariant/-/invariant-2.2.33.tgz#ec5eec29c63bf5e4ca164e9feb3ef7337cdcbadb" + integrity sha512-/jUNmS8d4bCKdqslfxW6dg/9Gksfzxz67IYfqApHn+HvHlMVXwYv2zpTDnS/yaK9BB0i0GlBTaYci0EFE62Hmw== + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" @@ -1170,11 +1218,24 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.18.tgz#1d3ca764718915584fcd9f6344621b7672665c67" integrity sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ== +"@types/prop-types@*": + version "15.7.3" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7" + integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw== + "@types/q@^1.5.1": version "1.5.1" resolved "https://registry.yarnpkg.com/@types/q/-/q-1.5.1.tgz#48fd98c1561fe718b61733daed46ff115b496e18" integrity sha512-eqz8c/0kwNi/OEHQfvIuJVLTst3in0e7uTKeuY+WL/zfKn0xVujOTp42bS/vUUokhK5P2BppLd9JXMOMHcgbjA== +"@types/react@*": + version "16.9.35" + resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.35.tgz#a0830d172e8aadd9bd41709ba2281a3124bbd368" + integrity sha512-q0n0SsWcGc8nDqH2GJfWQWUOmZSJhXV64CjVN5SvcNti3TdEaA3AH0D8DwNmMdzjMAC/78tB8nAZIlV8yTz+zQ== + dependencies: + "@types/prop-types" "*" + csstype "^2.2.0" + "@types/react@16.4.6": version "16.4.6" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.4.6.tgz#5024957c6bcef4f02823accf5974faba2e54fada" @@ -3561,6 +3622,11 @@ emojis-list@^2.0.0: resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= +emojis-list@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" + integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== + emotion@^9.1.2: version "9.2.12" resolved "https://registry.yarnpkg.com/emotion/-/emotion-9.2.12.tgz#53925aaa005614e65c6e43db8243c843574d1ea9" @@ -4944,6 +5010,13 @@ hoist-non-react-statics@^3.3.0: dependencies: react-is "^16.7.0" +hoist-non-react-statics@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" + integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== + dependencies: + react-is "^16.7.0" + homedir-polyfill@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" @@ -5312,20 +5385,15 @@ intersection-observer@^0.7.0: resolved "https://registry.yarnpkg.com/intersection-observer/-/intersection-observer-0.7.0.tgz#ee16bee978db53516ead2f0a8154b09b400bbdc9" integrity sha512-Id0Fij0HsB/vKWGeBe9PxeY45ttRiBmhFyyt/geBdDHBYNctMRTE3dC1U3ujzz3lap+hVXlEcVaB56kZP/eEUg== -intl-format-cache@^2.0.5: - version "2.1.0" - resolved "https://registry.yarnpkg.com/intl-format-cache/-/intl-format-cache-2.1.0.tgz#04a369fecbfad6da6005bae1f14333332dcf9316" - integrity sha1-BKNp/sv61tpgBbrh8UMzMy3PkxY= - intl-format-cache@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/intl-format-cache/-/intl-format-cache-4.2.2.tgz#4e745d4cda3aa9df2495f0493bed4c6c4ff7093d" integrity sha512-7tY3XadLn8rMHiYVUzH/6NmOe944nJ59LdAWuFm64/m2OfFAEkZTtTHxrEtoxq7HWFddX4aRwDb9P8KB5Z2AvQ== -intl-messageformat-parser@1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/intl-messageformat-parser/-/intl-messageformat-parser-1.4.0.tgz#b43d45a97468cadbe44331d74bb1e8dea44fc075" - integrity sha1-tD1FqXRoytvkQzHXS7Ho3qRPwHU= +intl-format-cache@^4.2.36: + version "4.2.36" + resolved "https://registry.yarnpkg.com/intl-format-cache/-/intl-format-cache-4.2.36.tgz#d23eba77be5357c0f5efb5e059024d3a9b3576d3" + integrity sha512-fOPm5Z0Krge7/rYq6hc1c/m8HRu9MwgnhLU7M9J4w3wHZS2RQwyZ0kpzmY9n86YRuUlcH29bGoeKDx/7D1nRhg== intl-messageformat-parser@^1.6.3: version "1.6.3" @@ -5337,12 +5405,12 @@ intl-messageformat-parser@^3.2.1: resolved "https://registry.yarnpkg.com/intl-messageformat-parser/-/intl-messageformat-parser-3.2.1.tgz#598795221267cbbd206f1497c42ffced9b5565b6" integrity sha512-ajCL1k1ha0mUrutlBTo5vcTzyfdH2OoghUu8SmR7tJ1D0uifZh9Hqd3ZC2SYVv/GTfTdW//rgKonMgAhZWmwZg== -intl-messageformat@^2.0.0, intl-messageformat@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-2.2.0.tgz#345bcd46de630b7683330c2e52177ff5eab484fc" - integrity sha1-NFvNRt5jC3aDMwwuUhd/9eq0hPw= +intl-messageformat-parser@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/intl-messageformat-parser/-/intl-messageformat-parser-5.1.1.tgz#1f223c6c615ada46bd8902cdae7f5f7c21f08934" + integrity sha512-KSKa+pGpxhfAtx9CptkdqGebs2/f6GWAGfoWsPe6SvxRNk6egYFfewpyH3YXwY2ZMeiZ/Q82buWZhxHKazFrBQ== dependencies: - intl-messageformat-parser "1.4.0" + "@formatjs/intl-numberformat" "^4.2.4" intl-messageformat@^7.0.0: version "7.3.2" @@ -5352,6 +5420,14 @@ intl-messageformat@^7.0.0: intl-format-cache "^4.2.2" intl-messageformat-parser "^3.2.1" +intl-messageformat@^8.3.21: + version "8.3.21" + resolved "https://registry.yarnpkg.com/intl-messageformat/-/intl-messageformat-8.3.21.tgz#525a6597d7860a6048e16297f81f762ee8e9e10e" + integrity sha512-zicqT9IVMwPFDATBZhkXI7y/opo3BOKcTS+vPdco7H9sGWXx0m+aAE3Irvgmfhp7gyJEmfdAxU6+6mJW49/sVw== + dependencies: + intl-format-cache "^4.2.36" + intl-messageformat-parser "^5.1.1" + intl-pluralrules@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/intl-pluralrules/-/intl-pluralrules-1.1.1.tgz#b7ee135a9f0f5630d57a59c4a7ab8b875484f64d" @@ -5359,19 +5435,12 @@ intl-pluralrules@^1.1.1: dependencies: make-plural "^6.0.1" -intl-relativeformat@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/intl-relativeformat/-/intl-relativeformat-2.2.0.tgz#6aca95d019ec8d30b6c5653b6629f9983ea5b6c5" - integrity sha512-4bV/7kSKaPEmu6ArxXf9xjv1ny74Zkwuey8Pm01NH4zggPP7JHwg2STk8Y3JdspCKRDriwIyLRfEXnj2ZLr4Bw== - dependencies: - intl-messageformat "^2.0.0" - intl@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/intl/-/intl-1.2.5.tgz#82244a2190c4e419f8371f5aa34daa3420e2abde" integrity sha1-giRKIZDE5Bn4Nx9ao02qNCDiq94= -invariant@^2.1.1, invariant@^2.2.2, invariant@^2.2.4: +invariant@^2.2.2, invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== @@ -8592,16 +8661,23 @@ react-intl-translations-manager@^5.0.3: json-stable-stringify "^1.0.1" mkdirp "^0.5.1" -react-intl@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/react-intl/-/react-intl-2.9.0.tgz#c97c5d17d4718f1575fdbd5a769f96018a3b1843" - integrity sha512-27jnDlb/d2A7mSJwrbOBnUgD+rPep+abmoJE511Tf8BnoONIAUehy/U1zZCHGO17mnOwMWxqN4qC0nW11cD6rA== +react-intl@^4.6.6: + version "4.6.6" + resolved "https://registry.yarnpkg.com/react-intl/-/react-intl-4.6.6.tgz#58653e78ae8f905b80c785b0a9c862ffaa30d543" + integrity sha512-ykah1umgIOHTC4DZ5fFn6U5ZtSMW5sZKKG5sFL5xrNA55UVnzU3g+v1j0fapO85VMC8x6db+ixP9mgX60Ziupw== dependencies: - hoist-non-react-statics "^3.3.0" - intl-format-cache "^2.0.5" - intl-messageformat "^2.1.0" - intl-relativeformat "^2.1.0" - invariant "^2.1.1" + "@formatjs/intl-displaynames" "^2.2.4" + "@formatjs/intl-listformat" "^2.2.4" + "@formatjs/intl-numberformat" "^4.2.4" + "@formatjs/intl-relativetimeformat" "^5.2.4" + "@formatjs/intl-utils" "^3.3.1" + "@types/hoist-non-react-statics" "^3.3.1" + "@types/invariant" "^2.2.31" + hoist-non-react-statics "^3.3.2" + intl-format-cache "^4.2.36" + intl-messageformat "^8.3.21" + intl-messageformat-parser "^5.1.1" + shallow-equal "^1.2.1" react-is@^16.3.2, react-is@^16.6.1, react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.2, react-is@^16.8.4: version "16.8.6" @@ -9558,6 +9634,11 @@ shallow-clone@^3.0.0: dependencies: kind-of "^6.0.2" +shallow-equal@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.2.1.tgz#4c16abfa56043aa20d050324efa68940b0da79da" + integrity sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA== + shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" From 3ae22ce8eede6693a06170ab0ad7e219830602b0 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 4 Jun 2020 18:11:24 -0500 Subject: [PATCH 04/14] Add missing tags back to some FormattedMessages --- app/soapbox/components/loading_indicator.js | 2 +- app/soapbox/features/ui/components/tabs_bar.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/soapbox/components/loading_indicator.js b/app/soapbox/components/loading_indicator.js index d6a5adb6f..205c84d96 100644 --- a/app/soapbox/components/loading_indicator.js +++ b/app/soapbox/components/loading_indicator.js @@ -4,7 +4,7 @@ import { FormattedMessage } from 'react-intl'; const LoadingIndicator = () => (
- +
); diff --git a/app/soapbox/features/ui/components/tabs_bar.js b/app/soapbox/features/ui/components/tabs_bar.js index 9f6d2b35b..5a906160d 100644 --- a/app/soapbox/features/ui/components/tabs_bar.js +++ b/app/soapbox/features/ui/components/tabs_bar.js @@ -68,26 +68,26 @@ class TabsBar extends React.PureComponent { links.push( Logo - + ); } links.push( - + ); if (account) { links.push( - + ); } links.push( - + ); return links.map((link) => From 36447e4bf276c03908cab518b620591c11cdc4c3 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 4 Jun 2020 18:32:46 -0500 Subject: [PATCH 05/14] Add Language dropdown to Preferences --- app/soapbox/features/preferences/index.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/app/soapbox/features/preferences/index.js b/app/soapbox/features/preferences/index.js index 97225ceee..5a244a27e 100644 --- a/app/soapbox/features/preferences/index.js +++ b/app/soapbox/features/preferences/index.js @@ -33,10 +33,11 @@ class Preferences extends ImmutablePureComponent { settings: ImmutablePropTypes.map, }; - onThemeChange = e => { - const { dispatch } = this.props; - dispatch(changeSetting(['themeMode'], e.target.value)); - } + onSelectChange = path => { + return e => { + this.props.dispatch(changeSetting(path, e.target.value)); + }; + }; onDefaultPrivacyChange = e => { const { dispatch } = this.props; @@ -51,10 +52,19 @@ class Preferences extends ImmutablePureComponent { + + + + From 6e1db9a013e102d41dec8a9ec7e46b7cad868197 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 4 Jun 2020 18:34:28 -0500 Subject: [PATCH 06/14] Basic locale support --- app/soapbox/containers/soapbox.js | 9 +-- app/soapbox/locales/messages.js | 126 ++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+), 6 deletions(-) create mode 100644 app/soapbox/locales/messages.js diff --git a/app/soapbox/containers/soapbox.js b/app/soapbox/containers/soapbox.js index 7c196252a..708cf6688 100644 --- a/app/soapbox/containers/soapbox.js +++ b/app/soapbox/containers/soapbox.js @@ -14,8 +14,7 @@ import UI from '../features/ui'; // import Introduction from '../features/introduction'; import { fetchCustomEmojis } from '../actions/custom_emojis'; import { hydrateStore } from '../actions/store'; -import { IntlProvider, addLocaleData } from 'react-intl'; -import { getLocale } from '../locales'; +import { IntlProvider } from 'react-intl'; import initialState from '../initial_state'; import ErrorBoundary from '../components/error_boundary'; import { fetchInstance } from 'soapbox/actions/instance'; @@ -24,6 +23,7 @@ import { fetchMe } from 'soapbox/actions/me'; import PublicLayout from 'soapbox/features/public_layout'; import { getSettings } from 'soapbox/actions/settings'; import { generateThemeCss } from 'soapbox/utils/theme'; +import messages from 'soapbox/locales/messages'; export const store = configureStore(); const hydrateAction = hydrateStore(initialState); @@ -73,9 +73,6 @@ class SoapboxMount extends React.PureComponent { const { me, themeCss, locale } = this.props; if (me === null) return null; - const { localeData, messages } = getLocale(); - addLocaleData(localeData); - // Disabling introduction for launch // const { showIntroduction } = this.props; // @@ -91,7 +88,7 @@ class SoapboxMount extends React.PureComponent { }); return ( - + <> diff --git a/app/soapbox/locales/messages.js b/app/soapbox/locales/messages.js new file mode 100644 index 000000000..e5419ac73 --- /dev/null +++ b/app/soapbox/locales/messages.js @@ -0,0 +1,126 @@ +export default { + 'ar': require('./ar.json'), + 'ast': require('./ast.json'), + 'bg': require('./bg.json'), + 'bn': require('./bn.json'), + 'br': require('./br.json'), + 'ca': require('./ca.json'), + 'co': require('./co.json'), + 'cs': require('./cs.json'), + 'cy': require('./cy.json'), + 'da': require('./da.json'), + 'de': require('./de.json'), + 'el': require('./el.json'), + 'en': require('./en.json'), + 'eo': require('./eo.json'), + 'es-AR': require('./es-AR.json'), + 'es': require('./es.json'), + 'et': require('./et.json'), + 'eu': require('./eu.json'), + 'fa': require('./fa.json'), + 'fi': require('./fi.json'), + 'fr': require('./fr.json'), + 'ga': require('./ga.json'), + 'gl': require('./gl.json'), + 'he': require('./he.json'), + 'hi': require('./hi.json'), + 'hr': require('./hr.json'), + 'hu': require('./hu.json'), + 'hy': require('./hy.json'), + 'id': require('./id.json'), + 'io': require('./io.json'), + 'it': require('./it.json'), + 'ja': require('./ja.json'), + 'ka': require('./ka.json'), + 'kk': require('./kk.json'), + 'ko': require('./ko.json'), + 'lt': require('./lt.json'), + 'lv': require('./lv.json'), + 'mk': require('./mk.json'), + 'ms': require('./ms.json'), + 'nl': require('./nl.json'), + 'nn': require('./nn.json'), + 'no': require('./no.json'), + 'oc': require('./oc.json'), + 'pl': require('./pl.json'), + 'pt-BR': require('./pt-BR.json'), + 'pt': require('./pt.json'), + 'ro': require('./ro.json'), + 'ru': require('./ru.json'), + 'sk': require('./sk.json'), + 'sl': require('./sl.json'), + 'sq': require('./sq.json'), + 'sr': require('./sr.json'), + 'sr-Latn': require('./sr-Latn.json'), + 'sv': require('./sv.json'), + 'ta': require('./ta.json'), + 'te': require('./te.json'), + 'th': require('./th.json'), + 'tr': require('./tr.json'), + 'uk': require('./uk.json'), + 'whitelist_ar': require('./whitelist_ar.json'), + 'whitelist_ast': require('./whitelist_ast.json'), + 'whitelist_bg': require('./whitelist_bg.json'), + 'whitelist_bn': require('./whitelist_bn.json'), + 'whitelist_br': require('./whitelist_br.json'), + 'whitelist_ca': require('./whitelist_ca.json'), + 'whitelist_co': require('./whitelist_co.json'), + 'whitelist_cs': require('./whitelist_cs.json'), + 'whitelist_cy': require('./whitelist_cy.json'), + 'whitelist_da': require('./whitelist_da.json'), + 'whitelist_de': require('./whitelist_de.json'), + 'whitelist_el': require('./whitelist_el.json'), + 'whitelist_en': require('./whitelist_en.json'), + 'whitelist_eo': require('./whitelist_eo.json'), + 'whitelist_es-AR': require('./whitelist_es-AR.json'), + 'whitelist_es': require('./whitelist_es.json'), + 'whitelist_et': require('./whitelist_et.json'), + 'whitelist_eu': require('./whitelist_eu.json'), + 'whitelist_fa': require('./whitelist_fa.json'), + 'whitelist_fi': require('./whitelist_fi.json'), + 'whitelist_fr': require('./whitelist_fr.json'), + 'whitelist_ga': require('./whitelist_ga.json'), + 'whitelist_gl': require('./whitelist_gl.json'), + 'whitelist_he': require('./whitelist_he.json'), + 'whitelist_hi': require('./whitelist_hi.json'), + 'whitelist_hr': require('./whitelist_hr.json'), + 'whitelist_hu': require('./whitelist_hu.json'), + 'whitelist_hy': require('./whitelist_hy.json'), + 'whitelist_id': require('./whitelist_id.json'), + 'whitelist_io': require('./whitelist_io.json'), + 'whitelist_it': require('./whitelist_it.json'), + 'whitelist_ja': require('./whitelist_ja.json'), + 'whitelist_ka': require('./whitelist_ka.json'), + 'whitelist_kk': require('./whitelist_kk.json'), + 'whitelist_ko': require('./whitelist_ko.json'), + 'whitelist_lt': require('./whitelist_lt.json'), + 'whitelist_lv': require('./whitelist_lv.json'), + 'whitelist_mk': require('./whitelist_mk.json'), + 'whitelist_ms': require('./whitelist_ms.json'), + 'whitelist_nl': require('./whitelist_nl.json'), + 'whitelist_nn': require('./whitelist_nn.json'), + 'whitelist_no': require('./whitelist_no.json'), + 'whitelist_oc': require('./whitelist_oc.json'), + 'whitelist_pl': require('./whitelist_pl.json'), + 'whitelist_pt-BR': require('./whitelist_pt-BR.json'), + 'whitelist_pt': require('./whitelist_pt.json'), + 'whitelist_ro': require('./whitelist_ro.json'), + 'whitelist_ru': require('./whitelist_ru.json'), + 'whitelist_sk': require('./whitelist_sk.json'), + 'whitelist_sl': require('./whitelist_sl.json'), + 'whitelist_sq': require('./whitelist_sq.json'), + 'whitelist_sr': require('./whitelist_sr.json'), + 'whitelist_sr-Latn': require('./whitelist_sr-Latn.json'), + 'whitelist_sv': require('./whitelist_sv.json'), + 'whitelist_ta': require('./whitelist_ta.json'), + 'whitelist_te': require('./whitelist_te.json'), + 'whitelist_th': require('./whitelist_th.json'), + 'whitelist_tr': require('./whitelist_tr.json'), + 'whitelist_uk': require('./whitelist_uk.json'), + 'whitelist_zh-CN': require('./whitelist_zh-CN.json'), + 'whitelist_zh-HK': require('./whitelist_zh-HK.json'), + 'whitelist_zh-TW': require('./whitelist_zh-TW.json'), + 'zh-CN': require('./zh-CN.json'), + 'zh-HK': require('./zh-HK.json'), + 'zh-TW': require('./zh-TW.json'), +}; From 52621e8db81ae386482fe57c7f99ba62d9981118 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 4 Jun 2020 19:30:24 -0500 Subject: [PATCH 07/14] intl.now() --> Date.now() --- app/soapbox/components/relative_timestamp.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/soapbox/components/relative_timestamp.js b/app/soapbox/components/relative_timestamp.js index 7cbc85660..e66c031c1 100644 --- a/app/soapbox/components/relative_timestamp.js +++ b/app/soapbox/components/relative_timestamp.js @@ -122,7 +122,7 @@ class RelativeTimestamp extends React.Component { }; state = { - now: this.props.intl.now(), + now: Date.now(), }; static defaultProps = { @@ -139,7 +139,7 @@ class RelativeTimestamp extends React.Component { componentWillReceiveProps(nextProps) { if (this.props.timestamp !== nextProps.timestamp) { - this.setState({ now: this.props.intl.now() }); + this.setState({ now: Date.now() }); } } @@ -166,7 +166,7 @@ class RelativeTimestamp extends React.Component { const delay = delta < 0 ? Math.max(updateInterval, unitDelay - unitRemainder) : Math.max(updateInterval, unitRemainder); this._timer = setTimeout(() => { - this.setState({ now: this.props.intl.now() }); + this.setState({ now: Date.now() }); }, delay); } From 36f5b6cea87365d3a131cdb338d35f4eeabb76d7 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 4 Jun 2020 19:34:36 -0500 Subject: [PATCH 08/14] Delete unused container components --- app/soapbox/containers/compose_container.js | 41 --------- app/soapbox/containers/media_container.js | 92 -------------------- app/soapbox/containers/timeline_container.js | 58 ------------ 3 files changed, 191 deletions(-) delete mode 100644 app/soapbox/containers/compose_container.js delete mode 100644 app/soapbox/containers/media_container.js delete mode 100644 app/soapbox/containers/timeline_container.js diff --git a/app/soapbox/containers/compose_container.js b/app/soapbox/containers/compose_container.js deleted file mode 100644 index 928d12a21..000000000 --- a/app/soapbox/containers/compose_container.js +++ /dev/null @@ -1,41 +0,0 @@ -import React from 'react'; -import { Provider } from 'react-redux'; -import PropTypes from 'prop-types'; -import configureStore from '../store/configureStore'; -import { hydrateStore } from '../actions/store'; -import { IntlProvider, addLocaleData } from 'react-intl'; -import { getLocale } from '../locales'; -import Compose from '../features/standalone/compose'; -import initialState from '../initial_state'; -import { fetchCustomEmojis } from '../actions/custom_emojis'; - -const { localeData, messages } = getLocale(); -addLocaleData(localeData); - -const store = configureStore(); - -if (initialState) { - store.dispatch(hydrateStore(initialState)); -} - -store.dispatch(fetchCustomEmojis()); - -export default class TimelineContainer extends React.PureComponent { - - static propTypes = { - locale: PropTypes.string.isRequired, - }; - - render() { - const { locale } = this.props; - - return ( - - - - - - ); - } - -} diff --git a/app/soapbox/containers/media_container.js b/app/soapbox/containers/media_container.js deleted file mode 100644 index 5c6c248b1..000000000 --- a/app/soapbox/containers/media_container.js +++ /dev/null @@ -1,92 +0,0 @@ -import React, { PureComponent, Fragment } from 'react'; -import ReactDOM from 'react-dom'; -import PropTypes from 'prop-types'; -import { IntlProvider, addLocaleData } from 'react-intl'; -import { getLocale } from '../locales'; -import MediaGallery from '../components/media_gallery'; -import Video from '../features/video'; -import Card from '../features/status/components/card'; -import Poll from 'soapbox/components/poll'; -import ModalRoot from '../components/modal_root'; -import MediaModal from '../features/ui/components/media_modal'; -import { List as ImmutableList, fromJS } from 'immutable'; - -const { localeData, messages } = getLocale(); -addLocaleData(localeData); - -const MEDIA_COMPONENTS = { MediaGallery, Video, Card, Poll }; - -export default class MediaContainer extends PureComponent { - - static propTypes = { - locale: PropTypes.string.isRequired, - components: PropTypes.object.isRequired, - }; - - state = { - media: null, - index: null, - time: null, - }; - - handleOpenMedia = (media, index) => { - document.body.classList.add('with-modals--active'); - this.setState({ media, index }); - } - - handleOpenVideo = (video, time) => { - const media = ImmutableList([video]); - - document.body.classList.add('with-modals--active'); - this.setState({ media, time }); - } - - handleCloseMedia = () => { - document.body.classList.remove('with-modals--active'); - this.setState({ media: null, index: null, time: null }); - } - - render() { - const { locale, components } = this.props; - - return ( - - - {[].map.call(components, (component, i) => { - const componentName = component.getAttribute('data-component'); - const Component = MEDIA_COMPONENTS[componentName]; - const { media, card, poll, ...props } = JSON.parse(component.getAttribute('data-props')); - - Object.assign(props, { - ...(media ? { media: fromJS(media) } : {}), - ...(card ? { card: fromJS(card) } : {}), - ...(poll ? { poll: fromJS(poll) } : {}), - - ...(componentName === 'Video' ? { - onOpenVideo: this.handleOpenVideo, - } : { - onOpenMedia: this.handleOpenMedia, - }), - }); - - return ReactDOM.createPortal( - , - component, - ); - })} - - {this.state.media && ( - - )} - - - - ); - } - -} diff --git a/app/soapbox/containers/timeline_container.js b/app/soapbox/containers/timeline_container.js deleted file mode 100644 index 550d891d3..000000000 --- a/app/soapbox/containers/timeline_container.js +++ /dev/null @@ -1,58 +0,0 @@ -import React, { Fragment } from 'react'; -import ReactDOM from 'react-dom'; -import { Provider } from 'react-redux'; -import PropTypes from 'prop-types'; -import configureStore from '../store/configureStore'; -import { hydrateStore } from '../actions/store'; -import { IntlProvider, addLocaleData } from 'react-intl'; -import { getLocale } from '../locales'; -import PublicTimeline from '../features/standalone/public_timeline'; -import HashtagTimeline from '../features/standalone/hashtag_timeline'; -import ModalContainer from '../features/ui/containers/modal_container'; -import initialState from '../initial_state'; - -const { localeData, messages } = getLocale(); -addLocaleData(localeData); - -const store = configureStore(); - -if (initialState) { - store.dispatch(hydrateStore(initialState)); -} - -export default class TimelineContainer extends React.PureComponent { - - static propTypes = { - locale: PropTypes.string.isRequired, - hashtag: PropTypes.string, - local: PropTypes.bool, - }; - - render() { - const { locale, hashtag, local } = this.props; - - let timeline; - - if (hashtag) { - timeline = ; - } else { - timeline = ; - } - - return ( - - - - {timeline} - - {ReactDOM.createPortal( - , - document.getElementById('modal-container'), - )} - - - - ); - } - -} From 8b181c38f3ab8b3a1345d5329f5c50a0684bc2b1 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 4 Jun 2020 19:43:53 -0500 Subject: [PATCH 09/14] Fix i18n streaming.js --- app/soapbox/actions/streaming.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/soapbox/actions/streaming.js b/app/soapbox/actions/streaming.js index d02e18746..6cb7db45c 100644 --- a/app/soapbox/actions/streaming.js +++ b/app/soapbox/actions/streaming.js @@ -9,14 +9,13 @@ import { import { updateNotificationsQueue, expandNotifications } from './notifications'; import { updateConversations } from './conversations'; import { fetchFilters } from './filters'; -import { getLocale } from '../locales'; - -const { messages } = getLocale(); +import { getSettings } from 'soapbox/actions/settings'; +import messages from 'soapbox/locales/messages'; export function connectTimelineStream(timelineId, path, pollingRefresh = null, accept = null) { return connectStream (path, pollingRefresh, (dispatch, getState) => { - const locale = getState().getIn(['meta', 'locale']); + const locale = getSettings(getState()).get('locale'); return { onConnect() { @@ -36,7 +35,7 @@ export function connectTimelineStream(timelineId, path, pollingRefresh = null, a dispatch(deleteFromTimelines(data.payload)); break; case 'notification': - dispatch(updateNotificationsQueue(JSON.parse(data.payload), messages, locale, window.location.pathname)); + dispatch(updateNotificationsQueue(JSON.parse(data.payload), messages[locale], locale, window.location.pathname)); break; case 'conversation': dispatch(updateConversations(JSON.parse(data.payload))); From 39a651121b6f57fba860398ac7f9272ebdb76396 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 4 Jun 2020 20:01:00 -0500 Subject: [PATCH 10/14] Update language selector in Preferences with all languages --- app/soapbox/features/preferences/index.js | 64 ++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/app/soapbox/features/preferences/index.js b/app/soapbox/features/preferences/index.js index 5a244a27e..d9d3489da 100644 --- a/app/soapbox/features/preferences/index.js +++ b/app/soapbox/features/preferences/index.js @@ -15,6 +15,68 @@ import { } from 'soapbox/features/forms'; import SettingsCheckbox from './components/settings_checkbox'; +const languages = { + en: 'English', + ar: 'العربية', + ast: 'Asturianu', + bg: 'Български', + bn: 'বাংলা', + ca: 'Català', + co: 'Corsu', + cs: 'Čeština', + cy: 'Cymraeg', + da: 'Dansk', + de: 'Deutsch', + el: 'Ελληνικά', + eo: 'Esperanto', + es: 'Español', + eu: 'Euskara', + fa: 'فارسی', + fi: 'Suomi', + fr: 'Français', + ga: 'Gaeilge', + gl: 'Galego', + he: 'עברית', + hi: 'हिन्दी', + hr: 'Hrvatski', + hu: 'Magyar', + hy: 'Հայերեն', + id: 'Bahasa Indonesia', + io: 'Ido', + it: 'Italiano', + ja: '日本語', + ka: 'ქართული', + kk: 'Қазақша', + ko: '한국어', + lt: 'Lietuvių', + lv: 'Latviešu', + ml: 'മലയാളം', + ms: 'Bahasa Melayu', + nl: 'Nederlands', + no: 'Norsk', + oc: 'Occitan', + pl: 'Polski', + pt: 'Português', + 'pt-BR': 'Português do Brasil', + ro: 'Română', + ru: 'Русский', + sk: 'Slovenčina', + sl: 'Slovenščina', + sq: 'Shqip', + sr: 'Српски', + 'sr-Latn': 'Srpski (latinica)', + sv: 'Svenska', + ta: 'தமிழ்', + te: 'తెలుగు', + th: 'ไทย', + tr: 'Türkçe', + uk: 'Українська', + zh: '中文', + 'zh-CN': '简体中文', + 'zh-HK': '繁體中文(香港)', + 'zh-TW': '繁體中文(臺灣)', +}; + const messages = defineMessages({ heading: { id: 'column.preferences', defaultMessage: 'Preferences' }, }); @@ -62,7 +124,7 @@ class Preferences extends ImmutablePureComponent { From 2e9ce293dd5f2d9b25dbff39e084a7263473e332 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 4 Jun 2020 20:28:56 -0500 Subject: [PATCH 11/14] Remove whitelist files --- app/soapbox/locales/messages.js | 62 ---------------------- app/soapbox/locales/whitelist_ar.json | 2 - app/soapbox/locales/whitelist_ast.json | 2 - app/soapbox/locales/whitelist_bg.json | 2 - app/soapbox/locales/whitelist_bn.json | 2 - app/soapbox/locales/whitelist_br.json | 2 - app/soapbox/locales/whitelist_ca.json | 2 - app/soapbox/locales/whitelist_co.json | 2 - app/soapbox/locales/whitelist_cs.json | 2 - app/soapbox/locales/whitelist_cy.json | 2 - app/soapbox/locales/whitelist_da.json | 2 - app/soapbox/locales/whitelist_de.json | 2 - app/soapbox/locales/whitelist_el.json | 2 - app/soapbox/locales/whitelist_en.json | 2 - app/soapbox/locales/whitelist_eo.json | 2 - app/soapbox/locales/whitelist_es-AR.json | 2 - app/soapbox/locales/whitelist_es.json | 2 - app/soapbox/locales/whitelist_et.json | 2 - app/soapbox/locales/whitelist_eu.json | 2 - app/soapbox/locales/whitelist_fa.json | 2 - app/soapbox/locales/whitelist_fi.json | 2 - app/soapbox/locales/whitelist_fr.json | 2 - app/soapbox/locales/whitelist_ga.json | 2 - app/soapbox/locales/whitelist_gl.json | 2 - app/soapbox/locales/whitelist_he.json | 2 - app/soapbox/locales/whitelist_hi.json | 2 - app/soapbox/locales/whitelist_hr.json | 2 - app/soapbox/locales/whitelist_hu.json | 2 - app/soapbox/locales/whitelist_hy.json | 2 - app/soapbox/locales/whitelist_id.json | 2 - app/soapbox/locales/whitelist_io.json | 2 - app/soapbox/locales/whitelist_it.json | 2 - app/soapbox/locales/whitelist_ja.json | 2 - app/soapbox/locales/whitelist_ka.json | 2 - app/soapbox/locales/whitelist_kk.json | 2 - app/soapbox/locales/whitelist_ko.json | 2 - app/soapbox/locales/whitelist_lt.json | 2 - app/soapbox/locales/whitelist_lv.json | 2 - app/soapbox/locales/whitelist_mk.json | 2 - app/soapbox/locales/whitelist_ms.json | 2 - app/soapbox/locales/whitelist_nl.json | 2 - app/soapbox/locales/whitelist_nn.json | 2 - app/soapbox/locales/whitelist_no.json | 2 - app/soapbox/locales/whitelist_oc.json | 2 - app/soapbox/locales/whitelist_pl.json | 2 - app/soapbox/locales/whitelist_pt-BR.json | 2 - app/soapbox/locales/whitelist_pt.json | 2 - app/soapbox/locales/whitelist_ro.json | 2 - app/soapbox/locales/whitelist_ru.json | 2 - app/soapbox/locales/whitelist_sk.json | 2 - app/soapbox/locales/whitelist_sl.json | 2 - app/soapbox/locales/whitelist_sq.json | 2 - app/soapbox/locales/whitelist_sr-Latn.json | 2 - app/soapbox/locales/whitelist_sr.json | 2 - app/soapbox/locales/whitelist_sv.json | 2 - app/soapbox/locales/whitelist_ta.json | 2 - app/soapbox/locales/whitelist_te.json | 2 - app/soapbox/locales/whitelist_th.json | 2 - app/soapbox/locales/whitelist_tr.json | 2 - app/soapbox/locales/whitelist_uk.json | 2 - app/soapbox/locales/whitelist_zh-CN.json | 2 - app/soapbox/locales/whitelist_zh-HK.json | 2 - app/soapbox/locales/whitelist_zh-TW.json | 2 - 63 files changed, 186 deletions(-) delete mode 100644 app/soapbox/locales/whitelist_ar.json delete mode 100644 app/soapbox/locales/whitelist_ast.json delete mode 100644 app/soapbox/locales/whitelist_bg.json delete mode 100644 app/soapbox/locales/whitelist_bn.json delete mode 100644 app/soapbox/locales/whitelist_br.json delete mode 100644 app/soapbox/locales/whitelist_ca.json delete mode 100644 app/soapbox/locales/whitelist_co.json delete mode 100644 app/soapbox/locales/whitelist_cs.json delete mode 100644 app/soapbox/locales/whitelist_cy.json delete mode 100644 app/soapbox/locales/whitelist_da.json delete mode 100644 app/soapbox/locales/whitelist_de.json delete mode 100644 app/soapbox/locales/whitelist_el.json delete mode 100644 app/soapbox/locales/whitelist_en.json delete mode 100644 app/soapbox/locales/whitelist_eo.json delete mode 100644 app/soapbox/locales/whitelist_es-AR.json delete mode 100644 app/soapbox/locales/whitelist_es.json delete mode 100644 app/soapbox/locales/whitelist_et.json delete mode 100644 app/soapbox/locales/whitelist_eu.json delete mode 100644 app/soapbox/locales/whitelist_fa.json delete mode 100644 app/soapbox/locales/whitelist_fi.json delete mode 100644 app/soapbox/locales/whitelist_fr.json delete mode 100644 app/soapbox/locales/whitelist_ga.json delete mode 100644 app/soapbox/locales/whitelist_gl.json delete mode 100644 app/soapbox/locales/whitelist_he.json delete mode 100644 app/soapbox/locales/whitelist_hi.json delete mode 100644 app/soapbox/locales/whitelist_hr.json delete mode 100644 app/soapbox/locales/whitelist_hu.json delete mode 100644 app/soapbox/locales/whitelist_hy.json delete mode 100644 app/soapbox/locales/whitelist_id.json delete mode 100644 app/soapbox/locales/whitelist_io.json delete mode 100644 app/soapbox/locales/whitelist_it.json delete mode 100644 app/soapbox/locales/whitelist_ja.json delete mode 100644 app/soapbox/locales/whitelist_ka.json delete mode 100644 app/soapbox/locales/whitelist_kk.json delete mode 100644 app/soapbox/locales/whitelist_ko.json delete mode 100644 app/soapbox/locales/whitelist_lt.json delete mode 100644 app/soapbox/locales/whitelist_lv.json delete mode 100644 app/soapbox/locales/whitelist_mk.json delete mode 100644 app/soapbox/locales/whitelist_ms.json delete mode 100644 app/soapbox/locales/whitelist_nl.json delete mode 100644 app/soapbox/locales/whitelist_nn.json delete mode 100644 app/soapbox/locales/whitelist_no.json delete mode 100644 app/soapbox/locales/whitelist_oc.json delete mode 100644 app/soapbox/locales/whitelist_pl.json delete mode 100644 app/soapbox/locales/whitelist_pt-BR.json delete mode 100644 app/soapbox/locales/whitelist_pt.json delete mode 100644 app/soapbox/locales/whitelist_ro.json delete mode 100644 app/soapbox/locales/whitelist_ru.json delete mode 100644 app/soapbox/locales/whitelist_sk.json delete mode 100644 app/soapbox/locales/whitelist_sl.json delete mode 100644 app/soapbox/locales/whitelist_sq.json delete mode 100644 app/soapbox/locales/whitelist_sr-Latn.json delete mode 100644 app/soapbox/locales/whitelist_sr.json delete mode 100644 app/soapbox/locales/whitelist_sv.json delete mode 100644 app/soapbox/locales/whitelist_ta.json delete mode 100644 app/soapbox/locales/whitelist_te.json delete mode 100644 app/soapbox/locales/whitelist_th.json delete mode 100644 app/soapbox/locales/whitelist_tr.json delete mode 100644 app/soapbox/locales/whitelist_uk.json delete mode 100644 app/soapbox/locales/whitelist_zh-CN.json delete mode 100644 app/soapbox/locales/whitelist_zh-HK.json delete mode 100644 app/soapbox/locales/whitelist_zh-TW.json diff --git a/app/soapbox/locales/messages.js b/app/soapbox/locales/messages.js index e5419ac73..ab4050c8a 100644 --- a/app/soapbox/locales/messages.js +++ b/app/soapbox/locales/messages.js @@ -58,68 +58,6 @@ export default { 'th': require('./th.json'), 'tr': require('./tr.json'), 'uk': require('./uk.json'), - 'whitelist_ar': require('./whitelist_ar.json'), - 'whitelist_ast': require('./whitelist_ast.json'), - 'whitelist_bg': require('./whitelist_bg.json'), - 'whitelist_bn': require('./whitelist_bn.json'), - 'whitelist_br': require('./whitelist_br.json'), - 'whitelist_ca': require('./whitelist_ca.json'), - 'whitelist_co': require('./whitelist_co.json'), - 'whitelist_cs': require('./whitelist_cs.json'), - 'whitelist_cy': require('./whitelist_cy.json'), - 'whitelist_da': require('./whitelist_da.json'), - 'whitelist_de': require('./whitelist_de.json'), - 'whitelist_el': require('./whitelist_el.json'), - 'whitelist_en': require('./whitelist_en.json'), - 'whitelist_eo': require('./whitelist_eo.json'), - 'whitelist_es-AR': require('./whitelist_es-AR.json'), - 'whitelist_es': require('./whitelist_es.json'), - 'whitelist_et': require('./whitelist_et.json'), - 'whitelist_eu': require('./whitelist_eu.json'), - 'whitelist_fa': require('./whitelist_fa.json'), - 'whitelist_fi': require('./whitelist_fi.json'), - 'whitelist_fr': require('./whitelist_fr.json'), - 'whitelist_ga': require('./whitelist_ga.json'), - 'whitelist_gl': require('./whitelist_gl.json'), - 'whitelist_he': require('./whitelist_he.json'), - 'whitelist_hi': require('./whitelist_hi.json'), - 'whitelist_hr': require('./whitelist_hr.json'), - 'whitelist_hu': require('./whitelist_hu.json'), - 'whitelist_hy': require('./whitelist_hy.json'), - 'whitelist_id': require('./whitelist_id.json'), - 'whitelist_io': require('./whitelist_io.json'), - 'whitelist_it': require('./whitelist_it.json'), - 'whitelist_ja': require('./whitelist_ja.json'), - 'whitelist_ka': require('./whitelist_ka.json'), - 'whitelist_kk': require('./whitelist_kk.json'), - 'whitelist_ko': require('./whitelist_ko.json'), - 'whitelist_lt': require('./whitelist_lt.json'), - 'whitelist_lv': require('./whitelist_lv.json'), - 'whitelist_mk': require('./whitelist_mk.json'), - 'whitelist_ms': require('./whitelist_ms.json'), - 'whitelist_nl': require('./whitelist_nl.json'), - 'whitelist_nn': require('./whitelist_nn.json'), - 'whitelist_no': require('./whitelist_no.json'), - 'whitelist_oc': require('./whitelist_oc.json'), - 'whitelist_pl': require('./whitelist_pl.json'), - 'whitelist_pt-BR': require('./whitelist_pt-BR.json'), - 'whitelist_pt': require('./whitelist_pt.json'), - 'whitelist_ro': require('./whitelist_ro.json'), - 'whitelist_ru': require('./whitelist_ru.json'), - 'whitelist_sk': require('./whitelist_sk.json'), - 'whitelist_sl': require('./whitelist_sl.json'), - 'whitelist_sq': require('./whitelist_sq.json'), - 'whitelist_sr': require('./whitelist_sr.json'), - 'whitelist_sr-Latn': require('./whitelist_sr-Latn.json'), - 'whitelist_sv': require('./whitelist_sv.json'), - 'whitelist_ta': require('./whitelist_ta.json'), - 'whitelist_te': require('./whitelist_te.json'), - 'whitelist_th': require('./whitelist_th.json'), - 'whitelist_tr': require('./whitelist_tr.json'), - 'whitelist_uk': require('./whitelist_uk.json'), - 'whitelist_zh-CN': require('./whitelist_zh-CN.json'), - 'whitelist_zh-HK': require('./whitelist_zh-HK.json'), - 'whitelist_zh-TW': require('./whitelist_zh-TW.json'), 'zh-CN': require('./zh-CN.json'), 'zh-HK': require('./zh-HK.json'), 'zh-TW': require('./zh-TW.json'), diff --git a/app/soapbox/locales/whitelist_ar.json b/app/soapbox/locales/whitelist_ar.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_ar.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_ast.json b/app/soapbox/locales/whitelist_ast.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_ast.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_bg.json b/app/soapbox/locales/whitelist_bg.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_bg.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_bn.json b/app/soapbox/locales/whitelist_bn.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_bn.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_br.json b/app/soapbox/locales/whitelist_br.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_br.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_ca.json b/app/soapbox/locales/whitelist_ca.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_ca.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_co.json b/app/soapbox/locales/whitelist_co.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_co.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_cs.json b/app/soapbox/locales/whitelist_cs.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_cs.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_cy.json b/app/soapbox/locales/whitelist_cy.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_cy.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_da.json b/app/soapbox/locales/whitelist_da.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_da.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_de.json b/app/soapbox/locales/whitelist_de.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_de.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_el.json b/app/soapbox/locales/whitelist_el.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_el.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_en.json b/app/soapbox/locales/whitelist_en.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_en.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_eo.json b/app/soapbox/locales/whitelist_eo.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_eo.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_es-AR.json b/app/soapbox/locales/whitelist_es-AR.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_es-AR.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_es.json b/app/soapbox/locales/whitelist_es.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_es.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_et.json b/app/soapbox/locales/whitelist_et.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_et.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_eu.json b/app/soapbox/locales/whitelist_eu.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_eu.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_fa.json b/app/soapbox/locales/whitelist_fa.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_fa.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_fi.json b/app/soapbox/locales/whitelist_fi.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_fi.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_fr.json b/app/soapbox/locales/whitelist_fr.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_fr.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_ga.json b/app/soapbox/locales/whitelist_ga.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_ga.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_gl.json b/app/soapbox/locales/whitelist_gl.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_gl.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_he.json b/app/soapbox/locales/whitelist_he.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_he.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_hi.json b/app/soapbox/locales/whitelist_hi.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_hi.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_hr.json b/app/soapbox/locales/whitelist_hr.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_hr.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_hu.json b/app/soapbox/locales/whitelist_hu.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_hu.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_hy.json b/app/soapbox/locales/whitelist_hy.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_hy.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_id.json b/app/soapbox/locales/whitelist_id.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_id.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_io.json b/app/soapbox/locales/whitelist_io.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_io.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_it.json b/app/soapbox/locales/whitelist_it.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_it.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_ja.json b/app/soapbox/locales/whitelist_ja.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_ja.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_ka.json b/app/soapbox/locales/whitelist_ka.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_ka.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_kk.json b/app/soapbox/locales/whitelist_kk.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_kk.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_ko.json b/app/soapbox/locales/whitelist_ko.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_ko.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_lt.json b/app/soapbox/locales/whitelist_lt.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_lt.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_lv.json b/app/soapbox/locales/whitelist_lv.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_lv.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_mk.json b/app/soapbox/locales/whitelist_mk.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_mk.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_ms.json b/app/soapbox/locales/whitelist_ms.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_ms.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_nl.json b/app/soapbox/locales/whitelist_nl.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_nl.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_nn.json b/app/soapbox/locales/whitelist_nn.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_nn.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_no.json b/app/soapbox/locales/whitelist_no.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_no.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_oc.json b/app/soapbox/locales/whitelist_oc.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_oc.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_pl.json b/app/soapbox/locales/whitelist_pl.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_pl.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_pt-BR.json b/app/soapbox/locales/whitelist_pt-BR.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_pt-BR.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_pt.json b/app/soapbox/locales/whitelist_pt.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_pt.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_ro.json b/app/soapbox/locales/whitelist_ro.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_ro.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_ru.json b/app/soapbox/locales/whitelist_ru.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_ru.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_sk.json b/app/soapbox/locales/whitelist_sk.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_sk.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_sl.json b/app/soapbox/locales/whitelist_sl.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_sl.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_sq.json b/app/soapbox/locales/whitelist_sq.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_sq.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_sr-Latn.json b/app/soapbox/locales/whitelist_sr-Latn.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_sr-Latn.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_sr.json b/app/soapbox/locales/whitelist_sr.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_sr.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_sv.json b/app/soapbox/locales/whitelist_sv.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_sv.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_ta.json b/app/soapbox/locales/whitelist_ta.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_ta.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_te.json b/app/soapbox/locales/whitelist_te.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_te.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_th.json b/app/soapbox/locales/whitelist_th.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_th.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_tr.json b/app/soapbox/locales/whitelist_tr.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_tr.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_uk.json b/app/soapbox/locales/whitelist_uk.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_uk.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_zh-CN.json b/app/soapbox/locales/whitelist_zh-CN.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_zh-CN.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_zh-HK.json b/app/soapbox/locales/whitelist_zh-HK.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_zh-HK.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] diff --git a/app/soapbox/locales/whitelist_zh-TW.json b/app/soapbox/locales/whitelist_zh-TW.json deleted file mode 100644 index 0d4f101c7..000000000 --- a/app/soapbox/locales/whitelist_zh-TW.json +++ /dev/null @@ -1,2 +0,0 @@ -[ -] From 0d76b761ac52a7ac074a79a9e6c56efdb52faa14 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 4 Jun 2020 21:13:38 -0500 Subject: [PATCH 12/14] class --> className --- app/soapbox/features/public_layout/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/features/public_layout/index.js b/app/soapbox/features/public_layout/index.js index afc04b51f..e475d0ac6 100644 --- a/app/soapbox/features/public_layout/index.js +++ b/app/soapbox/features/public_layout/index.js @@ -14,7 +14,7 @@ const mapStateToProps = (state, props) => ({ }); const wave = ( - + ); From 956fa99ee1c9cd2ca9df6867073071bc5ae9a6f3 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 4 Jun 2020 21:22:58 -0500 Subject: [PATCH 13/14] Import locale messages dynamically --- app/soapbox/containers/soapbox.js | 28 ++++- app/soapbox/features/preferences/index.js | 2 +- app/soapbox/locales/messages.js | 124 +++++++++++----------- 3 files changed, 90 insertions(+), 64 deletions(-) diff --git a/app/soapbox/containers/soapbox.js b/app/soapbox/containers/soapbox.js index 708cf6688..b0577a535 100644 --- a/app/soapbox/containers/soapbox.js +++ b/app/soapbox/containers/soapbox.js @@ -69,9 +69,35 @@ class SoapboxMount extends React.PureComponent { dispatch: PropTypes.func, }; + state = { + messages: {}, + localeLoading: true, + } + + setMessages = () => { + messages[this.props.locale]().then(messages => { + this.setState({ messages, localeLoading: false }); + }).catch(() => {}); + } + + maybeUpdateMessages = prevProps => { + if (this.props.locale !== prevProps.locale) { + this.setMessages(); + }; + } + + componentDidMount() { + this.setMessages(); + } + + componentDidUpdate(prevProps) { + this.maybeUpdateMessages(prevProps); + } + render() { const { me, themeCss, locale } = this.props; if (me === null) return null; + if (this.state.localeLoading) return null; // Disabling introduction for launch // const { showIntroduction } = this.props; @@ -88,7 +114,7 @@ class SoapboxMount extends React.PureComponent { }); return ( - + <> diff --git a/app/soapbox/features/preferences/index.js b/app/soapbox/features/preferences/index.js index d9d3489da..3530c3530 100644 --- a/app/soapbox/features/preferences/index.js +++ b/app/soapbox/features/preferences/index.js @@ -125,7 +125,7 @@ class Preferences extends ImmutablePureComponent { diff --git a/app/soapbox/locales/messages.js b/app/soapbox/locales/messages.js index ab4050c8a..4118776cd 100644 --- a/app/soapbox/locales/messages.js +++ b/app/soapbox/locales/messages.js @@ -1,64 +1,64 @@ export default { - 'ar': require('./ar.json'), - 'ast': require('./ast.json'), - 'bg': require('./bg.json'), - 'bn': require('./bn.json'), - 'br': require('./br.json'), - 'ca': require('./ca.json'), - 'co': require('./co.json'), - 'cs': require('./cs.json'), - 'cy': require('./cy.json'), - 'da': require('./da.json'), - 'de': require('./de.json'), - 'el': require('./el.json'), - 'en': require('./en.json'), - 'eo': require('./eo.json'), - 'es-AR': require('./es-AR.json'), - 'es': require('./es.json'), - 'et': require('./et.json'), - 'eu': require('./eu.json'), - 'fa': require('./fa.json'), - 'fi': require('./fi.json'), - 'fr': require('./fr.json'), - 'ga': require('./ga.json'), - 'gl': require('./gl.json'), - 'he': require('./he.json'), - 'hi': require('./hi.json'), - 'hr': require('./hr.json'), - 'hu': require('./hu.json'), - 'hy': require('./hy.json'), - 'id': require('./id.json'), - 'io': require('./io.json'), - 'it': require('./it.json'), - 'ja': require('./ja.json'), - 'ka': require('./ka.json'), - 'kk': require('./kk.json'), - 'ko': require('./ko.json'), - 'lt': require('./lt.json'), - 'lv': require('./lv.json'), - 'mk': require('./mk.json'), - 'ms': require('./ms.json'), - 'nl': require('./nl.json'), - 'nn': require('./nn.json'), - 'no': require('./no.json'), - 'oc': require('./oc.json'), - 'pl': require('./pl.json'), - 'pt-BR': require('./pt-BR.json'), - 'pt': require('./pt.json'), - 'ro': require('./ro.json'), - 'ru': require('./ru.json'), - 'sk': require('./sk.json'), - 'sl': require('./sl.json'), - 'sq': require('./sq.json'), - 'sr': require('./sr.json'), - 'sr-Latn': require('./sr-Latn.json'), - 'sv': require('./sv.json'), - 'ta': require('./ta.json'), - 'te': require('./te.json'), - 'th': require('./th.json'), - 'tr': require('./tr.json'), - 'uk': require('./uk.json'), - 'zh-CN': require('./zh-CN.json'), - 'zh-HK': require('./zh-HK.json'), - 'zh-TW': require('./zh-TW.json'), + 'ar': () => import(/* webpackChunkName: "locale_ar" */'./ar.json'), + 'ast': () => import(/* webpackChunkName: "locale_ast" */'./ast.json'), + 'bg': () => import(/* webpackChunkName: "locale_bg" */'./bg.json'), + 'bn': () => import(/* webpackChunkName: "locale_bn" */'./bn.json'), + 'br': () => import(/* webpackChunkName: "locale_br" */'./br.json'), + 'ca': () => import(/* webpackChunkName: "locale_ca" */'./ca.json'), + 'co': () => import(/* webpackChunkName: "locale_co" */'./co.json'), + 'cs': () => import(/* webpackChunkName: "locale_cs" */'./cs.json'), + 'cy': () => import(/* webpackChunkName: "locale_cy" */'./cy.json'), + 'da': () => import(/* webpackChunkName: "locale_da" */'./da.json'), + 'de': () => import(/* webpackChunkName: "locale_de" */'./de.json'), + 'el': () => import(/* webpackChunkName: "locale_el" */'./el.json'), + 'en': () => import(/* webpackChunkName: "locale_en" */'./en.json'), + 'eo': () => import(/* webpackChunkName: "locale_eo" */'./eo.json'), + 'es-AR': () => import(/* webpackChunkName: "locale_es-AR" */'./es-AR.json'), + 'es': () => import(/* webpackChunkName: "locale_es" */'./es.json'), + 'et': () => import(/* webpackChunkName: "locale_et" */'./et.json'), + 'eu': () => import(/* webpackChunkName: "locale_eu" */'./eu.json'), + 'fa': () => import(/* webpackChunkName: "locale_fa" */'./fa.json'), + 'fi': () => import(/* webpackChunkName: "locale_fi" */'./fi.json'), + 'fr': () => import(/* webpackChunkName: "locale_fr" */'./fr.json'), + 'ga': () => import(/* webpackChunkName: "locale_ga" */'./ga.json'), + 'gl': () => import(/* webpackChunkName: "locale_gl" */'./gl.json'), + 'he': () => import(/* webpackChunkName: "locale_he" */'./he.json'), + 'hi': () => import(/* webpackChunkName: "locale_hi" */'./hi.json'), + 'hr': () => import(/* webpackChunkName: "locale_hr" */'./hr.json'), + 'hu': () => import(/* webpackChunkName: "locale_hu" */'./hu.json'), + 'hy': () => import(/* webpackChunkName: "locale_hy" */'./hy.json'), + 'id': () => import(/* webpackChunkName: "locale_id" */'./id.json'), + 'io': () => import(/* webpackChunkName: "locale_io" */'./io.json'), + 'it': () => import(/* webpackChunkName: "locale_it" */'./it.json'), + 'ja': () => import(/* webpackChunkName: "locale_ja" */'./ja.json'), + 'ka': () => import(/* webpackChunkName: "locale_ka" */'./ka.json'), + 'kk': () => import(/* webpackChunkName: "locale_kk" */'./kk.json'), + 'ko': () => import(/* webpackChunkName: "locale_ko" */'./ko.json'), + 'lt': () => import(/* webpackChunkName: "locale_lt" */'./lt.json'), + 'lv': () => import(/* webpackChunkName: "locale_lv" */'./lv.json'), + 'mk': () => import(/* webpackChunkName: "locale_mk" */'./mk.json'), + 'ms': () => import(/* webpackChunkName: "locale_ms" */'./ms.json'), + 'nl': () => import(/* webpackChunkName: "locale_nl" */'./nl.json'), + 'nn': () => import(/* webpackChunkName: "locale_nn" */'./nn.json'), + 'no': () => import(/* webpackChunkName: "locale_no" */'./no.json'), + 'oc': () => import(/* webpackChunkName: "locale_oc" */'./oc.json'), + 'pl': () => import(/* webpackChunkName: "locale_pl" */'./pl.json'), + 'pt-BR': () => import(/* webpackChunkName: "locale_pt-BR" */'./pt-BR.json'), + 'pt': () => import(/* webpackChunkName: "locale_pt" */'./pt.json'), + 'ro': () => import(/* webpackChunkName: "locale_ro" */'./ro.json'), + 'ru': () => import(/* webpackChunkName: "locale_ru" */'./ru.json'), + 'sk': () => import(/* webpackChunkName: "locale_sk" */'./sk.json'), + 'sl': () => import(/* webpackChunkName: "locale_sl" */'./sl.json'), + 'sq': () => import(/* webpackChunkName: "locale_sq" */'./sq.json'), + 'sr': () => import(/* webpackChunkName: "locale_sr" */'./sr.json'), + 'sr-Latn': () => import(/* webpackChunkName: "locale_sr-Latn" */'./sr-Latn.json'), + 'sv': () => import(/* webpackChunkName: "locale_sv" */'./sv.json'), + 'ta': () => import(/* webpackChunkName: "locale_ta" */'./ta.json'), + 'te': () => import(/* webpackChunkName: "locale_te" */'./te.json'), + 'th': () => import(/* webpackChunkName: "locale_th" */'./th.json'), + 'tr': () => import(/* webpackChunkName: "locale_tr" */'./tr.json'), + 'uk': () => import(/* webpackChunkName: "locale_uk" */'./uk.json'), + 'zh-CN': () => import(/* webpackChunkName: "locale_zh-CN" */'./zh-CN.json'), + 'zh-HK': () => import(/* webpackChunkName: "locale_zh-HK" */'./zh-HK.json'), + 'zh-TW': () => import(/* webpackChunkName: "locale_zh-TW" */'./zh-TW.json'), }; From 9e2045269245b50676094cbda02fa5f5df4f2ff1 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 4 Jun 2020 21:28:19 -0500 Subject: [PATCH 14/14] Streaming: load messages async --- app/soapbox/actions/streaming.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/soapbox/actions/streaming.js b/app/soapbox/actions/streaming.js index 6cb7db45c..ef515798a 100644 --- a/app/soapbox/actions/streaming.js +++ b/app/soapbox/actions/streaming.js @@ -35,7 +35,9 @@ export function connectTimelineStream(timelineId, path, pollingRefresh = null, a dispatch(deleteFromTimelines(data.payload)); break; case 'notification': - dispatch(updateNotificationsQueue(JSON.parse(data.payload), messages[locale], locale, window.location.pathname)); + messages[locale]().then(messages => { + dispatch(updateNotificationsQueue(JSON.parse(data.payload), messages, locale, window.location.pathname)); + }).catch(() => {}); break; case 'conversation': dispatch(updateConversations(JSON.parse(data.payload)));