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] Add Hungarian (hu-HU) locale from @noherczeg #7796

Merged
merged 4 commits into from
Feb 16, 2023
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
8 changes: 8 additions & 0 deletions docs/data/date-pickers/localization/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@
"totalKeysCount": 24,
"githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-date-pickers/src/locales/deDE.ts/"
},
{
"languageTag": "hu-HU",
"importName": "huHU",
"localeName": "Hungarian",
"missingKeysCount": 0,
"totalKeysCount": 24,
"githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-date-pickers/src/locales/huHU.ts/"
},
{
"languageTag": "is-IS",
"importName": "isIS",
Expand Down
76 changes: 76 additions & 0 deletions packages/x-date-pickers/src/locales/huHU.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { PickersLocaleText } from './utils/pickersLocaleTextApi';
import { getPickersLocalization } from './utils/getPickersLocalization';

// maps TimeView to its translation
const timeViews = {
hours: 'Óra',
minutes: 'Perc',
seconds: 'Másodperc',
};

// maps PickersToolbar["viewType"] to its translation
const pickerViews = {
calendar: 'naptár',
clock: 'óra',
};

const huHUPickers: PickersLocaleText<any> = {
// Calendar navigation
previousMonth: 'Előző hónap',
nextMonth: 'Következő hónap',

// View navigation
openPreviousView: 'Előző nézet megnyitása',
openNextView: 'Következő nézet megnyitása',
calendarViewSwitchingButtonAriaLabel: (view) =>
view === 'year'
? 'az évválasztó már nyitva, váltson a naptárnézetre'
: 'a naptárnézet már nyitva, váltson az évválasztóra',
inputModeToggleButtonAriaLabel: (isKeyboardInputOpen, viewType) =>
isKeyboardInputOpen
? `szöveges beviteli nézet aktív, váltás ${pickerViews[viewType]} nézetre`
: `${pickerViews[viewType]} beviteli nézet aktív, váltás szöveges beviteli nézetre`,

// DateRange placeholders
start: 'Kezdő dátum',
end: 'Záró dátum',

// Action bar
cancelButtonLabel: 'Mégse',
clearButtonLabel: 'Törlés',
okButtonLabel: 'OK',
todayButtonLabel: 'Ma',

// Toolbar titles
datePickerDefaultToolbarTitle: 'Dátum kiválasztása',
dateTimePickerDefaultToolbarTitle: 'Dátum és idő kiválasztása',
timePickerDefaultToolbarTitle: 'Idő kiválasztása',
dateRangePickerDefaultToolbarTitle: 'Dátumhatárok kiválasztása',

// Clock labels
clockLabelText: (view, time, adapter) =>
`${timeViews[view] ?? view} kiválasztása. ${
time === null
? 'Nincs kiválasztva idő'
: `A kiválasztott idő ${adapter.format(time, 'fullTime')}`
}`,
hoursClockNumberText: (hours) => `${hours} ${timeViews.hours.toLowerCase()}`,
minutesClockNumberText: (minutes) => `${minutes} ${timeViews.minutes.toLowerCase()}`,
secondsClockNumberText: (seconds) => `${seconds} ${timeViews.seconds.toLowerCase()}`,

// Open picker labels
openDatePickerDialogue: (value, utils) =>
value !== null && utils.isValid(value)
? `Válasszon dátumot, a kiválasztott dátum: ${utils.format(value, 'fullDate')}`
: 'Válasszon dátumot',
openTimePickerDialogue: (value, utils) =>
value !== null && utils.isValid(value)
? `Válasszon időt, a kiválasztott idő: ${utils.format(value, 'fullTime')}`
: 'Válasszon időt',

// Table labels
timeTableLabel: 'válasszon időt',
dateTableLabel: 'válasszon dátumot',
};

export const huHU = getPickersLocalization(huHUPickers);
1 change: 1 addition & 0 deletions packages/x-date-pickers/src/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export * from './faIR';
export * from './fiFI';
export * from './csCZ';
export * from './frFR';
export * from './huHU';
export * from './enUS';
export * from './nbNO';
export * from './svSE';
Expand Down
1 change: 1 addition & 0 deletions scripts/x-date-pickers-pro.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
{ "name": "getMonthPickerUtilityClass", "kind": "Function" },
{ "name": "getPickersDayUtilityClass", "kind": "Function" },
{ "name": "getYearPickerUtilityClass", "kind": "Function" },
{ "name": "huHU", "kind": "Variable" },
{ "name": "isIS", "kind": "Variable" },
{ "name": "itIT", "kind": "Variable" },
{ "name": "jaJP", "kind": "Variable" },
Expand Down
1 change: 1 addition & 0 deletions scripts/x-date-pickers.exports.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
{ "name": "getMonthPickerUtilityClass", "kind": "Function" },
{ "name": "getPickersDayUtilityClass", "kind": "Function" },
{ "name": "getYearPickerUtilityClass", "kind": "Function" },
{ "name": "huHU", "kind": "Variable" },
{ "name": "isIS", "kind": "Variable" },
{ "name": "itIT", "kind": "Variable" },
{ "name": "jaJP", "kind": "Variable" },
Expand Down