Skip to content

Commit

Permalink
Merge pull request #1552 from kintone-labs/SSR-4406_Enable-Spanish-in…
Browse files Browse the repository at this point in the history
…-components

SSR-4406: fix days of calendar in Spanish and Traditional Chinese
  • Loading branch information
dong0 authored Oct 10, 2024
2 parents 1037722 + 154352a commit c18d4e5
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 24 deletions.
3 changes: 3 additions & 0 deletions src/base/datetime/calendar/body/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ kuc-base-datetime-calendar-body:lang(es) * {
:lang(ja) th.kuc-base-datetime-calendar-body__table__header {
font-weight: 700;
}
:lang(es) th.kuc-base-datetime-calendar-body__table__header {
text-transform: revert;
}
.kuc-base-datetime-calendar-body__table__date--selected,
.kuc-base-datetime-calendar-body__table__date,
.kuc-base-datetime-calendar-body__table__header {
Expand Down
4 changes: 2 additions & 2 deletions src/base/datetime/calendar/body/test/language.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ describe("BaseDateTimeCalendarBody", () => {
expect(item.innerText).to.equal("周日");
});

it('The first day of the week in Spanish is "SUN" when not assigning language prop', async () => {
it('The first day of the week in Spanish is "Do." when not assigning language prop', async () => {
const container = new BaseDateTimeCalendarBody();
container.language = "es";
const el = await fixture(container);
const item = el.querySelector(
".kuc-base-datetime-calendar-body__table__header",
) as HTMLTableSectionElement;
expect(item.innerText).to.equal("SUN");
expect(item.innerText).to.equal("Do.");
});
});
});
4 changes: 2 additions & 2 deletions src/base/datetime/calendar/test/language.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ describe("BaseDateTimeCalendar", () => {
"KUC-BASE-DATETIME-HEADER-MONTH",
);
expect(yearEl.textContent).to.contain("年");
expect(bodyWeekDayEl.innerText).to.equal("周日");
expect(bodyWeekDayEl.innerText).to.equal("週日");
expect(footerButtonTodayEl.innerText).to.equal("今天");
expect(footerButtonNoneEl.innerText).to.equal("清空");
});
Expand Down Expand Up @@ -149,7 +149,7 @@ describe("BaseDateTimeCalendar", () => {
expect(headerCenterEl.children[1].tagName).to.equal(
"KUC-BASE-DATETIME-HEADER-YEAR",
);
expect(bodyWeekDayEl.innerText).to.equal("SUN");
expect(bodyWeekDayEl.innerText).to.equal("Do.");
expect(footerButtonTodayEl.innerText).to.equal("Hoy");
expect(footerButtonNoneEl.innerText).to.equal("Ninguno");
});
Expand Down
8 changes: 4 additions & 4 deletions src/base/datetime/mobile-calendar/body/test/language.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ describe("BaseMobileDateTimeCalendarBody", () => {
expect(item.innerText).to.equal("日");
});

it('The first day of the week in Traditional Chinese is "周日" when not assigning language prop', async () => {
it('The first day of the week in Traditional Chinese is "週日" when not assigning language prop', async () => {
const container = new BaseMobileDateTimeCalendarBody();
container.language = "zh-TW";
const el = await fixture(container);
const item = el.querySelector(
".kuc-base-mobile-datetime-calendar-body__table__header",
) as HTMLTableSectionElement;
expect(item.innerText).to.equal("周日");
expect(item.innerText).to.equal("週日");
});
it('The first day of the week in Chinese is "周日" when not assigning language prop', async () => {
const container = new BaseMobileDateTimeCalendarBody();
Expand All @@ -61,14 +61,14 @@ describe("BaseMobileDateTimeCalendarBody", () => {
) as HTMLTableSectionElement;
expect(item.innerText).to.equal("周日");
});
it('The first day of the week in Spanish is "SUN" when not assigning language prop', async () => {
it('The first day of the week in Spanish is "Do." when not assigning language prop', async () => {
const container = new BaseMobileDateTimeCalendarBody();
container.language = "es";
const el = await fixture(container);
const item = el.querySelector(
".kuc-base-mobile-datetime-calendar-body__table__header",
) as HTMLTableSectionElement;
expect(item.innerText).to.equal("SUN");
expect(item.innerText).to.equal("Do.");
});
});
});
4 changes: 2 additions & 2 deletions src/base/datetime/mobile-calendar/test/language.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ describe("BaseMobileDateTimeCalendar", () => {
),
).to.equal(true);
expect(yearEl.textContent).to.contain("年");
expect(bodyWeekDayEl.innerText).to.equal("周日");
expect(bodyWeekDayEl.innerText).to.equal("週日");
expect(footerButtonTodayEl.innerText).to.equal("今天");
expect(footerButtonNoneEl.innerText).to.equal("清空");
expect(footerButtonCloseEl.innerText).to.equal("關閉");
Expand Down Expand Up @@ -172,7 +172,7 @@ describe("BaseMobileDateTimeCalendar", () => {
"kuc-base-mobile-datetime-calendar-header__group__center__year",
),
).to.equal(true);
expect(bodyWeekDayEl.innerText).to.equal("SUN");
expect(bodyWeekDayEl.innerText).to.equal("Do.");
expect(footerButtonTodayEl.innerText).to.equal("Hoy");
expect(footerButtonNoneEl.innerText).to.equal("Ninguno");
expect(footerButtonCloseEl.innerText).to.equal("Cerrar");
Expand Down
28 changes: 14 additions & 14 deletions src/base/datetime/resource/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ export const zh_TW = {
],
YEAR_SELECT_POSTFIX: "年",
WEEK_DAYS: [
{ text: "周日", abbr: "周日" },
{ text: "周一", abbr: "周一" },
{ text: "周二", abbr: "周二" },
{ text: "周三", abbr: "周三" },
{ text: "周四", abbr: "周四" },
{ text: "周五", abbr: "周五" },
{ text: "周六", abbr: "周六" },
{ text: "週日", abbr: "週日" },
{ text: "週一", abbr: "週一" },
{ text: "週二", abbr: "週二" },
{ text: "週三", abbr: "週三" },
{ text: "週四", abbr: "週四" },
{ text: "週五", abbr: "週五" },
{ text: "週六", abbr: "週六" },
],
INVALID_FORMAT: "日期格式錯誤。",
INVALID_TIME_FORMAT: "時間格式錯誤。",
Expand All @@ -139,13 +139,13 @@ export const es = {
],
YEAR_SELECT_POSTFIX: "",
WEEK_DAYS: [
{ text: "SUN", abbr: "Sunday" },
{ text: "MON", abbr: "Monday" },
{ text: "TUE", abbr: "Tuesday" },
{ text: "WED", abbr: "Wednesday" },
{ text: "THU", abbr: "Thursday" },
{ text: "FRI", abbr: "Friday" },
{ text: "SAT", abbr: "Saturday" },
{ text: "Do.", abbr: "Domingo" },
{ text: "Lu.", abbr: "Lunes" },
{ text: "Ma.", abbr: "Martes" },
{ text: "Mi.", abbr: "Miércoles" },
{ text: "Ju.", abbr: "Jueves" },
{ text: "Vi.", abbr: "Viernes" },
{ text: "Sá.", abbr: "Sábado" },
],
INVALID_FORMAT: "Formato no válido.",
INVALID_TIME_FORMAT: "Formato no válido.",
Expand Down

0 comments on commit c18d4e5

Please sign in to comment.