mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 08:07:26 +02:00
refactor(v2): i18n cleanups / refactors (#4405)
* chore: fix various intl stuff - remove intl-locales-supported & intl since they're deprecated and only needed for IE11 - add new polyfills for node 12 - clean up babel intl extractor - reset jest test timezone to UTC so it passes even for East Coast contributor * chore: change build to include Node 14 * docs: update i18n reqs
This commit is contained in:
parent
c3968e2d8f
commit
1078341b22
15 changed files with 162 additions and 124 deletions
|
@ -21,7 +21,6 @@ import {
|
|||
|
||||
// @ts-expect-error: no typedefs :s
|
||||
import resolvePathnameUnsafe from 'resolve-pathname';
|
||||
import areIntlLocalesSupported from 'intl-locales-supported';
|
||||
|
||||
const fileHash = new Map();
|
||||
export async function generate(
|
||||
|
@ -634,13 +633,6 @@ export async function readDefaultCodeTranslationMessages({
|
|||
return {};
|
||||
}
|
||||
|
||||
export function getDateTimeFormat(locale: string) {
|
||||
return areIntlLocalesSupported([locale])
|
||||
? global.Intl.DateTimeFormat
|
||||
: // eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
require('intl').DateTimeFormat;
|
||||
}
|
||||
|
||||
// Input: ## Some heading {#some-heading}
|
||||
// Output: {text: "## Some heading", id: "some-heading"}
|
||||
export function parseMarkdownHeadingId(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue