From cf42aab4b7350cf057c3042cc1feb5ae620736ff Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Tue, 27 Dec 2022 18:09:23 +0800 Subject: [PATCH] Experimental language selector in Compose field --- scripts/fetch-supported-languages.js | 20 + src/components/compose.css | 9 + src/components/compose.jsx | 50 +- src/components/icon.jsx | 1 + src/components/status.jsx | 4 +- src/data/status-supported-languages.json | 967 +++++++++++++++++++++++ 6 files changed, 1048 insertions(+), 3 deletions(-) create mode 100644 scripts/fetch-supported-languages.js create mode 100644 src/data/status-supported-languages.json diff --git a/scripts/fetch-supported-languages.js b/scripts/fetch-supported-languages.js new file mode 100644 index 00000000..1af2e664 --- /dev/null +++ b/scripts/fetch-supported-languages.js @@ -0,0 +1,20 @@ +import fs from 'fs'; + +const url = 'https://mastodon.social/'; + +const html = await fetch(url).then((res) => res.text()); + +// Extract the JSON between +const json = html.match( + /