Skip to content

Commit

Permalink
feat(i18n): add frFR locale (#1753)
Browse files Browse the repository at this point in the history
Co-authored-by: 07akioni <07akioni2@gmail.com>
  • Loading branch information
XieZongChen and 07akioni authored Dec 6, 2021
1 parent ebb70d8 commit 6264acf
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# CHANGELOG


## Pending

### Fixes

- Fix `n-input` click clear icon does't trigger `change` event, closes [#1754](https://agithub.com/TuSimple/naive-ui/issues/1754).

### i18n

- add frFR locale.

## 2.21.4 (2021-12-06)

### Fixes
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- 修复 `n-input` 点击清除按钮时不触发 `change` 事件,关闭 [#1754](https://agithub.com/TuSimple/naive-ui/issues/1754)

### i18n

- 新增 frFR locale

## 2.21.4 (2021-12-06)

### Fixes
Expand Down
1 change: 1 addition & 0 deletions demo/pages/docs/i18n/enUS/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ PR is welcomed for locales that is not supported yet!
| Chinese (Simplified) | enUS | dateEnUS |
| German - Germany | deDE | dateDeDe |
| Norwegian Bokmål (Norway) | nbNO | dateNbNO |
| French | frFR | dateFrFR |

## Customize the existing locale

Expand Down
1 change: 1 addition & 0 deletions demo/pages/docs/i18n/zhCN/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Naive-ui 通过使用 `n-config-provider` 调整语言,默认情况下所有
| 印度尼西亚 | idID | dateIdID |
| 德语 | deDE | dateDeDe |
| 书面挪威语 | nbNO | dateNbNO |
| 法语 | frFR | dateFrFR |

## 在现有国际化基础上调整

Expand Down
98 changes: 98 additions & 0 deletions src/locales/common/frFR.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import type { NLocale } from './enUS'

const frFR: NLocale = {
name: 'fr-FR',
global: {
undo: 'Défaire',
redo: 'Refaire',
confirm: 'Confirmer'
},
Popconfirm: {
positiveText: 'Confirmer',
negativeText: 'Annuler'
},
Cascader: {
placeholder: 'Sélectionner',
loading: 'Chargement',
loadingRequiredMessage: (label: string): string =>
`Charger tous les enfants de ${label} avant de le sélectionner`
},
Time: {
dateFormat: 'dd-MM-yyyy',
dateTimeFormat: 'dd-MM-yyyy HH:mm:ss'
},
DatePicker: {
yearFormat: 'yyyy',
monthFormat: 'MMM',
dayFormat: 'eeeeee',
clear: 'Effacer',
now: 'Maintenant',
confirm: 'Confirmer',
selectTime: "Sélectionner l'heure",
selectDate: 'Sélectionner la date',
datePlaceholder: 'Sélectionner la date',
datetimePlaceholder: "Sélectionner la date et l'heure",
monthPlaceholder: 'Sélectionner le mois',
yearPlaceholder: "Sélectionner l'année",
startDatePlaceholder: 'Date de début',
endDatePlaceholder: 'Date de fin',
startDatetimePlaceholder: 'Date et heure de début',
endDatetimePlaceholder: 'Date et heure de fin',
monthBeforeYear: true,
firstDayOfWeek: 1,
today: "Aujourd'hui"
},
DataTable: {
checkTableAll: 'Sélectionner tout',
uncheckTableAll: 'Désélectionner tout',
confirm: 'Confirmer',
clear: 'Effacer'
},
Transfer: {
sourceTitle: 'Source',
targetTitle: 'Cible'
},
Empty: {
description: 'Aucune donnée'
},
Select: {
placeholder: 'Sélectionner'
},
TimePicker: {
placeholder: "Sélectionner l'heure",
positiveText: 'OK',
negativeText: 'Annuler',
now: 'Maintenant'
},
Pagination: {
goto: 'Aller à',
selectionSuffix: 'page'
},
DynamicTags: {
add: 'Ajouter'
},
Log: {
loading: 'Chargement'
},
Input: {
placeholder: 'Saisir'
},
InputNumber: {
placeholder: 'Saisir'
},
DynamicInput: {
create: 'Créer'
},
ThemeEditor: {
title: 'Editeur de thème',
clearAllVars: 'Effacer toutes les variables',
clearSearch: 'Effacer la recherche',
filterCompName: 'Filtrer par nom de composant',
filterVarName: 'Filtrer par nom de variable',
import: 'Importer',
export: 'Exporter',
restore: 'Réinitialiser'
}
}

export default frFR
9 changes: 9 additions & 0 deletions src/locales/date/frFR.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import frFR from 'date-fns/locale/fr'
import { NDateLocale } from './enUS'

const dateFrFR: NDateLocale = {
name: 'fr-FR',
locale: frFR
}

export default dateFrFR
10 changes: 10 additions & 0 deletions src/locales/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
idID,
deDE,
nbNO,
frFR,
dateEnUS,
dateZhCN,
dateRuRU,
Expand All @@ -17,6 +18,7 @@ import {
dateIdID,
dateDeDE,
dateNbNO,
dateFrFR,
NConfigProvider,
NDateLocale,
NLocale,
Expand Down Expand Up @@ -118,5 +120,13 @@ describe('locale', () => {
}
}).html()
).toMatchSnapshot()
expect(
mount(Wrapper, {
props: {
dateLocale: dateFrFR,
locale: frFR
}
}).html()
).toMatchSnapshot()
})
})
2 changes: 2 additions & 0 deletions src/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export { default as jaJP } from './common/jaJP'
export { default as idID } from './common/idID'
export { default as deDE } from './common/deDE'
export { default as nbNO } from './common/nbNO'
export { default as frFR } from './common/frFR'
export { default as dateZhCN } from './date/zhCN'
export { default as dateEnUS } from './date/enUS'
export { default as dateRuRU } from './date/ruRU'
Expand All @@ -14,6 +15,7 @@ export { default as dateJaJP } from './date/jaJP'
export { default as dateIdID } from './date/idID'
export { default as dateDeDE } from './date/deDE'
export { default as dateNbNO } from './date/nbNO'
export { default as dateFrFR } from './date/frFR'
export type { NLocale } from './common/enUS'
export type { NDateLocale } from './date/enUS'
export type { NPartialLocale } from './utils/index'
Expand Down

0 comments on commit 6264acf

Please sign in to comment.