Skip to content

Commit

Permalink
[l10n] Add Bulgarian (bg-BG) locale (#14469)
Browse files Browse the repository at this point in the history
  • Loading branch information
GMchris authored Oct 2, 2024
1 parent 539a7ba commit 82b7df2
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 0 deletions.
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 @@ -15,6 +15,14 @@
"totalKeysCount": 50,
"githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-date-pickers/src/locales/beBY.ts"
},
{
"languageTag": "bg-BG",
"importName": "bgBG",
"localeName": "Bulgarian",
"missingKeysCount": 0,
"totalKeysCount": 50,
"githubLink": "https://github.com/mui/mui-x/blob/master/packages/x-date-pickers/src/locales/bgBG.ts"
},
{
"languageTag": "ca-ES",
"importName": "caES",
Expand Down
100 changes: 100 additions & 0 deletions packages/x-date-pickers/src/locales/bgBG.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import { PickersLocaleText } from './utils/pickersLocaleTextApi';
import { getPickersLocalization } from './utils/getPickersLocalization';
import { TimeViewWithMeridiem } from '../internals/models';

const views: Record<TimeViewWithMeridiem, string> = {
hours: 'часове',
minutes: 'минути',
seconds: 'секунди',
meridiem: 'преди обяд/след обяд',
};

const bgBGPickers: Partial<PickersLocaleText<any>> = {
// Calendar navigation
previousMonth: 'Предишен месец',
nextMonth: 'Следващ месец',

// View navigation
openPreviousView: 'Отвори предишен изглед',
openNextView: 'Отвори следващ изглед',
calendarViewSwitchingButtonAriaLabel: (view) =>
view === 'year'
? 'отворен е изглед на година, премини на изглед на календар'
: 'отворен е изглед на календар, премини на изглед на година',

// DateRange labels
start: 'Начало',
end: 'Край',
startDate: 'Начална дата',
startTime: 'Начален час',
endDate: 'Крайна дата',
endTime: 'Краен час',

// Action bar
cancelButtonLabel: 'Отказ',
clearButtonLabel: 'Изчисти',
okButtonLabel: 'ОК',
todayButtonLabel: 'Днес',

// Toolbar titles
datePickerToolbarTitle: 'Избери дата',
dateTimePickerToolbarTitle: 'Избери дата и час',
timePickerToolbarTitle: 'Избери час',
dateRangePickerToolbarTitle: 'Избери времеви период',

// Clock labels
clockLabelText: (view, time, adapter) =>
`Избери ${views[view]}. ${time === null ? 'Не е избран час' : `Избраният час е ${adapter.format(time, 'fullTime')}`}`,
hoursClockNumberText: (hours) => `${hours} часа`,
minutesClockNumberText: (minutes) => `${minutes} минути`,
secondsClockNumberText: (seconds) => `${seconds} секунди`,

// Digital clock labels
selectViewText: (view) => `Избери ${views[view]}`,

// Calendar labels
calendarWeekNumberHeaderLabel: 'Седмица',
calendarWeekNumberHeaderText: '#',
calendarWeekNumberAriaLabelText: (weekNumber) => `Седмица ${weekNumber}`,
calendarWeekNumberText: (weekNumber) => `${weekNumber}`,

// Open picker labels
openDatePickerDialogue: (value, utils) =>
value !== null && utils.isValid(value)
? `Избери дата, избраната дата е ${utils.format(value, 'fullDate')}`
: 'Избери дата',
openTimePickerDialogue: (value, utils) =>
value !== null && utils.isValid(value)
? `Избери час, избраният час е ${utils.format(value, 'fullTime')}`
: 'Избери час',
fieldClearLabel: 'Изчисти стойност',

// Table labels
timeTableLabel: 'избери час',
dateTableLabel: 'избери дата',

// Field section placeholders
fieldYearPlaceholder: (params) => 'Г'.repeat(params.digitAmount),
fieldMonthPlaceholder: (params) => (params.contentType === 'letter' ? 'ММММ' : 'ММ'),
fieldDayPlaceholder: () => 'ДД',
fieldWeekDayPlaceholder: (params) => (params.contentType === 'letter' ? 'СССС' : 'СС'),
fieldHoursPlaceholder: () => 'чч',
fieldMinutesPlaceholder: () => 'мм',
fieldSecondsPlaceholder: () => 'сс',
fieldMeridiemPlaceholder: () => 'пс',

// View names
year: 'Година',
month: 'Месец',
day: 'Ден',
weekDay: 'Ден от седмицата',
hours: 'Часове',
minutes: 'Минути',
seconds: 'Секунди',
meridiem: 'Преди обяд/след обяд',

// Common
empty: 'Празно',
};

export const bgBG = getPickersLocalization(bgBGPickers);
1 change: 1 addition & 0 deletions packages/x-date-pickers/src/locales/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './beBY';
export * from './bgBG';
export * from './caES';
export * from './csCZ';
export * from './daDK';
Expand Down

0 comments on commit 82b7df2

Please sign in to comment.