Skip to content

Commit

Permalink
add Romansh (Swiss) localization (flatpickr#2980)
Browse files Browse the repository at this point in the history
  • Loading branch information
boris-brtan committed Jan 8, 2024
1 parent 548330e commit b5cec6c
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/l10n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import { Norwegian as no } from "./no";
import { Punjabi as pa } from "./pa";
import { Polish as pl } from "./pl";
import { Portuguese as pt } from "./pt";
import { Romansh as rm } from "./rm";
import { Romanian as ro } from "./ro";
import { Russian as ru } from "./ru";
import { Sinhala as si } from "./si";
Expand Down Expand Up @@ -114,6 +115,7 @@ const l10n: Record<key, CustomLocale> = {
pa,
pl,
pt,
rm,
ro,
ru,
si,
Expand Down
74 changes: 74 additions & 0 deletions src/l10n/rm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/* Romansh (Swiss) locals for flatpickr */
import { CustomLocale } from "../types/locale";
import { FlatpickrFn } from "../types/instance";

const fp =
typeof window !== "undefined" && window.flatpickr !== undefined
? window.flatpickr
: ({
l10ns: {},
} as FlatpickrFn);

export const Romansh: CustomLocale = {
weekdays: {
shorthand: ["Du", "Gli", "Ma", "Me", "Gie", "Ve", "So"],
longhand: [
"Dumengia",
"Glindesdi",
"Mardi",
"Mesemna",
"Gievgia",
"Venderdi",
"Sonda",
],
},
months: {
shorthand: [
"Schan",
"Favr",
"Mars",
"Avr",
"Matg",
"Zercl",
"Fan",
"Avust",
"Sett",
"Oct",
"Nov",
"Dec",
],
longhand: [
"Schaner",
"Favrer",
"Mars",
"Avrigl",
"Matg",
"Zercladur",
"Fanadur",
"Avust",
"Settember",
"October",
"November",
"December",
],
},

firstDayOfWeek: 1,
hourAriaLabel: "Ura",
minuteAriaLabel: "Minuta",
monthAriaLabel: "Mea",
rangeSeparator: " cun ",
scrollTitle: "Scurra per incremar",
time_24hr: true,
toggleTitle: "Chasch cliccar per commutar",
weekAbbreviation: "Em",
yearAriaLabel: "Onn",

ordinal: () => {
return "";
},
};

fp.l10ns.rm = Romansh;

export default fp.l10ns;
1 change: 1 addition & 0 deletions src/types/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export type key =
| "pa"
| "pl"
| "pt"
| "rm"
| "ro"
| "ru"
| "si"
Expand Down

0 comments on commit b5cec6c

Please sign in to comment.