Get rid of i18n and add next export

This commit is contained in:
Dustin Brett
2021-04-10 22:31:47 -07:00
parent 8a6ecf7c87
commit b2457e5374
5 changed files with 11 additions and 10 deletions

View File

@@ -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

View File

@@ -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 };

View File

@@ -2,10 +2,5 @@ module.exports = {
future: {
webpack5: true
},
i18n: {
localeDetection: false,
locales: ['en'],
defaultLocale: 'en'
},
reactStrictMode: true
};

View File

@@ -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",

View File

@@ -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