Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pickers] Remove utils and value params from translations #14986

Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'master' into remove-utils-and-value-params-from-transla…
…tions
arthurbalduini committed Oct 29, 2024
commit 81051706a7b7ba5e799ea3ab14f884e8093bd7dd
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as React from 'react';
import { PickerOwnerState, PickerValidDate } from '../../models';
import { PickersInputLocaleText } from '../../locales';
import { LocalizationProvider } from '../../LocalizationProvider';

@@ -13,8 +14,8 @@ export const PickersPrivateContext = React.createContext<PickersPrivateContextVa
*
* @ignore - do not document.
*/
export function PickersProvider(props: PickersFieldProviderProps) {
const { contextValue, localeText, children } = props;
export function PickersProvider<TDate extends PickerValidDate>(props: PickersProviderProps<TDate>) {
const { contextValue, privateContextValue, localeText, children } = props;

return (
<PickersContext.Provider value={contextValue}>
@@ -25,9 +26,10 @@ export function PickersProvider(props: PickersFieldProviderProps) {
);
}

interface PickersFieldProviderProps {
export interface PickersProviderProps<TDate extends PickerValidDate> {
contextValue: PickersContextValue;
localeText: PickersInputLocaleText | undefined;
privateContextValue: PickersPrivateContextValue;
localeText: PickersInputLocaleText<TDate> | undefined;
children: React.ReactNode;
}


Unchanged files with check annotations Beta

## Stop passing `utils` and the date object to some translation keys
Some translation keys no longer require `utils` and the date object as parameters, but only the formatted value as a string. The keys affected by this changes are: `clockLabelText`, `openDatePickerDialogue` and `openTimePickerDialogue`.
If you have customized those translation keys, you have to update them following the examples bellow:

Check failure on line 321 in docs/data/migration/migration-pickers-v7/migration-pickers-v7.md

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [MUI.NoBritish] Use the US spelling 'below' instead of the British 'bellow' Raw Output: {"message": "[MUI.NoBritish] Use the US spelling 'below' instead of the British 'bellow'", "location": {"path": "docs/data/migration/migration-pickers-v7/migration-pickers-v7.md", "range": {"start": {"line": 321, "column": 95}}}, "severity": "ERROR"}
- If you are setting a custom value in a picker component:
You are viewing a condensed version of this merge commit. You can view the full changes here.