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

[l10n] Improve Hebrew (he-IL) locale #14286

Closed
wants to merge 12 commits into from
Closed
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
2 changes: 1 addition & 1 deletion docs/data/data-grid/localization/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"languageTag": "he-IL",
"importName": "heIL",
"localeName": "Hebrew",
"missingKeysCount": 4,
"missingKeysCount": 0,
"totalKeysCount": 118,
"githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-data-grid/src/locales/heIL.ts"
},
Expand Down
2 changes: 1 addition & 1 deletion docs/data/date-pickers/localization/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"languageTag": "he-IL",
"importName": "heIL",
"localeName": "Hebrew",
"missingKeysCount": 1,
"missingKeysCount": 0,
"totalKeysCount": 50,
"githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-date-pickers/src/locales/heIL.ts"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export interface GridAggregationFunction<V = any, AV = V> {
getCellValue?: (params: GridAggregationGetCellValueParams) => V;
}

interface GridAggregationParams<V = any> {
export interface GridAggregationParams<V = any> {
values: (V | undefined)[];
groupId: GridRowId;
field: GridColDef['field'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useGridApiOptionHandler, useGridNativeEventListener } from '../../utils
import { gridFocusCellSelector } from '../focus/gridFocusStateSelector';
import { serializeCellValue } from '../export/serializers/csvSerializer';
import type { DataGridProcessedProps } from '../../../models/props/DataGridProps';
import { isCopyShortcut } from '../../../utils/keyboardUtils';

function writeToClipboardPolyfill(data: string) {
const span = document.createElement('span');
Expand Down Expand Up @@ -74,14 +75,7 @@ export const useGridClipboard = (

const handleCopy = React.useCallback(
(event: KeyboardEvent) => {
if (
!(
(event.ctrlKey || event.metaKey) &&
event.key.toLowerCase() === 'c' &&
!event.shiftKey &&
!event.altKey
)
) {
if (!isCopyShortcut(event)) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid/src/internals/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export {
getActiveElement,
isEventTargetInPortal,
} from '../utils/domUtils';
export { isNavigationKey, isPasteShortcut } from '../utils/keyboardUtils';
export { isNavigationKey, isPasteShortcut, isCopyShortcut } from '../utils/keyboardUtils';
export * from '../utils/utils';
export { exportAs } from '../utils/exportAs';
export * from '../utils/getPublicApiRef';
Expand Down
8 changes: 4 additions & 4 deletions packages/x-data-grid/src/locales/heIL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ const heILGrid: Partial<GridLocaleText> = {
toolbarExportExcel: 'ייצוא ל- Excel',

// Columns management text
// columnsManagementSearchTitle: 'Search',
// columnsManagementNoColumns: 'No columns',
// columnsManagementShowHideAllText: 'Show/Hide All',
// columnsManagementReset: 'Reset',
columnsManagementSearchTitle: 'חיפוש',
columnsManagementNoColumns: 'ללא עמודות',
columnsManagementShowHideAllText: 'הצג/הסתר הכל',
columnsManagementReset: 'אתחול',

// Filter panel text
filterPanelAddFilter: 'הוסף מסנן',
Expand Down
19 changes: 13 additions & 6 deletions packages/x-data-grid/src/utils/keyboardUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,20 @@ export const isHideMenuKey = (key: React.KeyboardEvent['key']) => key === 'Tab'
// In theory, on macOS, ctrl + v doesn't trigger a paste, so the function should return false.
// However, maybe it's overkill to fix, so let's be lazy.
export function isPasteShortcut(event: React.KeyboardEvent) {
if (
return (
(event.ctrlKey || event.metaKey) &&
event.key.toLowerCase() === 'v' &&
String.fromCharCode(event.keyCode) === 'V' &&
!event.shiftKey &&
!event.altKey
) {
return true;
}
return false;
);
}

// Checks if the keyboard event corresponds to the copy shortcut (CTRL+C or CMD+C) across different localization keyboards.
export function isCopyShortcut(event: KeyboardEvent): boolean {
return (
(event.ctrlKey || event.metaKey) &&
String.fromCharCode(event.keyCode) === 'C' &&
!event.shiftKey &&
!event.altKey
);
}
2 changes: 1 addition & 1 deletion packages/x-date-pickers/src/locales/heIL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const heILPickers: Partial<PickersLocaleText<any>> = {
hours: 'שעות',
minutes: 'דקות',
seconds: 'שניות',
// meridiem: 'Meridiem',
meridiem: 'צהריים',

// Common
empty: 'ריק',
Expand Down
5 changes: 5 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ pnpm release:changelog
> `<!--/ DO_NOT_REMOVE /-->`
> This string needs to stay where it gets inserted for the automated discord announcement to work.

<<<<<<< HEAD
You can also provide the GitHub token by setting `process.env.GITHUB_TOKEN` variable.
=======
You can also provide the github token by setting `process.env.GITHUB_TOKEN` variable.

> > > > > > > dd20afe2668c15eb9f350ab171137c4f64931273

In case of a problem, another method to generate the changelog is available at the end of this page.

Expand Down
1 change: 1 addition & 0 deletions scripts/x-data-grid-premium.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
{ "name": "gridAggregationLookupSelector", "kind": "Variable" },
{ "name": "GridAggregationModel", "kind": "TypeAlias" },
{ "name": "gridAggregationModelSelector", "kind": "Variable" },
{ "name": "GridAggregationParams", "kind": "Interface" },
{ "name": "GridAggregationPosition", "kind": "TypeAlias" },
{ "name": "GridAggregationRule", "kind": "Interface" },
{ "name": "GridAggregationRules", "kind": "TypeAlias" },
Expand Down