feat(i18n): add deDE locale (#1513)

* feat(i18n): add deDE locale

* docs: update CHANGELOGS
This commit is contained in:
FaHaIk 2021-11-03 16:02:28 +01:00 committed by GitHub
parent 3a75d7b452
commit cbd2c7beb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 126 additions and 0 deletions

View File

@ -11,6 +11,10 @@
- Fix `n-alert` `contentTextColor` and `titleTextColor` type theme variable not working, closes [#1495](https://github.com/TuSimple/naive-ui/issues/1495). - Fix `n-alert` `contentTextColor` and `titleTextColor` type theme variable not working, closes [#1495](https://github.com/TuSimple/naive-ui/issues/1495).
### i18n
- Add deDE locale.
## 2.20.1 (2021-11-01) ## 2.20.1 (2021-11-01)
### Fixes ### Fixes

View File

@ -11,6 +11,10 @@
- 修复 `n-alert` `contentTextColor``titleTextColor` 的类型主题变量不起作用,关闭 [#1495](https://github.com/TuSimple/naive-ui/issues/1495) - 修复 `n-alert` `contentTextColor``titleTextColor` 的类型主题变量不起作用,关闭 [#1495](https://github.com/TuSimple/naive-ui/issues/1495)
### i18n
- 新增 deDE locale
## 2.20.1 (2021-11-01) ## 2.20.1 (2021-11-01)
### Fixes ### Fixes

View File

@ -0,0 +1,97 @@
import type { NLocale } from './enUS'
const deDE: NLocale = {
name: 'de-DE',
global: {
undo: 'Rückgängig',
redo: 'Wiederholen',
confirm: 'Bestätigen'
},
Popconfirm: {
positiveText: 'Bestätigen',
negativeText: 'Abbrechen'
},
Cascader: {
placeholder: 'Bitte auswählen',
loading: 'Wird geladen',
loadingRequiredMessage: (label: string): string =>
`Bitte laden Sie alle Unterpunkte von ${label}, bevor Sie es auswählen.`
},
Time: {
dateFormat: 'dd-MM-yyyy',
dateTimeFormat: 'dd-MM-yyyy HH:mm:ss'
},
DatePicker: {
yearFormat: 'yyyy',
monthFormat: 'MMM',
dayFormat: 'eeeeee',
clear: 'Löschen',
now: 'Jetzt',
confirm: 'Bestätigen',
selectTime: 'Uhrzeit auswählen',
selectDate: 'Datum auswählen',
datePlaceholder: 'Datum auswählen',
datetimePlaceholder: 'Datum und Uhrzeit auswählen',
monthPlaceholder: 'Monat auswählen',
startDatePlaceholder: 'Anfangsdatum',
endDatePlaceholder: 'Enddatum',
startDatetimePlaceholder: 'Anfangsdatum und Uhrzeit',
endDatetimePlaceholder: 'Enddatum und Uhrzeit',
monthBeforeYear: true,
firstDayOfWeek: 0 as 0 | 1 | 2 | 3 | 4 | 5 | 6,
today: 'Heute'
},
DataTable: {
checkTableAll: 'Alles auswählen',
uncheckTableAll: 'Auswahl aufheben',
confirm: 'Bestätigen',
clear: 'Löschen'
},
Transfer: {
sourceTitle: 'Quelle',
targetTitle: 'Ziel'
},
Empty: {
description: 'Keine Daten'
},
Select: {
placeholder: 'Bitte auswählen'
},
TimePicker: {
placeholder: 'Uhrzeit auswählen',
positiveText: 'OK',
negativeText: 'Abbrechen',
now: 'Jetzt'
},
Pagination: {
goto: 'Gehe zu',
selectionSuffix: 'Seite'
},
DynamicTags: {
add: 'Hinzufügen'
},
Log: {
loading: 'Wird geladen'
},
Input: {
placeholder: 'Bitte ausfüllen'
},
InputNumber: {
placeholder: 'Bitte ausfüllen'
},
DynamicInput: {
create: 'Erstellen'
},
ThemeEditor: {
title: 'Theme Editor',
clearAllVars: 'Alle Variablen löschen',
clearSearch: 'Suche löschen',
filterCompName: 'Filter Komponentenname',
filterVarName: 'Filter Variablenname',
import: 'Importieren',
export: 'Exportieren',
restore: 'Auf Standard zurücksetzen'
}
}
export default deDE

9
src/locales/date/deDE.ts Normal file
View File

@ -0,0 +1,9 @@
import de from 'date-fns/locale/de'
import { NDateLocale } from './enUS'
const dateDeDE: NDateLocale = {
name: 'de-DE',
locale: de
}
export default dateDeDE

View File

@ -7,12 +7,14 @@ import {
ukUA, ukUA,
jaJP, jaJP,
idID, idID,
deDE,
dateEnUS, dateEnUS,
dateZhCN, dateZhCN,
dateRuRU, dateRuRU,
dateUkUA, dateUkUA,
dateJaJP, dateJaJP,
dateIdID, dateIdID,
dateDeDE,
NConfigProvider, NConfigProvider,
NDateLocale, NDateLocale,
NLocale, NLocale,
@ -82,5 +84,13 @@ describe('locale', () => {
} }
}).html() }).html()
).toMatchSnapshot() ).toMatchSnapshot()
expect(
mount(Wrapper, {
props: {
dateLocale: dateDeDE,
locale: deDE
}
}).html()
).toMatchSnapshot()
}) })
}) })

View File

@ -4,11 +4,13 @@ export { default as ruRU } from './common/ruRU'
export { default as ukUA } from './common/ukUA' export { default as ukUA } from './common/ukUA'
export { default as jaJP } from './common/jaJP' export { default as jaJP } from './common/jaJP'
export { default as idID } from './common/idID' export { default as idID } from './common/idID'
export { default as deDE } from './common/deDE'
export { default as dateZhCN } from './date/zhCN' export { default as dateZhCN } from './date/zhCN'
export { default as dateEnUS } from './date/enUS' export { default as dateEnUS } from './date/enUS'
export { default as dateRuRU } from './date/ruRU' export { default as dateRuRU } from './date/ruRU'
export { default as dateUkUA } from './date/ukUA' export { default as dateUkUA } from './date/ukUA'
export { default as dateJaJP } from './date/jaJP' export { default as dateJaJP } from './date/jaJP'
export { default as dateIdID } from './date/idID' export { default as dateIdID } from './date/idID'
export { default as dateDeDE } from './date/deDE'
export type { NLocale } from './common/enUS' export type { NLocale } from './common/enUS'
export type { NDateLocale } from './date/enUS' export type { NDateLocale } from './date/enUS'