Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { AppProvider } from '@toolpad/core/AppProvider';
import { SignInPage } from '@toolpad/core/SignInPage';
import hiIN from '@toolpad/core/locales/hiIN';
import { hiIN } from '@toolpad/core/locales';

const providers = [
{ id: 'github', name: 'गिटहब' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
type AuthProvider,
type AuthResponse,
} from '@toolpad/core/SignInPage';
import hiIN from '@toolpad/core/locales/hiIN';
import { hiIN } from '@toolpad/core/locales';

const providers = [
{ id: 'github', name: 'गिटहब' },
Expand Down
4 changes: 2 additions & 2 deletions docs/data/toolpad/core/introduction/base-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ To translate all your Toolpad components, you can provide translations through t
```tsx
import { createTheme, ThemeProvider } from '@mui/material/styles';
import { hiIN as coreHiIn } from '@mui/material/locale';
import hiIN from '@toolpad/core/locales/hiIN';
import { hiIN } from '@toolpad/core/locales';

const theme = createTheme({
{
Expand All @@ -144,7 +144,7 @@ If you want to pass language translations without using `createTheme`, you can d

```tsx
import { AppProvider } from '@toolpad/core/AppProvider';
import hiIN from '@toolpad/core/locales/hiIN';
import { hiIN } from '@toolpad/core/locales';

function App({ children }) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import { useTheme } from '@mui/material/styles';
import DEFAULT_LOCALE from '../locales/en';
import { en as DEFAULT_LOCALE } from '../locales';

export interface LocaleText {
// Account
Expand Down
2 changes: 2 additions & 0 deletions packages/toolpad-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ export * from './useSession';
export * from './useSessionStorageState';

export * from './persistence/codec';

export * from './locales';
4 changes: 2 additions & 2 deletions packages/toolpad-core/src/locales/en.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { LocaleText } from '../AppProvider';
import { getLocalization } from './getLocalization';

const en: LocaleText = {
const enLabels: LocaleText = {
// Account
accountSignInLabel: 'Sign In',
accountSignOutLabel: 'Sign Out',
Expand Down Expand Up @@ -55,4 +55,4 @@ const en: LocaleText = {
deletedItemMessage: 'This item has been deleted.',
};

export default getLocalization(en);
export default getLocalization(enLabels);
2 changes: 2 additions & 0 deletions packages/toolpad-core/src/locales/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as hiIN } from './hiIN';
export { default as en } from './en';