Files
klz-cables.com/.pnpm-store/v10/files/79/d578e2c9f57271ec68f8c131a00f10f3bbba6b99c91c514350f015b5bbdc064e5dcaaf19d997d700a3f06991115c8398514c912a314535e75575f733fee03b
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

211 lines
4.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["до н.э.", "н.э."],
abbreviated: ["до н. э.", "н. э."],
wide: ["до нашей эры", "нашей эры"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1-й кв.", "2-й кв.", "3-й кв.", "4-й кв."],
wide: ["1-й квартал", "2-й квартал", "3-й квартал", "4-й квартал"],
};
const monthValues = {
narrow: ["Я", "Ф", "М", "А", "М", "И", "И", "А", "С", "О", "Н", "Д"],
abbreviated: [
"янв.",
"фев.",
"март",
"апр.",
"май",
"июнь",
"июль",
"авг.",
"сент.",
"окт.",
"нояб.",
"дек.",
],
wide: [
"январь",
"февраль",
"март",
"апрель",
"май",
"июнь",
"июль",
"август",
"сентябрь",
"октябрь",
"ноябрь",
"декабрь",
],
};
const formattingMonthValues = {
narrow: ["Я", "Ф", "М", "А", "М", "И", "И", "А", "С", "О", "Н", "Д"],
abbreviated: [
"янв.",
"фев.",
"мар.",
"апр.",
"мая",
"июн.",
"июл.",
"авг.",
"сент.",
"окт.",
"нояб.",
"дек.",
],
wide: [
"января",
"февраля",
"марта",
"апреля",
"мая",
"июня",
"июля",
"августа",
"сентября",
"октября",
"ноября",
"декабря",
],
};
const dayValues = {
narrow: ["В", "П", "В", "С", "Ч", "П", "С"],
short: ["вс", "пн", "вт", "ср", "чт", "пт", "сб"],
abbreviated: ["вск", "пнд", "втр", "срд", "чтв", "птн", "суб"],
wide: [
"воскресенье",
"понедельник",
"вторник",
"среда",
"четверг",
"пятница",
"суббота",
],
};
const dayPeriodValues = {
narrow: {
am: "ДП",
pm: "ПП",
midnight: "полн.",
noon: "полд.",
morning: "утро",
afternoon: "день",
evening: "веч.",
night: "ночь",
},
abbreviated: {
am: "ДП",
pm: "ПП",
midnight: "полн.",
noon: "полд.",
morning: "утро",
afternoon: "день",
evening: "веч.",
night: "ночь",
},
wide: {
am: "ДП",
pm: "ПП",
midnight: "полночь",
noon: "полдень",
morning: "утро",
afternoon: "день",
evening: "вечер",
night: "ночь",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "ДП",
pm: "ПП",
midnight: "полн.",
noon: "полд.",
morning: "утра",
afternoon: "дня",
evening: "веч.",
night: "ночи",
},
abbreviated: {
am: "ДП",
pm: "ПП",
midnight: "полн.",
noon: "полд.",
morning: "утра",
afternoon: "дня",
evening: "веч.",
night: "ночи",
},
wide: {
am: "ДП",
pm: "ПП",
midnight: "полночь",
noon: "полдень",
morning: "утра",
afternoon: "дня",
evening: "вечера",
night: "ночи",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
const unit = options?.unit;
let suffix;
if (unit === "date") {
suffix = "-е";
} else if (unit === "week" || unit === "minute" || unit === "second") {
suffix = "-я";
} else {
suffix = "-й";
}
return number + suffix;
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
formattingValues: formattingMonthValues,
defaultFormattingWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "any",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};