From b2457e53740a9feec0b995b8a5ebf62ac8666ff4 Mon Sep 17 00:00:00 2001 From: Dustin Brett Date: Sat, 10 Apr 2021 22:31:47 -0700 Subject: [PATCH] Get rid of i18n and add next export --- README.md | 1 + components/system/Taskbar/Clock/useLocaleDateTime.ts | 12 +++++++----- next.config.js | 5 ----- package.json | 1 + utils/constants.ts | 2 ++ 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 175da64c..ba13e22d 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ - Buffer urls aren't cleaned up - Background blur doesn't work in Firefox - NPM Issues (Use nvm/.nvmrc/yarn) +- HTML lang tag is unset - App doesn't load in IE11 ## File Manager diff --git a/components/system/Taskbar/Clock/useLocaleDateTime.ts b/components/system/Taskbar/Clock/useLocaleDateTime.ts index cba47032..678f4918 100644 --- a/components/system/Taskbar/Clock/useLocaleDateTime.ts +++ b/components/system/Taskbar/Clock/useLocaleDateTime.ts @@ -1,6 +1,5 @@ -import config from 'next.config'; -import { useRouter } from 'next/router'; import { useTheme } from 'styled-components'; +import { DEFAULT_LOCALE } from 'utils/constants'; type LocaleTimeDate = { date: string; @@ -9,10 +8,13 @@ type LocaleTimeDate = { }; const useLocaleDateTime = (now: Date): LocaleTimeDate => { - const { locale = config.i18n.defaultLocale } = useRouter() || {}; const { formats } = useTheme(); - const date = new Intl.DateTimeFormat(locale, formats.date).format(now); - const time = new Intl.DateTimeFormat(locale, formats.time).format(now); + const date = new Intl.DateTimeFormat(DEFAULT_LOCALE, formats.date).format( + now + ); + const time = new Intl.DateTimeFormat(DEFAULT_LOCALE, formats.time).format( + now + ); const dateTime = now.toISOString(); return { date, time, dateTime }; diff --git a/next.config.js b/next.config.js index 9346b323..e9537bc3 100644 --- a/next.config.js +++ b/next.config.js @@ -2,10 +2,5 @@ module.exports = { future: { webpack5: true }, - i18n: { - localeDetection: false, - locales: ['en'], - defaultLocale: 'en' - }, reactStrictMode: true }; diff --git a/package.json b/package.json index f9dff782..59024c69 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dev": "next dev", "build": "npm run build:fs && next build", "build:fs": "cd public && node ../node_modules/browserfs/dist/scripts/make_http_index.js > .index/fs.bfs.json && node ../components/apps/V86/fs2json.js --exclude .index --out .index/fs.9p.json .", + "export": "next export", "start": "next start", "eslint": "eslint .", "stylelint": "stylelint **/*.ts", diff --git a/utils/constants.ts b/utils/constants.ts index 676db4e6..99328169 100644 --- a/utils/constants.ts +++ b/utils/constants.ts @@ -1,6 +1,8 @@ import type { Size } from 'components/system/Window/RndWindow/useResizable'; import type { Position } from 'react-rnd'; +export const DEFAULT_LOCALE = 'en'; + export const DEFAULT_WINDOW_POSITION: Position = { x: 0, y: 0