codigo0/node_modules/date-fns/locale/oc/_lib/localize.js
planetazuzu 5d7a6500fe refactor: Fase 1 - Clean Architecture, refactorización modular y eliminación de duplicidades
-  Ticket 1.1: Estructura Clean Architecture en backend
-  Ticket 1.2: Schemas Zod compartidos
-  Ticket 1.3: Refactorización drugs.ts (1362 → 8 archivos modulares)
-  Ticket 1.4: Refactorización procedures.ts (3583 → 6 archivos modulares)
-  Ticket 1.5: Eliminación de duplicidades (~50 líneas)

Cambios principales:
- Creada estructura Clean Architecture en backend/src/
- Schemas Zod compartidos en backend/src/shared/schemas/
- Refactorización modular de drugs y procedures
- Utilidades genéricas en src/utils/ (filter, validation)
- Eliminados scripts obsoletos y documentación antigua
- Corregidos errores: QueryClient, import test-error-handling
- Build verificado y funcionando correctamente
2026-01-25 21:09:47 +01:00

206 lines
3.8 KiB
JavaScript
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.

"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.js");
const eraValues = {
narrow: ["ab. J.C.", "apr. J.C."],
abbreviated: ["ab. J.C.", "apr. J.C."],
wide: ["abans Jèsus-Crist", "après Jèsus-Crist"],
};
const quarterValues = {
narrow: ["T1", "T2", "T3", "T4"],
abbreviated: ["1èr trim.", "2nd trim.", "3en trim.", "4en trim."],
wide: ["1èr trimèstre", "2nd trimèstre", "3en trimèstre", "4en trimèstre"],
};
const monthValues = {
narrow: [
"GN",
"FB",
"MÇ",
"AB",
"MA",
"JN",
"JL",
"AG",
"ST",
"OC",
"NV",
"DC",
],
abbreviated: [
"gen.",
"febr.",
"març",
"abr.",
"mai",
"junh",
"jul.",
"ag.",
"set.",
"oct.",
"nov.",
"dec.",
],
wide: [
"genièr",
"febrièr",
"març",
"abril",
"mai",
"junh",
"julhet",
"agost",
"setembre",
"octòbre",
"novembre",
"decembre",
],
};
const dayValues = {
narrow: ["dg.", "dl.", "dm.", "dc.", "dj.", "dv.", "ds."],
short: ["dg.", "dl.", "dm.", "dc.", "dj.", "dv.", "ds."],
abbreviated: ["dg.", "dl.", "dm.", "dc.", "dj.", "dv.", "ds."],
wide: [
"dimenge",
"diluns",
"dimars",
"dimècres",
"dijòus",
"divendres",
"dissabte",
],
};
const dayPeriodValues = {
narrow: {
am: "am",
pm: "pm",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "matin",
afternoon: "aprèp-miègjorn",
evening: "vèspre",
night: "nuèch",
},
abbreviated: {
am: "a.m.",
pm: "p.m.",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "matin",
afternoon: "aprèp-miègjorn",
evening: "vèspre",
night: "nuèch",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "matin",
afternoon: "aprèp-miègjorn",
evening: "vèspre",
night: "nuèch",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "am",
pm: "pm",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "del matin",
afternoon: "de laprèp-miègjorn",
evening: "del ser",
night: "de la nuèch",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "del matin",
afternoon: "de laprèp-miègjorn",
evening: "del ser",
night: "de la nuèch",
},
wide: {
am: "ante meridiem",
pm: "post meridiem",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "del matin",
afternoon: "de laprèp-miègjorn",
evening: "del ser",
night: "de la nuèch",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
const unit = options?.unit;
let ordinal;
switch (number) {
case 1:
ordinal = "èr";
break;
case 2:
ordinal = "nd";
break;
default:
ordinal = "en";
}
// feminine for year, week, hour, minute, second
if (
unit === "year" ||
unit === "week" ||
unit === "hour" ||
unit === "minute" ||
unit === "second"
) {
ordinal += "a";
}
return number + ordinal;
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});