Skip to content

Commit

Permalink
Added Czech localization; fixed some Slovak terms (#5733)
Browse files Browse the repository at this point in the history
Co-authored-by: 07akioni <07akioni2@gmail.com>
  • Loading branch information
jakubhruby and 07akioni authored Mar 11, 2024
1 parent f937d85 commit b7ae0d8
Show file tree
Hide file tree
Showing 8 changed files with 170 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ yarn.lock
.DS_Store
.vscode
.idea
.pulsar
*.swp
*.tgz
coverage
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## NEXT_VERSION

### i18n

- Add csCZ locale.

### Fixes

- Fix `n-tabs` style bug with type is `segment`,closes [#5728](https://github.com/tusen-ai/naive-ui/issues/5728)
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## NEXT_VERSION

### i18n

- Add csCZ locale.

### Fixes

- 修复 `n-tabs` type 为 `segment` 时样式存在问题,closes [#5728](https://github.com/tusen-ai/naive-ui/issues/5728)
Expand Down
128 changes: 128 additions & 0 deletions src/locales/common/csCZ.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import type { NLocale } from './enUS'

const csCZ: NLocale = {
name: 'cs-CZ',
global: {
undo: 'Zpět',
redo: 'Obnovit',
confirm: 'Potvrdit',
clear: 'Vyčistit'
},
Popconfirm: {
positiveText: 'Potvrdit',
negativeText: 'Zrušit'
},
Cascader: {
placeholder: 'Prosím vyberte',
loading: 'Načítání',
loadingRequiredMessage: (label: string): string =>
`Prosím načtěte před kontrolou všechny potomky pro ${label}.`
},
Time: {
dateFormat: 'd-M-yyyy',
dateTimeFormat: 'd-M-yyyy HH:mm:ss'
},
DatePicker: {
yearFormat: 'yyyy',
monthFormat: 'MMM',
dayFormat: 'EEEE',
yearTypeFormat: 'yyyy',
monthTypeFormat: 'MMM-yyyy',
dateFormat: 'd-M-yyyy',
dateTimeFormat: 'd-M-yyyy HH:mm:ss',
quarterFormat: 'qqq-yyyy',
weekFormat: 'yyyy-w',
clear: 'Vyčistit',
now: 'Teď',
confirm: 'Potvrdit',
selectTime: 'Vybrat čas',
selectDate: 'Vybrat datum',
datePlaceholder: 'Vyberte čas',
datetimePlaceholder: 'Vyberte datum a čas',
monthPlaceholder: 'Vyberte měsíc',
yearPlaceholder: 'Vyberte rok',
quarterPlaceholder: 'Vyberte čtvrtletí',
weekPlaceholder: 'Vyberte týden',
startDatePlaceholder: 'Datum začátku',
endDatePlaceholder: 'Datum ukončení',
startDatetimePlaceholder: 'Datum a čas začátku',
endDatetimePlaceholder: 'Datum a čas ukončení ',
startMonthPlaceholder: 'Začátek měsíce',
endMonthPlaceholder: 'Konec měsíce',
monthBeforeYear: true,
firstDayOfWeek: 6 as 0 | 1 | 2 | 3 | 4 | 5 | 6,
today: 'Dnes'
},
DataTable: {
checkTableAll: 'Vybrat vše v tabulce',
uncheckTableAll: 'Zrušit výběr všeho v tabulce ',
confirm: 'Potvrdit',
clear: 'Vyčistit'
},
LegacyTransfer: {
sourceTitle: 'Zdroj',
targetTitle: 'Cíl'
},
Transfer: {
selectAll: 'Vybrat vše',
unselectAll: 'Odznačit vše',
clearAll: 'Vyčistit',
total: (num: number): string => `Celkem ${num} položek`,
selected: (num: number): string => `${num} položek vybráno`
},
Empty: {
description: 'Žádná data'
},
Select: {
placeholder: 'Prosím vyberte'
},
TimePicker: {
placeholder: 'Vybrat čas',
positiveText: 'OK',
negativeText: 'Zrušit',
now: 'Teď',
clear: 'Vyčistit'
},
Pagination: {
goto: 'Jít na',
selectionSuffix: 'Strana'
},
DynamicTags: {
add: 'Přidat'
},
Log: {
loading: 'Načítání'
},
Input: {
placeholder: 'Zadejte'
},
InputNumber: {
placeholder: 'Zadejte'
},
DynamicInput: {
create: 'Vytvořit'
},
ThemeEditor: {
title: 'Editor témat',
clearAllVars: 'Vymazat všechny proměnné',
clearSearch: 'Vymazat vyhledávání',
filterCompName: 'Filtrovat název komponenty',
filterVarName: 'Filztrovat název proměnné',
import: 'Importovat',
export: 'Exportovat',
restore: 'Obnovit původní nastavení'
},
Image: {
tipPrevious: 'Předchozí obrázek (←)',
tipNext: 'Další obrázek (→)',
tipCounterclockwise: 'Proti směru hodinových ručiček',
tipClockwise: 'Ve směru hodinových ručiček',
tipZoomOut: 'Oddálit',
tipZoomIn: 'Přiblížit',
tipDownload: 'Stáhnout',
tipClose: 'Zavřít (Esc)',
tipOriginalSize: 'Přiblížit na původní velikost'
}
}

export default csCZ
28 changes: 12 additions & 16 deletions src/locales/common/skSK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,13 @@ const skSK: NLocale = {
monthPlaceholder: 'Vyberte mesiac',
yearPlaceholder: 'Vyberte rok',
quarterPlaceholder: 'Vyberte štvrťrok',
weekPlaceholder: 'Select Week',
weekPlaceholder: 'Vyberte týždeň',
startDatePlaceholder: 'Dátum začiatku',
endDatePlaceholder: 'Dátum ukončenia',
startDatetimePlaceholder: 'Dátum a čas začiatku',
endDatetimePlaceholder: 'Dátum a čas ukončenia ',
// FIXME: translation needed
startMonthPlaceholder: 'Start Month',
endMonthPlaceholder: 'End Month',
startMonthPlaceholder: 'Začiatok mesiaca',
endMonthPlaceholder: 'Koniec mesiaca',
monthBeforeYear: true,
firstDayOfWeek: 6 as 0 | 1 | 2 | 3 | 4 | 5 | 6,
today: 'Dnes'
Expand All @@ -64,13 +63,12 @@ const skSK: NLocale = {
sourceTitle: 'Zdroj',
targetTitle: 'Cieľ'
},
// TODO: translation
Transfer: {
selectAll: 'Select all',
unselectAll: 'Unselect all',
clearAll: 'Clear',
total: (num: number): string => `Total ${num} items`,
selected: (num: number): string => `${num} items selected`
selectAll: 'Vybrať všetko',
unselectAll: 'odznačiť všetko',
clearAll: 'Vyčistiť',
total: (num: number): string => `Celkom ${num} položiek`,
selected: (num: number): string => `Vybratých ${num} položiek`
},
Empty: {
description: 'Žiadne dáta'
Expand All @@ -86,7 +84,7 @@ const skSK: NLocale = {
clear: 'Vyčistiť'
},
Pagination: {
goto: 'Ísť',
goto: 'Ísť na',
selectionSuffix: 'Strana'
},
DynamicTags: {
Expand All @@ -108,13 +106,12 @@ const skSK: NLocale = {
title: 'Editor tém',
clearAllVars: 'Vymazať všetky premenné',
clearSearch: 'Vymazať vyhľadávanie',
filterCompName: 'Názov komponentu filtra',
filterVarName: 'Názov premennej filtra',
filterCompName: 'Filtrovať názov komponentu',
filterVarName: 'Filtrovať názov premennej',
import: 'Importovať',
export: 'Exportovať',
restore: 'Obnoviť pôvodné nastavenia'
},
// TODO: translation
Image: {
tipPrevious: 'Predchádzajúci obrázok (←)',
tipNext: 'Ďalší obrázok (→)',
Expand All @@ -124,8 +121,7 @@ const skSK: NLocale = {
tipZoomIn: 'Priblížiť',
tipDownload: 'Sťahovať',
tipClose: 'Zavrieť (Esc)',
// TODO: translation
tipOriginalSize: 'Zoom to original size'
tipOriginalSize: 'Priblížiť na pôvodnú veľkosť'
}
}

Expand Down
9 changes: 9 additions & 0 deletions src/locales/date/csCZ.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import cs from 'date-fns/esm/locale/cs'
import { type NDateLocale } from './enUS'

const dateCsCZ: NDateLocale = {
name: 'cs-CZ',
locale: cs
}

export default dateCsCZ
10 changes: 10 additions & 0 deletions src/locales/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
esAR,
itIT,
skSK,
csCZ,
enGB,
plPL,
ptBR,
Expand All @@ -41,6 +42,7 @@ import {
dateEsAR,
dateItIT,
dateSkSK,
dateCsCZ,
dateEnGB,
datePlPL,
datePtBR,
Expand Down Expand Up @@ -274,6 +276,14 @@ describe('locale', () => {
}
}).html()
).toMatchSnapshot()
expect(
mount(Wrapper, {
props: {
dateLocale: dateCsCZ,
locale: csCZ
}
}).html()
).toMatchSnapshot()
expect(
mount(Wrapper, {
props: {
Expand Down
2 changes: 2 additions & 0 deletions src/locales/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export { default as frFR } from './common/frFR'
export { default as esAR } from './common/esAR'
export { default as itIT } from './common/itIT'
export { default as skSK } from './common/skSK'
export { default as csCZ } from './common/csCZ'
export { default as enGB } from './common/enGB'
export { default as plPL } from './common/plPL'
export { default as ptBR } from './common/ptBR'
Expand All @@ -39,6 +40,7 @@ export { default as dateFrFR } from './date/frFR'
export { default as dateEsAR } from './date/esAR'
export { default as dateItIT } from './date/itIT'
export { default as dateSkSK } from './date/skSK'
export { default as dateCsCZ } from './date/csCZ'
export { default as dateEnGB } from './date/enGB'
export { default as datePlPL } from './date/plPL'
export { default as datePtBR } from './date/ptBR'
Expand Down

0 comments on commit b7ae0d8

Please sign in to comment.