@schedule-x/translations
Advanced tools
Comparing version 2.11.0 to 2.12.0
@@ -51,2 +51,4 @@ import { Signal } from "@preact/signals"; | ||
declare const srLatnRS: Language; | ||
declare const caES: Language; | ||
declare const ltLT: Language; | ||
type TranslationVariables = { | ||
@@ -56,3 +58,2 @@ [key: string]: string | number; | ||
declare const translate: (locale: Signal<string>, languages: Record<string, object>) => (key: string, translationVariables?: TranslationVariables) => string; | ||
declare const caES: Language; | ||
declare const translations: { | ||
@@ -86,2 +87,3 @@ deDE: Language; | ||
srRS: Language; | ||
ltLT: Language; | ||
}; | ||
@@ -116,3 +118,4 @@ declare const datePickerTranslations: { | ||
srRS: DatePickerTranslations; | ||
ltLT: DatePickerTranslations; | ||
}; | ||
export { translate, translations, datePickerTranslations, deDE, enUS, itIT, enGB, svSE, zhCN, zhTW, jaJP, ruRU, koKR, frFR, daDK, plPL, esES, mkMK, nlNL, ptBR, skSK, trTR, kyKG, idID, csCZ, etEE, ukUA, caES, srLatnRS }; | ||
export { translate, translations, datePickerTranslations, deDE, enUS, itIT, enGB, svSE, zhCN, zhTW, jaJP, ruRU, koKR, frFR, daDK, plPL, esES, mkMK, nlNL, ptBR, skSK, trTR, kyKG, idID, csCZ, etEE, ukUA, caES, srLatnRS, ltLT }; |
@@ -753,27 +753,2 @@ 'use strict'; | ||
class InvalidLocaleError extends Error { | ||
constructor(locale) { | ||
super(`Invalid locale: ${locale}`); | ||
} | ||
} | ||
const translate = (locale, languages) => (key, translationVariables) => { | ||
if (!/^[a-z]{2}-[A-Z]{2}$/.test(locale.value) && | ||
'sr-Latn-RS' !== locale.value) { | ||
throw new InvalidLocaleError(locale.value); | ||
} | ||
const deHyphenatedLocale = locale.value.replaceAll('-', ''); | ||
const language = languages[deHyphenatedLocale]; | ||
if (!language) | ||
return key; | ||
let translation = language[key] || key; | ||
Object.keys(translationVariables || {}).forEach((variable) => { | ||
const value = String(translationVariables === null || translationVariables === void 0 ? void 0 : translationVariables[variable]); | ||
if (!value) | ||
return; | ||
translation = translation.replace(`{{${variable}}}`, value); | ||
}); | ||
return translation; | ||
}; | ||
const datePickerCaES = { | ||
@@ -839,2 +814,58 @@ Date: 'Data', | ||
const datePickerLtLT = { | ||
Date: 'Data', | ||
'MM/DD/YYYY': 'MMMM-MM-DD', | ||
'Next month': 'Kitas mėnuo', | ||
'Previous month': 'Ankstesnis mėnuo', | ||
'Choose Date': 'Pasirinkite datą', | ||
}; | ||
const calendarLtLT = { | ||
Today: 'Šiandien', | ||
Month: 'Mėnuo', | ||
Week: 'Savaitė', | ||
Day: 'Diena', | ||
'Select View': 'Pasirinkite vaizdą', | ||
events: 'įvykiai', | ||
event: 'įvykis', | ||
'No events': 'Įvykių nėra', | ||
'Next period': 'Kitas laikotarpis', | ||
'Previous period': 'Ankstesnis laikotarpis', | ||
to: 'iki', // as in 2/1/2020 to 2/2/2020 | ||
'Full day- and multiple day events': 'Visos dienos ir kelių dienų įvykiai', | ||
'Link to {{n}} more events on {{date}}': 'Nuoroda į dar {{n}} įvykius {{date}}', | ||
'Link to 1 more event on {{date}}': 'Nuoroda į dar 1 vieną įvykį {{date}}', | ||
}; | ||
const ltLT = { | ||
...datePickerLtLT, | ||
...calendarLtLT, | ||
}; | ||
class InvalidLocaleError extends Error { | ||
constructor(locale) { | ||
super(`Invalid locale: ${locale}`); | ||
} | ||
} | ||
const translate = (locale, languages) => (key, translationVariables) => { | ||
if (!/^[a-z]{2}-[A-Z]{2}$/.test(locale.value) && | ||
'sr-Latn-RS' !== locale.value) { | ||
throw new InvalidLocaleError(locale.value); | ||
} | ||
const deHyphenatedLocale = locale.value.replaceAll('-', ''); | ||
const language = languages[deHyphenatedLocale]; | ||
if (!language) | ||
return key; | ||
let translation = language[key] || key; | ||
Object.keys(translationVariables || {}).forEach((variable) => { | ||
const value = String(translationVariables === null || translationVariables === void 0 ? void 0 : translationVariables[variable]); | ||
if (!value) | ||
return; | ||
translation = translation.replace(`{{${variable}}}`, value); | ||
}); | ||
return translation; | ||
}; | ||
/* eslint-disable max-lines */ | ||
const translations = { | ||
@@ -868,2 +899,3 @@ deDE, | ||
srRS, | ||
ltLT, | ||
}; | ||
@@ -898,2 +930,3 @@ const datePickerTranslations = { | ||
srRS: datePickerSrRS, | ||
ltLT: datePickerLtLT, | ||
}; | ||
@@ -916,2 +949,3 @@ | ||
exports.kyKG = kyKG; | ||
exports.ltLT = ltLT; | ||
exports.mkMK = mkMK; | ||
@@ -918,0 +952,0 @@ exports.nlNL = nlNL; |
@@ -51,2 +51,4 @@ import { Signal } from "@preact/signals"; | ||
declare const srLatnRS: Language; | ||
declare const caES: Language; | ||
declare const ltLT: Language; | ||
type TranslationVariables = { | ||
@@ -56,3 +58,2 @@ [key: string]: string | number; | ||
declare const translate: (locale: Signal<string>, languages: Record<string, object>) => (key: string, translationVariables?: TranslationVariables) => string; | ||
declare const caES: Language; | ||
declare const translations: { | ||
@@ -86,2 +87,3 @@ deDE: Language; | ||
srRS: Language; | ||
ltLT: Language; | ||
}; | ||
@@ -116,3 +118,4 @@ declare const datePickerTranslations: { | ||
srRS: DatePickerTranslations; | ||
ltLT: DatePickerTranslations; | ||
}; | ||
export { translate, translations, datePickerTranslations, deDE, enUS, itIT, enGB, svSE, zhCN, zhTW, jaJP, ruRU, koKR, frFR, daDK, plPL, esES, mkMK, nlNL, ptBR, skSK, trTR, kyKG, idID, csCZ, etEE, ukUA, caES, srLatnRS }; | ||
export { translate, translations, datePickerTranslations, deDE, enUS, itIT, enGB, svSE, zhCN, zhTW, jaJP, ruRU, koKR, frFR, daDK, plPL, esES, mkMK, nlNL, ptBR, skSK, trTR, kyKG, idID, csCZ, etEE, ukUA, caES, srLatnRS, ltLT }; |
@@ -751,27 +751,2 @@ const datePickerDeDE = { | ||
class InvalidLocaleError extends Error { | ||
constructor(locale) { | ||
super(`Invalid locale: ${locale}`); | ||
} | ||
} | ||
const translate = (locale, languages) => (key, translationVariables) => { | ||
if (!/^[a-z]{2}-[A-Z]{2}$/.test(locale.value) && | ||
'sr-Latn-RS' !== locale.value) { | ||
throw new InvalidLocaleError(locale.value); | ||
} | ||
const deHyphenatedLocale = locale.value.replaceAll('-', ''); | ||
const language = languages[deHyphenatedLocale]; | ||
if (!language) | ||
return key; | ||
let translation = language[key] || key; | ||
Object.keys(translationVariables || {}).forEach((variable) => { | ||
const value = String(translationVariables === null || translationVariables === void 0 ? void 0 : translationVariables[variable]); | ||
if (!value) | ||
return; | ||
translation = translation.replace(`{{${variable}}}`, value); | ||
}); | ||
return translation; | ||
}; | ||
const datePickerCaES = { | ||
@@ -837,2 +812,58 @@ Date: 'Data', | ||
const datePickerLtLT = { | ||
Date: 'Data', | ||
'MM/DD/YYYY': 'MMMM-MM-DD', | ||
'Next month': 'Kitas mėnuo', | ||
'Previous month': 'Ankstesnis mėnuo', | ||
'Choose Date': 'Pasirinkite datą', | ||
}; | ||
const calendarLtLT = { | ||
Today: 'Šiandien', | ||
Month: 'Mėnuo', | ||
Week: 'Savaitė', | ||
Day: 'Diena', | ||
'Select View': 'Pasirinkite vaizdą', | ||
events: 'įvykiai', | ||
event: 'įvykis', | ||
'No events': 'Įvykių nėra', | ||
'Next period': 'Kitas laikotarpis', | ||
'Previous period': 'Ankstesnis laikotarpis', | ||
to: 'iki', // as in 2/1/2020 to 2/2/2020 | ||
'Full day- and multiple day events': 'Visos dienos ir kelių dienų įvykiai', | ||
'Link to {{n}} more events on {{date}}': 'Nuoroda į dar {{n}} įvykius {{date}}', | ||
'Link to 1 more event on {{date}}': 'Nuoroda į dar 1 vieną įvykį {{date}}', | ||
}; | ||
const ltLT = { | ||
...datePickerLtLT, | ||
...calendarLtLT, | ||
}; | ||
class InvalidLocaleError extends Error { | ||
constructor(locale) { | ||
super(`Invalid locale: ${locale}`); | ||
} | ||
} | ||
const translate = (locale, languages) => (key, translationVariables) => { | ||
if (!/^[a-z]{2}-[A-Z]{2}$/.test(locale.value) && | ||
'sr-Latn-RS' !== locale.value) { | ||
throw new InvalidLocaleError(locale.value); | ||
} | ||
const deHyphenatedLocale = locale.value.replaceAll('-', ''); | ||
const language = languages[deHyphenatedLocale]; | ||
if (!language) | ||
return key; | ||
let translation = language[key] || key; | ||
Object.keys(translationVariables || {}).forEach((variable) => { | ||
const value = String(translationVariables === null || translationVariables === void 0 ? void 0 : translationVariables[variable]); | ||
if (!value) | ||
return; | ||
translation = translation.replace(`{{${variable}}}`, value); | ||
}); | ||
return translation; | ||
}; | ||
/* eslint-disable max-lines */ | ||
const translations = { | ||
@@ -866,2 +897,3 @@ deDE, | ||
srRS, | ||
ltLT, | ||
}; | ||
@@ -896,4 +928,5 @@ const datePickerTranslations = { | ||
srRS: datePickerSrRS, | ||
ltLT: datePickerLtLT, | ||
}; | ||
export { caES, csCZ, daDK, datePickerTranslations, deDE, enGB, enUS, esES, etEE, frFR, idID, itIT, jaJP, koKR, kyKG, mkMK, nlNL, plPL, ptBR, ruRU, skSK, srLatnRS, svSE, trTR, translate, translations, ukUA, zhCN, zhTW }; | ||
export { caES, csCZ, daDK, datePickerTranslations, deDE, enGB, enUS, esES, etEE, frFR, idID, itIT, jaJP, koKR, kyKG, ltLT, mkMK, nlNL, plPL, ptBR, ruRU, skSK, srLatnRS, svSE, trTR, translate, translations, ukUA, zhCN, zhTW }; |
@@ -51,2 +51,4 @@ import { Signal } from "@preact/signals"; | ||
declare const srLatnRS: Language; | ||
declare const caES: Language; | ||
declare const ltLT: Language; | ||
type TranslationVariables = { | ||
@@ -56,3 +58,2 @@ [key: string]: string | number; | ||
declare const translate: (locale: Signal<string>, languages: Record<string, object>) => (key: string, translationVariables?: TranslationVariables) => string; | ||
declare const caES: Language; | ||
declare const translations: { | ||
@@ -86,2 +87,3 @@ deDE: Language; | ||
srRS: Language; | ||
ltLT: Language; | ||
}; | ||
@@ -116,3 +118,4 @@ declare const datePickerTranslations: { | ||
srRS: DatePickerTranslations; | ||
ltLT: DatePickerTranslations; | ||
}; | ||
export { translate, translations, datePickerTranslations, deDE, enUS, itIT, enGB, svSE, zhCN, zhTW, jaJP, ruRU, koKR, frFR, daDK, plPL, esES, mkMK, nlNL, ptBR, skSK, trTR, kyKG, idID, csCZ, etEE, ukUA, caES, srLatnRS }; | ||
export { translate, translations, datePickerTranslations, deDE, enUS, itIT, enGB, svSE, zhCN, zhTW, jaJP, ruRU, koKR, frFR, daDK, plPL, esES, mkMK, nlNL, ptBR, skSK, trTR, kyKG, idID, csCZ, etEE, ukUA, caES, srLatnRS, ltLT }; |
@@ -757,27 +757,2 @@ (function (global, factory) { | ||
class InvalidLocaleError extends Error { | ||
constructor(locale) { | ||
super(`Invalid locale: ${locale}`); | ||
} | ||
} | ||
const translate = (locale, languages) => (key, translationVariables) => { | ||
if (!/^[a-z]{2}-[A-Z]{2}$/.test(locale.value) && | ||
'sr-Latn-RS' !== locale.value) { | ||
throw new InvalidLocaleError(locale.value); | ||
} | ||
const deHyphenatedLocale = locale.value.replaceAll('-', ''); | ||
const language = languages[deHyphenatedLocale]; | ||
if (!language) | ||
return key; | ||
let translation = language[key] || key; | ||
Object.keys(translationVariables || {}).forEach((variable) => { | ||
const value = String(translationVariables === null || translationVariables === void 0 ? void 0 : translationVariables[variable]); | ||
if (!value) | ||
return; | ||
translation = translation.replace(`{{${variable}}}`, value); | ||
}); | ||
return translation; | ||
}; | ||
const datePickerCaES = { | ||
@@ -843,2 +818,58 @@ Date: 'Data', | ||
const datePickerLtLT = { | ||
Date: 'Data', | ||
'MM/DD/YYYY': 'MMMM-MM-DD', | ||
'Next month': 'Kitas mėnuo', | ||
'Previous month': 'Ankstesnis mėnuo', | ||
'Choose Date': 'Pasirinkite datą', | ||
}; | ||
const calendarLtLT = { | ||
Today: 'Šiandien', | ||
Month: 'Mėnuo', | ||
Week: 'Savaitė', | ||
Day: 'Diena', | ||
'Select View': 'Pasirinkite vaizdą', | ||
events: 'įvykiai', | ||
event: 'įvykis', | ||
'No events': 'Įvykių nėra', | ||
'Next period': 'Kitas laikotarpis', | ||
'Previous period': 'Ankstesnis laikotarpis', | ||
to: 'iki', // as in 2/1/2020 to 2/2/2020 | ||
'Full day- and multiple day events': 'Visos dienos ir kelių dienų įvykiai', | ||
'Link to {{n}} more events on {{date}}': 'Nuoroda į dar {{n}} įvykius {{date}}', | ||
'Link to 1 more event on {{date}}': 'Nuoroda į dar 1 vieną įvykį {{date}}', | ||
}; | ||
const ltLT = { | ||
...datePickerLtLT, | ||
...calendarLtLT, | ||
}; | ||
class InvalidLocaleError extends Error { | ||
constructor(locale) { | ||
super(`Invalid locale: ${locale}`); | ||
} | ||
} | ||
const translate = (locale, languages) => (key, translationVariables) => { | ||
if (!/^[a-z]{2}-[A-Z]{2}$/.test(locale.value) && | ||
'sr-Latn-RS' !== locale.value) { | ||
throw new InvalidLocaleError(locale.value); | ||
} | ||
const deHyphenatedLocale = locale.value.replaceAll('-', ''); | ||
const language = languages[deHyphenatedLocale]; | ||
if (!language) | ||
return key; | ||
let translation = language[key] || key; | ||
Object.keys(translationVariables || {}).forEach((variable) => { | ||
const value = String(translationVariables === null || translationVariables === void 0 ? void 0 : translationVariables[variable]); | ||
if (!value) | ||
return; | ||
translation = translation.replace(`{{${variable}}}`, value); | ||
}); | ||
return translation; | ||
}; | ||
/* eslint-disable max-lines */ | ||
const translations = { | ||
@@ -872,2 +903,3 @@ deDE, | ||
srRS, | ||
ltLT, | ||
}; | ||
@@ -902,2 +934,3 @@ const datePickerTranslations = { | ||
srRS: datePickerSrRS, | ||
ltLT: datePickerLtLT, | ||
}; | ||
@@ -920,2 +953,3 @@ | ||
exports.kyKG = kyKG; | ||
exports.ltLT = ltLT; | ||
exports.mkMK = mkMK; | ||
@@ -922,0 +956,0 @@ exports.nlNL = nlNL; |
{ | ||
"name": "@schedule-x/translations", | ||
"umdName": "SXTranslations", | ||
"version": "2.11.0", | ||
"version": "2.12.0", | ||
"description": "Schedule-X translations", | ||
@@ -31,3 +31,3 @@ "author": { | ||
"homepage": "https://schedule-x.dev", | ||
"gitHead": "d154228a338c99498981804e8a29a975b683203b" | ||
"gitHead": "9b03335534cb96ce6c478fcf796c9ea090536e24" | ||
} |
98373
2939