diff --git a/docs/pages/_app.js b/docs/pages/_app.js index e8c07a174183e1..05916ec32e58a6 100644 --- a/docs/pages/_app.js +++ b/docs/pages/_app.js @@ -28,6 +28,7 @@ import findActivePage from 'docs/src/modules/utils/findActivePage'; import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; import getProductInfoFromUrl from 'docs/src/modules/utils/getProductInfoFromUrl'; import { DocsProvider } from '@mui/docs/DocsProvider'; +import { mapTranslations } from '@mui/docs/i18n'; import './global.css'; import '../public/static/components-gallery/base-theme.css'; import config from '../config'; @@ -295,7 +296,11 @@ function AppWrapper(props) { - + @@ -340,6 +345,9 @@ MyApp.propTypes = { MyApp.getInitialProps = async ({ ctx, Component }) => { let pageProps = {}; + const req = require.context('docs/translations', false, /translations.*\.json$/); + const translations = mapTranslations(req); + if (Component.getInitialProps) { pageProps = await Component.getInitialProps(ctx); } @@ -347,6 +355,7 @@ MyApp.getInitialProps = async ({ ctx, Component }) => { return { pageProps: { userLanguage: ctx.query.userLanguage || 'en', + translations, ...pageProps, }, }; diff --git a/docs/scripts/i18n.js b/docs/scripts/i18n.ts similarity index 94% rename from docs/scripts/i18n.js rename to docs/scripts/i18n.ts index 3daf3ead3ce4e5..3385f15933f760 100644 --- a/docs/scripts/i18n.js +++ b/docs/scripts/i18n.ts @@ -6,6 +6,7 @@ import materialPages from 'docs/data/material/pages'; import systemPages from 'docs/data/system/pages'; import basePages from 'docs/data/base/pages'; import joyPages from 'docs/data/joy/pages'; +import { MuiPage } from 'docs/src/MuiPage'; const EXCLUDES = ['/api', '/blog', '/x/react-']; @@ -21,7 +22,7 @@ async function run() { /** * @param {readonly import('docs/src/MuiPage').MuiPage[]} pages */ - const traverse = (pages) => { + const traverse = (pages: MuiPage[]) => { pages.forEach((page) => { if ( (page.pathname !== '/' && page.pathname === '/api-docs') || diff --git a/docs/scripts/tsconfig.json b/docs/scripts/tsconfig.json index c30167c66d748e..ed2c65826f5fbb 100644 --- a/docs/scripts/tsconfig.json +++ b/docs/scripts/tsconfig.json @@ -1,6 +1,6 @@ { "extends": "../../tsconfig.json", - "include": ["*.ts", "i18n.js"], + "include": ["*.ts"], "compilerOptions": { "allowJs": true, "isolatedModules": true, diff --git a/docs/translations/translations.json b/docs/translations/translations.json index 385f18a846d055..a79583b7a2a6ba 100644 --- a/docs/translations/translations.json +++ b/docs/translations/translations.json @@ -1,216 +1,4 @@ { - "adblock": "If you don't mind tech-related ads (no tracking or remarketing), and want to keep us running, please whitelist us in your blocker.", - "api-docs": { - "componentName": "Component name", - "componentsApi": "Components API", - "themeDefaultProps": "Theme default props", - "themeDefaultPropsDescription": "You can use {{muiName}} to change the default props of this component with the theme.", - "classes": "CSS classes", - "classesDescription": "These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.", - "className": "Class name", - "cssDescription": "The following class names are useful for styling with CSS (the state classes are marked).
To learn more, visit the component customization page.", - "css": "CSS", - "cssComponent": "As a CSS utility, the {{name}} component also supports all system properties. You can use them as props directly on the component.", - "default": "Default", - "defaultComponent": "Default component", - "defaultValue": "Default value", - "defaultHTMLTag": "Default HTML tag", - "demos": "Component demos", - "deprecated": "Deprecated", - "description": "Description", - "globalClass": "Global class", - "defaultClass": "Default class", - "hookName": "Hook name", - "hooksApi": "Hooks API", - "hooksNoParameters": "This hook does not accept any input parameters.", - "hooksPageDescription": "API reference docs for the {{name}} hook. Learn about the input parameters and other APIs of this exported module.", - "import": "Import", - "importDifference": "Learn about the difference by reading this guide on minimizing bundle size.", - "inheritance": "Inheritance", - "inheritanceDescription": "While not explicitly documented above, the props of the {{component}} component{{suffix}} are also available in {{name}}. You can take advantage of this to target nested components.", - "inheritanceSuffixTransition": " from react-transition-group", - "name": "Name", - "nativeElement": "native", - "overrideStyles": "You can override the style of the component using one of these customization options:\n", - "overrideStylesStyledComponent": "", - "pageDescription": "API reference docs for the React {{name}} component. Learn about the props, CSS, and other APIs of this exported module.", - "props": "Props", - "properties": "Properties", - "parameters": "Parameters", - "requires-ref": "This needs to be able to hold a ref.", - "returns": "Returns: ", - "returnValue": "Return value", - "refNotHeld": "The component cannot hold a ref.", - "refRootElement": "The ref is forwarded to the root element.", - "ruleName": "Rule name", - "signature": "Signature", - "slots": "Slots", - "spreadHint": "Props of the {{spreadHintElement}} component are also available.", - "state": "STATE", - "styleOverrides": "The name {{componentStyles.name}} can be used when providing default props or style overrides in the theme.", - "slotDescription": "To learn how to customize the slot, check out the Overriding component structure guide.", - "slotName": "Slot name", - "type": "Type", - "required": "Required", - "optional": "Optional", - "additional-info": { - "cssApi": "See CSS classes API below for more details.", - "sx": "See the `sx` page for more details.", - "slotsApi": "See Slots API below for more details.", - "joy-size": "To learn how to add custom sizes to the component, check out Themed components—Extend sizes.", - "joy-color": "To learn how to add your own colors, check out Themed components—Extend colors.", - "joy-variant": "To learn how to add your own variants, check out Themed components—Extend variants." - } - }, - "landingPageDescr": "A responsive landing page layout with many common sections.", - "landingPageTitle": "Landing page", - "searchButton": "Search…", - "algoliaSearch": "What are you looking for?", - "appFrame": { - "changeLanguage": "Change language", - "github": "GitHub repository", - "helpToTranslate": "Help to translate", - "openDrawer": "Open main navigation", - "skipToContent": "Skip to content", - "toggleSettings": "Toggle settings drawer" - }, - "backToTop": "Scroll back to top", - "blogDescr": "A sophisticated blog page layout. Markdown support is courtesy of markdown-to-jsx.", - "blogTitle": "Blog", - "bundleSize": "Bundle size", - "bundleSizeTooltip": "Scroll down to 'Exports Analysis' for a more detailed report.", - "cancel": "Cancel", - "cdn": "or use a CDN.", - "checkoutDescr": "A step-by-step checkout page layout. Adapt the number of steps to suit your needs, or make steps optional.", - "checkoutTitle": "Checkout", - "clickToCopy": "Click to copy", - "close": "Close", - "codesandbox": "Edit in CodeSandbox", - "copied": "Copied", - "copiedSource": "The source code has been copied to your clipboard.", - "copiedSourceLink": "Link to the source code has been copied to your clipboard.", - "copySource": "Copy the source", - "copySourceLinkJS": "Copy link to JavaScript source", - "copySourceLinkTS": "Copy link to TypeScript source", - "dashboardDescr": "Contains a taskbar and a mini variant drawer. The chart is courtesy of Recharts.", - "dashboardTitle": "Dashboard", - "decreaseSpacing": "decrease spacing", - "demoToolbarLabel": "demo source", - "demoStylingSelectSystem": "MUI System", - "demoStylingSelectTailwind": "Tailwind CSS", - "demoStylingSelectCSS": "Plain CSS", - "diamondSponsors": "Diamond sponsors", - "becomeADiamondSponsor": "Become a Diamond sponsor", - "diamondSponsorVacancies": "One spot left!", - "editorHint": "Press Enter to start editing", - "editPage": "Edit this page", - "emojiLove": "Love", - "emojiWarning": "Warning", - "expandAll": "Expand all", - "feedbackCommentLabel": "Comment", - "feedbackFailed": "Couldn't submit feedback. Please try again later.", - "feedbackMessage": "Was this page helpful?", - "feedbackMessageDown": "How can we improve this page? (optional)", - "feedbackMessageUp": "What did you like about this page? (optional)", - "feedbackSectionSpecific": "How can we improve the {{sectionName}} section? (optional)", - "feedbackMessageToGitHub": { - "usecases": "If something is broken or if you need a reply to a problem you've encountered, please", - "reasonWhy": "Otherwise, the team won't be able to answer back or ask for more information.", - "callToAction": { - "link": "open an issue instead." - } - }, - "feedbackNo": "No", - "feedbackSubmitted": "Feedback submitted", - "feedbackYes": "Yes", - "footerCompany": "Company", - "goToHome": "go to homepage", - "getProfessionalSupport": "Get Professional Support", - "getStarted": "Get Started", - "githubLabel": "Feedback", - "headTitle": "MUI: A popular React UI framework", - "hideFullSource": "Collapse code", - "hideSource": "Hide code", - "homeQuickWord": "A quick word from our sponsors:", - "increaseSpacing": "increase spacing", - "initialFocusLabel": "A generic container that is programmatically focused to test keyboard navigation of our components.", - "installation": "Installation", - "installButton": "Read installation docs", - "installDescr": "Install MUI's source files via npm. We take care of injecting the CSS needed.", - "joinThese": "Join these and other great organizations!", - "JS": "JavaScript", - "letUsKnow": "Let us know!", - "likeMui": "Help us keep running", - "loadFont": "Load the default Roboto font.", - "mainNavigation": "documentation", - "newest": "Newest", - "openDrawer": "Open documentation navigation", - "or": "or", - "pageTOC": "Page table of contents", - "praise": "Praise for MUI", - "praiseDescr": "Here's what some of our users are saying.", - "pricingDescr": "Quickly build an effective pricing table for your potential customers.", - "pricingTitle": "Pricing", - "resetDemo": "Reset demo", - "resetDensity": "Reset density", - "resetFocus": "Reset focus to test keyboard navigation", - "searchIcons": { - "learnMore": "Learn more about the import" - }, - "seeMore": "See more", - "settings": { - "color": "Color", - "dark": "Dark", - "direction": "Direction", - "editWebsiteColors": "Edit website colors", - "light": "Light", - "ltr": "Left to right", - "mode": "Mode", - "rtl": "Right to left", - "settings": "Settings", - "system": "System", - "language": "Language" - }, - "showFullSource": "Expand code", - "showJSSource": "Show JavaScript source", - "showSource": "Show code", - "showTSSource": "Show TypeScript source", - "signInDescr": "A simple sign-in page using text fields, buttons, checkboxes, links, and more.", - "signInSideDescr": "A simple sign-in page with a two-column layout using text fields, buttons, and more.", - "signInSideTitle": "Sign-in side", - "signInTitle": "Sign-in", - "signUpDescr": "A simple sign-up page using text fields, buttons, checkboxes, links, and more.", - "signUpTitle": "Sign-up", - "sourceCode": "Source code", - "spacingUnit": "Spacing unit", - "stackblitz": "Edit in StackBlitz", - "stars": "GitHub stars", - "stickyFooterDescr": "Attach a footer to the bottom of the viewport when page content is short.", - "stickyFooterTitle": "Sticky footer", - "strapline": "MUI provides a simple, customizable, and accessible library of React components. Follow your own design system, or start with Material Design.", - "submit": "Submit", - "tableOfContents": "Contents", - "thanks": "Thank you!", - "themes": "Premium themes", - "themesButton": "Browse themes", - "themesDescr": "Take your project to the next level with premium themes from our store – all built on MUI.", - "toggleNotifications": "Toggle notifications panel", - "toggleRTL": "Toggle right-to-left/left-to-right", - "traffic": "Traffic", - "TS": "TypeScript", - "v5IsOut": "🎉 v5 release candidate is out! Head to the", - "v5docsLink": "v5 documentation", - "v5startAdoption": "to get started.", - "unreadNotifications": "unread notifications", - "usage": "Usage", - "usageButton": "Explore the docs", - "usageDescr": "MUI components work without any additional setup, and don't pollute the global scope.", - "useDarkTheme": "Use dark theme", - "useHighDensity": "Apply higher density via props", - "usingMui": "Are you using MUI?", - "viewGitHub": "View the source on GitHub", - "visit": "Visit the website", - "whosUsing": "Who's using MUI?", "pages": { "/system/getting-started-group": "Getting started", "/system/getting-started": "Overview", diff --git a/package.json b/package.json index fdbeeb5c4bb7ed..8dd8cc42e5d3ea 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "docs:size-why": "cross-env DOCS_STATS_ENABLED=true pnpm docs:build", "docs:start": "pnpm --filter docs start", "docs:create-playground": "pnpm --filter docs create-playground", - "docs:i18n": "cross-env BABEL_ENV=development babel-node --extensions \".tsx,.ts,.js\" ./docs/scripts/i18n.js", + "docs:i18n": "cross-env BABEL_ENV=development babel-node --extensions \".tsx,.ts,.js\" ./docs/scripts/i18n.ts", "docs:link-check": "pnpm --filter docs link-check", "docs:typescript": "pnpm docs:typescript:formatted --watch", "docs:typescript:check": "pnpm --filter docs typescript", diff --git a/packages/mui-docs/src/DocsProvider/DocsProvider.tsx b/packages/mui-docs/src/DocsProvider/DocsProvider.tsx index 4ca2b78ef342ff..debe6afeb5a70e 100644 --- a/packages/mui-docs/src/DocsProvider/DocsProvider.tsx +++ b/packages/mui-docs/src/DocsProvider/DocsProvider.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { UserLanguageProvider } from '../i18n'; +import { Translations, UserLanguageProvider } from '../i18n'; export interface DocsConfig { LANGUAGES: string[]; @@ -14,12 +14,18 @@ export interface DocsProviderProps { config: DocsConfig; defaultUserLanguage: string; children?: React.ReactNode; + translations?: Translations; } -export function DocsProvider({ config, defaultUserLanguage, children }: DocsProviderProps) { +export function DocsProvider({ + config, + defaultUserLanguage, + translations, + children, +}: DocsProviderProps) { return ( - + {children} diff --git a/packages/mui-docs/src/i18n/i18n.tsx b/packages/mui-docs/src/i18n/i18n.tsx index 037680d8e3ed01..48e628600e78df 100644 --- a/packages/mui-docs/src/i18n/i18n.tsx +++ b/packages/mui-docs/src/i18n/i18n.tsx @@ -1,34 +1,28 @@ import * as React from 'react'; import PropTypes from 'prop-types'; +import { deepmerge } from '@mui/utils'; +import defaultTranslations from '../translations'; -declare global { - interface NodeRequire { - context: (path: string, useSubdirectories: boolean, regex: RegExp) => RequireContext; - } -} +const TranslationsContext = React.createContext(defaultTranslations); -interface RequireContext { - (req: string): string; - keys: () => string[]; +interface TranslationsProviderProps { + translations?: Record; + children: React.ReactNode; } -function mapTranslations(req: RequireContext) { - const translations: Record = {}; - req.keys().forEach((filename) => { - const match = filename.match(/-([a-z]{2}).json$/); - - if (match) { - translations[match[1]] = req(filename); - } else { - translations.en = req(filename); - } - }); - return translations; +function TranslationsProvider({ translations = {}, children }: TranslationsProviderProps) { + const currentTranslations = React.useContext(TranslationsContext); + const mergedTranslations = React.useMemo( + () => deepmerge(currentTranslations, translations), + [currentTranslations, translations], + ); + return ( + + {children} + + ); } -const req: RequireContext = require.context('docs/translations', false, /translations.*\.json$/); -const translations = mapTranslations(req); - function getPath(obj: any, path: string): any { if (!path || typeof path !== 'string') { return null; @@ -52,11 +46,12 @@ if (process.env.NODE_ENV !== 'production') { export interface UserLanguageProviderProps { children: React.ReactNode; + translations?: Translations; defaultUserLanguage: string; } export function UserLanguageProvider(props: UserLanguageProviderProps) { - const { children, defaultUserLanguage } = props; + const { children, translations, defaultUserLanguage } = props; const [userLanguage, setUserLanguage] = React.useState(defaultUserLanguage); @@ -65,7 +60,9 @@ export function UserLanguageProvider(props: UserLanguageProviderProps) { }, [userLanguage]); return ( - {children} + + {children} + ); } @@ -91,6 +88,8 @@ export interface TranslateOptions { export function useTranslate() { const userLanguage = useUserLanguage(); + const translations = React.useContext(TranslationsContext); + return React.useMemo( () => function translate(key: string, options: TranslateOptions = {}) { @@ -116,6 +115,27 @@ export function useTranslate() { return translation; }, - [userLanguage], + [userLanguage, translations], ); } + +export type Translations = { [key in string]?: string | Translations }; + +export interface RequireContext { + (req: string): string; + keys: () => string[]; +} + +export function mapTranslations(req: RequireContext): Translations { + const result: Translations = {}; + req.keys().forEach((filename) => { + const match = filename.match(/-([a-z]{2}).json$/); + + if (match) { + result[match[1]] = req(filename); + } else { + result.en = req(filename); + } + }); + return result; +} diff --git a/packages/mui-docs/src/translations/index.ts b/packages/mui-docs/src/translations/index.ts new file mode 100644 index 00000000000000..35e867915ca8f9 --- /dev/null +++ b/packages/mui-docs/src/translations/index.ts @@ -0,0 +1,6 @@ +import type { Translations } from '../i18n'; +import en from './translations.json'; + +export default { + en, +} as Record; diff --git a/packages/mui-docs/src/translations/translations.json b/packages/mui-docs/src/translations/translations.json new file mode 100644 index 00000000000000..9b2462e0101c0f --- /dev/null +++ b/packages/mui-docs/src/translations/translations.json @@ -0,0 +1,214 @@ +{ + "adblock": "If you don't mind tech-related ads (no tracking or remarketing), and want to keep us running, please whitelist us in your blocker.", + "api-docs": { + "componentName": "Component name", + "componentsApi": "Components API", + "themeDefaultProps": "Theme default props", + "themeDefaultPropsDescription": "You can use {{muiName}} to change the default props of this component with the theme.", + "classes": "CSS classes", + "classesDescription": "These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.", + "className": "Class name", + "cssDescription": "The following class names are useful for styling with CSS (the state classes are marked).
To learn more, visit the component customization page.", + "css": "CSS", + "cssComponent": "As a CSS utility, the {{name}} component also supports all system properties. You can use them as props directly on the component.", + "default": "Default", + "defaultComponent": "Default component", + "defaultValue": "Default value", + "defaultHTMLTag": "Default HTML tag", + "demos": "Component demos", + "deprecated": "Deprecated", + "description": "Description", + "globalClass": "Global class", + "defaultClass": "Default class", + "hookName": "Hook name", + "hooksApi": "Hooks API", + "hooksNoParameters": "This hook does not accept any input parameters.", + "hooksPageDescription": "API reference docs for the {{name}} hook. Learn about the input parameters and other APIs of this exported module.", + "import": "Import", + "importDifference": "Learn about the difference by reading this guide on minimizing bundle size.", + "inheritance": "Inheritance", + "inheritanceDescription": "While not explicitly documented above, the props of the {{component}} component{{suffix}} are also available in {{name}}. You can take advantage of this to target nested components.", + "inheritanceSuffixTransition": " from react-transition-group", + "name": "Name", + "nativeElement": "native", + "overrideStyles": "You can override the style of the component using one of these customization options:\n", + "overrideStylesStyledComponent": "", + "pageDescription": "API reference docs for the React {{name}} component. Learn about the props, CSS, and other APIs of this exported module.", + "props": "Props", + "properties": "Properties", + "parameters": "Parameters", + "requires-ref": "This needs to be able to hold a ref.", + "returns": "Returns: ", + "returnValue": "Return value", + "refNotHeld": "The component cannot hold a ref.", + "refRootElement": "The ref is forwarded to the root element.", + "ruleName": "Rule name", + "signature": "Signature", + "slots": "Slots", + "spreadHint": "Props of the {{spreadHintElement}} component are also available.", + "state": "STATE", + "styleOverrides": "The name {{componentStyles.name}} can be used when providing default props or style overrides in the theme.", + "slotDescription": "To learn how to customize the slot, check out the Overriding component structure guide.", + "slotName": "Slot name", + "type": "Type", + "required": "Required", + "optional": "Optional", + "additional-info": { + "cssApi": "See CSS classes API below for more details.", + "sx": "See the `sx` page for more details.", + "slotsApi": "See Slots API below for more details.", + "joy-size": "To learn how to add custom sizes to the component, check out Themed components—Extend sizes.", + "joy-color": "To learn how to add your own colors, check out Themed components—Extend colors.", + "joy-variant": "To learn how to add your own variants, check out Themed components—Extend variants." + } + }, + "landingPageDescr": "A responsive landing page layout with many common sections.", + "landingPageTitle": "Landing page", + "searchButton": "Search…", + "algoliaSearch": "What are you looking for?", + "appFrame": { + "changeLanguage": "Change language", + "github": "GitHub repository", + "helpToTranslate": "Help to translate", + "openDrawer": "Open main navigation", + "skipToContent": "Skip to content", + "toggleSettings": "Toggle settings drawer" + }, + "backToTop": "Scroll back to top", + "blogDescr": "A sophisticated blog page layout. Markdown support is courtesy of markdown-to-jsx.", + "blogTitle": "Blog", + "bundleSize": "Bundle size", + "bundleSizeTooltip": "Scroll down to 'Exports Analysis' for a more detailed report.", + "cancel": "Cancel", + "cdn": "or use a CDN.", + "checkoutDescr": "A step-by-step checkout page layout. Adapt the number of steps to suit your needs, or make steps optional.", + "checkoutTitle": "Checkout", + "clickToCopy": "Click to copy", + "close": "Close", + "codesandbox": "Edit in CodeSandbox", + "copied": "Copied", + "copiedSource": "The source code has been copied to your clipboard.", + "copiedSourceLink": "Link to the source code has been copied to your clipboard.", + "copySource": "Copy the source", + "copySourceLinkJS": "Copy link to JavaScript source", + "copySourceLinkTS": "Copy link to TypeScript source", + "dashboardDescr": "Contains a taskbar and a mini variant drawer. The chart is courtesy of Recharts.", + "dashboardTitle": "Dashboard", + "decreaseSpacing": "decrease spacing", + "demoToolbarLabel": "demo source", + "demoStylingSelectSystem": "MUI System", + "demoStylingSelectTailwind": "Tailwind CSS", + "demoStylingSelectCSS": "Plain CSS", + "diamondSponsors": "Diamond sponsors", + "becomeADiamondSponsor": "Become a Diamond sponsor", + "diamondSponsorVacancies": "One spot left!", + "editorHint": "Press Enter to start editing", + "editPage": "Edit this page", + "emojiLove": "Love", + "emojiWarning": "Warning", + "expandAll": "Expand all", + "feedbackCommentLabel": "Comment", + "feedbackFailed": "Couldn't submit feedback. Please try again later.", + "feedbackMessage": "Was this page helpful?", + "feedbackMessageDown": "How can we improve this page? (optional)", + "feedbackMessageUp": "What did you like about this page? (optional)", + "feedbackSectionSpecific": "How can we improve the {{sectionName}} section? (optional)", + "feedbackMessageToGitHub": { + "usecases": "If something is broken or if you need a reply to a problem you've encountered, please", + "reasonWhy": "Otherwise, the team won't be able to answer back or ask for more information.", + "callToAction": { + "link": "open an issue instead." + } + }, + "feedbackNo": "No", + "feedbackSubmitted": "Feedback submitted", + "feedbackYes": "Yes", + "footerCompany": "Company", + "goToHome": "go to homepage", + "getProfessionalSupport": "Get Professional Support", + "getStarted": "Get Started", + "githubLabel": "Feedback", + "headTitle": "MUI: A popular React UI framework", + "hideFullSource": "Collapse code", + "hideSource": "Hide code", + "homeQuickWord": "A quick word from our sponsors:", + "increaseSpacing": "increase spacing", + "initialFocusLabel": "A generic container that is programmatically focused to test keyboard navigation of our components.", + "installation": "Installation", + "installButton": "Read installation docs", + "installDescr": "Install MUI's source files via npm. We take care of injecting the CSS needed.", + "joinThese": "Join these and other great organizations!", + "JS": "JavaScript", + "letUsKnow": "Let us know!", + "likeMui": "Help us keep running", + "loadFont": "Load the default Roboto font.", + "mainNavigation": "documentation", + "newest": "Newest", + "openDrawer": "Open documentation navigation", + "or": "or", + "pageTOC": "Page table of contents", + "praise": "Praise for MUI", + "praiseDescr": "Here's what some of our users are saying.", + "pricingDescr": "Quickly build an effective pricing table for your potential customers.", + "pricingTitle": "Pricing", + "resetDemo": "Reset demo", + "resetDensity": "Reset density", + "resetFocus": "Reset focus to test keyboard navigation", + "searchIcons": { + "learnMore": "Learn more about the import" + }, + "seeMore": "See more", + "settings": { + "color": "Color", + "dark": "Dark", + "direction": "Direction", + "editWebsiteColors": "Edit website colors", + "light": "Light", + "ltr": "Left to right", + "mode": "Mode", + "rtl": "Right to left", + "settings": "Settings", + "system": "System", + "language": "Language" + }, + "showFullSource": "Expand code", + "showJSSource": "Show JavaScript source", + "showSource": "Show code", + "showTSSource": "Show TypeScript source", + "signInDescr": "A simple sign-in page using text fields, buttons, checkboxes, links, and more.", + "signInSideDescr": "A simple sign-in page with a two-column layout using text fields, buttons, and more.", + "signInSideTitle": "Sign-in side", + "signInTitle": "Sign-in", + "signUpDescr": "A simple sign-up page using text fields, buttons, checkboxes, links, and more.", + "signUpTitle": "Sign-up", + "sourceCode": "Source code", + "spacingUnit": "Spacing unit", + "stackblitz": "Edit in StackBlitz", + "stars": "GitHub stars", + "stickyFooterDescr": "Attach a footer to the bottom of the viewport when page content is short.", + "stickyFooterTitle": "Sticky footer", + "strapline": "MUI provides a simple, customizable, and accessible library of React components. Follow your own design system, or start with Material Design.", + "submit": "Submit", + "tableOfContents": "Contents", + "thanks": "Thank you!", + "themes": "Premium themes", + "themesButton": "Browse themes", + "themesDescr": "Take your project to the next level with premium themes from our store – all built on MUI.", + "toggleNotifications": "Toggle notifications panel", + "toggleRTL": "Toggle right-to-left/left-to-right", + "traffic": "Traffic", + "TS": "TypeScript", + "v5IsOut": "🎉 v5 release candidate is out! Head to the", + "v5docsLink": "v5 documentation", + "v5startAdoption": "to get started.", + "unreadNotifications": "unread notifications", + "usage": "Usage", + "usageButton": "Explore the docs", + "usageDescr": "MUI components work without any additional setup, and don't pollute the global scope.", + "useDarkTheme": "Use dark theme", + "useHighDensity": "Apply higher density via props", + "usingMui": "Are you using MUI?", + "viewGitHub": "View the source on GitHub", + "visit": "Visit the website", + "whosUsing": "Who's using MUI?" +} diff --git a/packages/mui-docs/tsconfig.build.json b/packages/mui-docs/tsconfig.build.json index ba7a787fa189f4..e51a26ab34c9e5 100644 --- a/packages/mui-docs/tsconfig.build.json +++ b/packages/mui-docs/tsconfig.build.json @@ -8,9 +8,10 @@ "noEmit": false, "emitDeclarationOnly": true, "outDir": "build", - "rootDir": "./src" + "rootDir": "./src", + "tsBuildInfoFile": "build/tsconfig.build.tsbuildinfo" }, - "include": ["src/**/*.ts*"], + "include": ["src/**/*.ts*", "src/**/*.json"], "exclude": ["src/**/*.spec.ts*", "src/**/*.test.ts*"], "references": [{ "path": "../mui-material/tsconfig.build.json" }] } diff --git a/packages/mui-docs/tsconfig.json b/packages/mui-docs/tsconfig.json index 1227ceb7c1f109..63ed1fc8920b4f 100644 --- a/packages/mui-docs/tsconfig.json +++ b/packages/mui-docs/tsconfig.json @@ -2,6 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "skipLibCheck": true, + "resolveJsonModule": true, "types": ["react", "node"] }, "include": ["src/**/*", "test/**/*"]