forked from mui/mui-x
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[I10n] Add Finnish (fi-FI) locale to Datepicker (mui#6219)
- Loading branch information
1 parent
de5740d
commit 071544c
Showing
6 changed files
with
103 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { PickersLocaleText } from './utils/pickersLocaleTextApi'; | ||
import { getPickersLocalization } from './utils/getPickersLocalization'; | ||
import { CalendarPickerView } from '../internals/models'; | ||
|
||
const views = { | ||
hours: 'tunnit', | ||
minutes: 'minuutit', | ||
seconds: 'sekuntit', | ||
}; | ||
|
||
const viewTranslation = { | ||
calendar: 'kalenteri', | ||
clock: 'kello', | ||
}; | ||
|
||
const fiFIPickers: Partial<PickersLocaleText<any>> = { | ||
// Calendar navigation | ||
previousMonth: 'Edellinen kuukausi', | ||
nextMonth: 'Seuraava kuukausi', | ||
|
||
// View navigation | ||
openPreviousView: 'avaa edellinen kuukausi', | ||
openNextView: 'avaa seuraava kuukausi', | ||
calendarViewSwitchingButtonAriaLabel: (view: CalendarPickerView) => | ||
view === 'year' | ||
? 'vuosinäkymä on auki, vaihda kalenterinäkymään' | ||
: 'kalenterinäkymä on auki, vaihda vuosinäkymään', | ||
inputModeToggleButtonAriaLabel: (isKeyboardInputOpen: boolean, viewType: 'calendar' | 'clock') => | ||
isKeyboardInputOpen | ||
? `tekstikenttä on auki, mene ${viewTranslation[viewType]}näkymään` | ||
: `${viewTranslation[viewType]}näkymä on auki, mene tekstikenttään`, | ||
|
||
// DateRange placeholders | ||
start: 'Alku', | ||
end: 'Loppu', | ||
|
||
// Action bar | ||
cancelButtonLabel: 'Peruuta', | ||
clearButtonLabel: 'Tyhjennä', | ||
okButtonLabel: 'OK', | ||
todayButtonLabel: 'Tänään', | ||
|
||
// Toolbar titles | ||
datePickerDefaultToolbarTitle: 'Valitse päivä', | ||
dateTimePickerDefaultToolbarTitle: 'Valitse päivä ja aika', | ||
timePickerDefaultToolbarTitle: 'Valitse aika', | ||
dateRangePickerDefaultToolbarTitle: 'Valitse aikaväli', | ||
|
||
// Clock labels | ||
clockLabelText: (view, time, adapter) => | ||
`Valitse ${views[view]}. ${ | ||
time === null ? 'Ei aikaa valittuna' : `Valittu aika on ${adapter.format(time, 'fullTime')}` | ||
}`, | ||
hoursClockNumberText: (hours) => `${hours} tuntia`, | ||
minutesClockNumberText: (minutes) => `${minutes} minuuttia`, | ||
secondsClockNumberText: (seconds) => `${seconds} sekunttia`, | ||
|
||
// Open picker labels | ||
openDatePickerDialogue: (rawValue, utils) => | ||
rawValue && utils.isValid(utils.date(rawValue)) | ||
? `Valitse päivä, valittu päivä on ${utils.format(utils.date(rawValue)!, 'fullDate')}` | ||
: 'Valitse päivä', | ||
openTimePickerDialogue: (rawValue, utils) => | ||
rawValue && utils.isValid(utils.date(rawValue)) | ||
? `Valitse aika, valittu aika on ${utils.format(utils.date(rawValue)!, 'fullTime')}` | ||
: 'Valitse aika', | ||
|
||
// Table labels | ||
timeTableLabel: 'valitse aika', | ||
dateTableLabel: 'valitse päivä', | ||
}; | ||
|
||
export const fiFI = getPickersLocalization(fiFIPickers); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters