@schedule-x/date-picker
Advanced tools
Comparing version 1.48.0 to 1.49.0
@@ -1069,2 +1069,4 @@ 'use strict'; | ||
'Full day- and multiple day events': 'Ganztägige und mehrtägige Ereignisse', | ||
'Link to {{n}} more events on {{date}}': 'Link zu {{n}} weiteren Ereignissen am {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link zu 1 weiteren Ereignis am {{date}}', | ||
}; | ||
@@ -1098,2 +1100,4 @@ | ||
'Full day- and multiple day events': 'Full day- and multiple day events', | ||
'Link to {{n}} more events on {{date}}': 'Link to {{n}} more events on {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link to 1 more event on {{date}}', | ||
}; | ||
@@ -1127,2 +1131,4 @@ | ||
'Full day- and multiple day events': 'Eventi della giornata e plurigiornalieri', | ||
'Link to {{n}} more events on {{date}}': 'Link a {{n}} eventi in più il {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link a 1 evento in più il {{date}}', | ||
}; | ||
@@ -1156,2 +1162,4 @@ | ||
'Full day- and multiple day events': 'Full day- and multiple day events', | ||
'Link to {{n}} more events on {{date}}': 'Link to {{n}} more events on {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link to 1 more event on {{date}}', | ||
}; | ||
@@ -1185,2 +1193,4 @@ | ||
'Full day- and multiple day events': 'Heldags- och flerdagshändelser', | ||
'Link to {{n}} more events on {{date}}': 'Länk till {{n}} fler händelser den {{date}}', | ||
'Link to 1 more event on {{date}}': 'Länk till 1 händelse till den {{date}}', | ||
}; | ||
@@ -1214,2 +1224,4 @@ | ||
'Full day- and multiple day events': '全天和多天活动', | ||
'Link to {{n}} more events on {{date}}': '链接到{{date}}上的{{n}}个更多活动', | ||
'Link to 1 more event on {{date}}': '链接到{{date}}上的1个更多活动', | ||
}; | ||
@@ -1243,2 +1255,4 @@ | ||
'Full day- and multiple day events': '終日および複数日イベント', | ||
'Link to {{n}} more events on {{date}}': '{{date}} に{{n}}件のイベントへのリンク', | ||
'Link to 1 more event on {{date}}': '{{date}} に1件のイベントへのリンク', | ||
}; | ||
@@ -1272,2 +1286,4 @@ | ||
'Full day- and multiple day events': 'События на целый день и несколько дней подряд', | ||
'Link to {{n}} more events on {{date}}': 'Ссылка на {{n}} дополнительных событий на {{date}}', | ||
'Link to 1 more event on {{date}}': 'Ссылка на 1 дополнительное событие на {{date}}', | ||
}; | ||
@@ -1301,2 +1317,4 @@ | ||
'Full day- and multiple day events': '종일 및 복수일 일정', | ||
'Link to {{n}} more events on {{date}}': '{{date}}에 {{n}}개 이상의 이벤트로 이동', | ||
'Link to 1 more event on {{date}}': '{{date}}에 1개 이상의 이벤트로 이동', | ||
}; | ||
@@ -1330,2 +1348,4 @@ | ||
'Full day- and multiple day events': "Événements d'une ou plusieurs journées", | ||
'Link to {{n}} more events on {{date}}': 'Lien vers {{n}} autres événements le {{date}}', | ||
'Link to 1 more event on {{date}}': 'Lien vers 1 autre événement le {{date}}', | ||
}; | ||
@@ -1359,2 +1379,4 @@ | ||
'Full day- and multiple day events': 'Heldagsbegivenheder og flerdagsbegivenheder', | ||
'Link to {{n}} more events on {{date}}': 'Link til {{n}} flere begivenheder den {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link til 1 mere begivenhed den {{date}}', | ||
}; | ||
@@ -1388,2 +1410,4 @@ | ||
'Full day- and multiple day events': 'Wydarzenia całodniowe i wielodniowe', | ||
'Link to {{n}} more events on {{date}}': 'Link do {{n}} kolejnych wydarzeń w dniu {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link do 1 kolejnego wydarzenia w dniu {{date}}', | ||
}; | ||
@@ -1417,2 +1441,4 @@ | ||
'Full day- and multiple day events': 'Día completo y eventos de múltiples días', | ||
'Link to {{n}} more events on {{date}}': 'Enlace a {{n}} eventos más el {{date}}', | ||
'Link to 1 more event on {{date}}': 'Enlace a 1 evento más el {{date}}', | ||
}; | ||
@@ -1437,2 +1463,4 @@ | ||
'Full day- and multiple day events': 'Evenementen van een hele dag en meerdere dagen', | ||
'Link to {{n}} more events on {{date}}': 'Link naar {{n}} meer evenementen op {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link naar 1 meer evenement op {{date}}', | ||
}; | ||
@@ -1475,2 +1503,4 @@ | ||
'Full day- and multiple day events': 'Dia inteiro e eventos de vários dias', | ||
'Link to {{n}} more events on {{date}}': 'Link para mais {{n}} eventos em {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link para mais 1 evento em {{date}}', | ||
}; | ||
@@ -1504,2 +1534,4 @@ | ||
'Full day- and multiple day events': 'Celodenné a viacdňové udalosti', | ||
'Link to {{n}} more events on {{date}}': 'Odkaz na {{n}} ďalších udalostí dňa {{date}}', | ||
'Link to 1 more event on {{date}}': 'Odkaz na 1 ďalšiu udalosť dňa {{date}}', | ||
}; | ||
@@ -1533,2 +1565,4 @@ | ||
'Full day- and multiple day events': 'Целодневни и повеќедневни настани', | ||
'Link to {{n}} more events on {{date}}': 'Линк до {{n}} повеќе настани на {{date}}', | ||
'Link to 1 more event on {{date}}': 'Линк до 1 повеќе настан на {{date}}', | ||
}; | ||
@@ -1562,2 +1596,4 @@ | ||
'Full day- and multiple day events': 'Tüm gün ve çoklu gün etkinlikleri', | ||
'Link to {{n}} more events on {{date}}': '{{date}} tarihinde {{n}} etkinliğe bağlantı', | ||
'Link to 1 more event on {{date}}': '{{date}} tarihinde 1 etkinliğe bağlantı', | ||
}; | ||
@@ -1591,2 +1627,4 @@ | ||
'Full day- and multiple day events': 'Күн бою жана бир нече күн катары менен болгон окуялар', | ||
'Link to {{n}} more events on {{date}}': '{{date}} күнүндө {{n}} окуяга байланыш', | ||
'Link to 1 more event on {{date}}': '{{date}} күнүндө 1 окуяга байланыш', | ||
}; | ||
@@ -1620,2 +1658,4 @@ | ||
'Full day- and multiple day events': 'Sepanjang hari dan acara beberapa hari ', | ||
'Link to {{n}} more events on {{date}}': 'Tautan ke {{n}} acara lainnya pada {{date}}', | ||
'Link to 1 more event on {{date}}': 'Tautan ke 1 acara lainnya pada {{date}}', | ||
}; | ||
@@ -1649,2 +1689,4 @@ | ||
'Full day- and multiple day events': 'Celodenní a vícedenní události', | ||
'Link to {{n}} more events on {{date}}': 'Odkaz na {{n}} dalších událostí dne {{date}}', | ||
'Link to 1 more event on {{date}}': 'Odkaz na 1 další událost dne {{date}}', | ||
}; | ||
@@ -1663,3 +1705,3 @@ | ||
const translate = (locale, languages) => (key) => { | ||
const translate = (locale, languages) => (key, translationVariables) => { | ||
if (!/^[a-z]{2}-[A-Z]{2}$/.test(locale)) | ||
@@ -1671,3 +1713,10 @@ throw new InvalidLocaleError(locale); | ||
return key; | ||
return language[key] || 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; | ||
}; | ||
@@ -1674,0 +1723,0 @@ |
@@ -83,3 +83,6 @@ import { Signal } from "@preact/signals"; | ||
} | ||
type TranslateFn = (key: string) => string; | ||
type TranslationVariables = { | ||
[key: string]: string | number; | ||
}; | ||
type TranslateFn = (key: string, variables?: TranslationVariables) => string; | ||
/** | ||
@@ -86,0 +89,0 @@ * This interface serves as a bridge between the AppSingleton for the date picker and calendar |
@@ -1069,2 +1069,4 @@ 'use strict'; | ||
'Full day- and multiple day events': 'Ganztägige und mehrtägige Ereignisse', | ||
'Link to {{n}} more events on {{date}}': 'Link zu {{n}} weiteren Ereignissen am {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link zu 1 weiteren Ereignis am {{date}}', | ||
}; | ||
@@ -1098,2 +1100,4 @@ | ||
'Full day- and multiple day events': 'Full day- and multiple day events', | ||
'Link to {{n}} more events on {{date}}': 'Link to {{n}} more events on {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link to 1 more event on {{date}}', | ||
}; | ||
@@ -1127,2 +1131,4 @@ | ||
'Full day- and multiple day events': 'Eventi della giornata e plurigiornalieri', | ||
'Link to {{n}} more events on {{date}}': 'Link a {{n}} eventi in più il {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link a 1 evento in più il {{date}}', | ||
}; | ||
@@ -1156,2 +1162,4 @@ | ||
'Full day- and multiple day events': 'Full day- and multiple day events', | ||
'Link to {{n}} more events on {{date}}': 'Link to {{n}} more events on {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link to 1 more event on {{date}}', | ||
}; | ||
@@ -1185,2 +1193,4 @@ | ||
'Full day- and multiple day events': 'Heldags- och flerdagshändelser', | ||
'Link to {{n}} more events on {{date}}': 'Länk till {{n}} fler händelser den {{date}}', | ||
'Link to 1 more event on {{date}}': 'Länk till 1 händelse till den {{date}}', | ||
}; | ||
@@ -1214,2 +1224,4 @@ | ||
'Full day- and multiple day events': '全天和多天活动', | ||
'Link to {{n}} more events on {{date}}': '链接到{{date}}上的{{n}}个更多活动', | ||
'Link to 1 more event on {{date}}': '链接到{{date}}上的1个更多活动', | ||
}; | ||
@@ -1243,2 +1255,4 @@ | ||
'Full day- and multiple day events': '終日および複数日イベント', | ||
'Link to {{n}} more events on {{date}}': '{{date}} に{{n}}件のイベントへのリンク', | ||
'Link to 1 more event on {{date}}': '{{date}} に1件のイベントへのリンク', | ||
}; | ||
@@ -1272,2 +1286,4 @@ | ||
'Full day- and multiple day events': 'События на целый день и несколько дней подряд', | ||
'Link to {{n}} more events on {{date}}': 'Ссылка на {{n}} дополнительных событий на {{date}}', | ||
'Link to 1 more event on {{date}}': 'Ссылка на 1 дополнительное событие на {{date}}', | ||
}; | ||
@@ -1301,2 +1317,4 @@ | ||
'Full day- and multiple day events': '종일 및 복수일 일정', | ||
'Link to {{n}} more events on {{date}}': '{{date}}에 {{n}}개 이상의 이벤트로 이동', | ||
'Link to 1 more event on {{date}}': '{{date}}에 1개 이상의 이벤트로 이동', | ||
}; | ||
@@ -1330,2 +1348,4 @@ | ||
'Full day- and multiple day events': "Événements d'une ou plusieurs journées", | ||
'Link to {{n}} more events on {{date}}': 'Lien vers {{n}} autres événements le {{date}}', | ||
'Link to 1 more event on {{date}}': 'Lien vers 1 autre événement le {{date}}', | ||
}; | ||
@@ -1359,2 +1379,4 @@ | ||
'Full day- and multiple day events': 'Heldagsbegivenheder og flerdagsbegivenheder', | ||
'Link to {{n}} more events on {{date}}': 'Link til {{n}} flere begivenheder den {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link til 1 mere begivenhed den {{date}}', | ||
}; | ||
@@ -1388,2 +1410,4 @@ | ||
'Full day- and multiple day events': 'Wydarzenia całodniowe i wielodniowe', | ||
'Link to {{n}} more events on {{date}}': 'Link do {{n}} kolejnych wydarzeń w dniu {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link do 1 kolejnego wydarzenia w dniu {{date}}', | ||
}; | ||
@@ -1417,2 +1441,4 @@ | ||
'Full day- and multiple day events': 'Día completo y eventos de múltiples días', | ||
'Link to {{n}} more events on {{date}}': 'Enlace a {{n}} eventos más el {{date}}', | ||
'Link to 1 more event on {{date}}': 'Enlace a 1 evento más el {{date}}', | ||
}; | ||
@@ -1437,2 +1463,4 @@ | ||
'Full day- and multiple day events': 'Evenementen van een hele dag en meerdere dagen', | ||
'Link to {{n}} more events on {{date}}': 'Link naar {{n}} meer evenementen op {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link naar 1 meer evenement op {{date}}', | ||
}; | ||
@@ -1475,2 +1503,4 @@ | ||
'Full day- and multiple day events': 'Dia inteiro e eventos de vários dias', | ||
'Link to {{n}} more events on {{date}}': 'Link para mais {{n}} eventos em {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link para mais 1 evento em {{date}}', | ||
}; | ||
@@ -1504,2 +1534,4 @@ | ||
'Full day- and multiple day events': 'Celodenné a viacdňové udalosti', | ||
'Link to {{n}} more events on {{date}}': 'Odkaz na {{n}} ďalších udalostí dňa {{date}}', | ||
'Link to 1 more event on {{date}}': 'Odkaz na 1 ďalšiu udalosť dňa {{date}}', | ||
}; | ||
@@ -1533,2 +1565,4 @@ | ||
'Full day- and multiple day events': 'Целодневни и повеќедневни настани', | ||
'Link to {{n}} more events on {{date}}': 'Линк до {{n}} повеќе настани на {{date}}', | ||
'Link to 1 more event on {{date}}': 'Линк до 1 повеќе настан на {{date}}', | ||
}; | ||
@@ -1562,2 +1596,4 @@ | ||
'Full day- and multiple day events': 'Tüm gün ve çoklu gün etkinlikleri', | ||
'Link to {{n}} more events on {{date}}': '{{date}} tarihinde {{n}} etkinliğe bağlantı', | ||
'Link to 1 more event on {{date}}': '{{date}} tarihinde 1 etkinliğe bağlantı', | ||
}; | ||
@@ -1591,2 +1627,4 @@ | ||
'Full day- and multiple day events': 'Күн бою жана бир нече күн катары менен болгон окуялар', | ||
'Link to {{n}} more events on {{date}}': '{{date}} күнүндө {{n}} окуяга байланыш', | ||
'Link to 1 more event on {{date}}': '{{date}} күнүндө 1 окуяга байланыш', | ||
}; | ||
@@ -1620,2 +1658,4 @@ | ||
'Full day- and multiple day events': 'Sepanjang hari dan acara beberapa hari ', | ||
'Link to {{n}} more events on {{date}}': 'Tautan ke {{n}} acara lainnya pada {{date}}', | ||
'Link to 1 more event on {{date}}': 'Tautan ke 1 acara lainnya pada {{date}}', | ||
}; | ||
@@ -1649,2 +1689,4 @@ | ||
'Full day- and multiple day events': 'Celodenní a vícedenní události', | ||
'Link to {{n}} more events on {{date}}': 'Odkaz na {{n}} dalších událostí dne {{date}}', | ||
'Link to 1 more event on {{date}}': 'Odkaz na 1 další událost dne {{date}}', | ||
}; | ||
@@ -1663,3 +1705,3 @@ | ||
const translate = (locale, languages) => (key) => { | ||
const translate = (locale, languages) => (key, translationVariables) => { | ||
if (!/^[a-z]{2}-[A-Z]{2}$/.test(locale)) | ||
@@ -1671,3 +1713,10 @@ throw new InvalidLocaleError(locale); | ||
return key; | ||
return language[key] || 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; | ||
}; | ||
@@ -1674,0 +1723,0 @@ |
@@ -83,3 +83,6 @@ import { Signal } from "@preact/signals"; | ||
} | ||
type TranslateFn = (key: string) => string; | ||
type TranslationVariables = { | ||
[key: string]: string | number; | ||
}; | ||
type TranslateFn = (key: string, variables?: TranslationVariables) => string; | ||
/** | ||
@@ -86,0 +89,0 @@ * This interface serves as a bridge between the AppSingleton for the date picker and calendar |
@@ -1067,2 +1067,4 @@ import { createContext, render, createElement } from 'preact'; | ||
'Full day- and multiple day events': 'Ganztägige und mehrtägige Ereignisse', | ||
'Link to {{n}} more events on {{date}}': 'Link zu {{n}} weiteren Ereignissen am {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link zu 1 weiteren Ereignis am {{date}}', | ||
}; | ||
@@ -1096,2 +1098,4 @@ | ||
'Full day- and multiple day events': 'Full day- and multiple day events', | ||
'Link to {{n}} more events on {{date}}': 'Link to {{n}} more events on {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link to 1 more event on {{date}}', | ||
}; | ||
@@ -1125,2 +1129,4 @@ | ||
'Full day- and multiple day events': 'Eventi della giornata e plurigiornalieri', | ||
'Link to {{n}} more events on {{date}}': 'Link a {{n}} eventi in più il {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link a 1 evento in più il {{date}}', | ||
}; | ||
@@ -1154,2 +1160,4 @@ | ||
'Full day- and multiple day events': 'Full day- and multiple day events', | ||
'Link to {{n}} more events on {{date}}': 'Link to {{n}} more events on {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link to 1 more event on {{date}}', | ||
}; | ||
@@ -1183,2 +1191,4 @@ | ||
'Full day- and multiple day events': 'Heldags- och flerdagshändelser', | ||
'Link to {{n}} more events on {{date}}': 'Länk till {{n}} fler händelser den {{date}}', | ||
'Link to 1 more event on {{date}}': 'Länk till 1 händelse till den {{date}}', | ||
}; | ||
@@ -1212,2 +1222,4 @@ | ||
'Full day- and multiple day events': '全天和多天活动', | ||
'Link to {{n}} more events on {{date}}': '链接到{{date}}上的{{n}}个更多活动', | ||
'Link to 1 more event on {{date}}': '链接到{{date}}上的1个更多活动', | ||
}; | ||
@@ -1241,2 +1253,4 @@ | ||
'Full day- and multiple day events': '終日および複数日イベント', | ||
'Link to {{n}} more events on {{date}}': '{{date}} に{{n}}件のイベントへのリンク', | ||
'Link to 1 more event on {{date}}': '{{date}} に1件のイベントへのリンク', | ||
}; | ||
@@ -1270,2 +1284,4 @@ | ||
'Full day- and multiple day events': 'События на целый день и несколько дней подряд', | ||
'Link to {{n}} more events on {{date}}': 'Ссылка на {{n}} дополнительных событий на {{date}}', | ||
'Link to 1 more event on {{date}}': 'Ссылка на 1 дополнительное событие на {{date}}', | ||
}; | ||
@@ -1299,2 +1315,4 @@ | ||
'Full day- and multiple day events': '종일 및 복수일 일정', | ||
'Link to {{n}} more events on {{date}}': '{{date}}에 {{n}}개 이상의 이벤트로 이동', | ||
'Link to 1 more event on {{date}}': '{{date}}에 1개 이상의 이벤트로 이동', | ||
}; | ||
@@ -1328,2 +1346,4 @@ | ||
'Full day- and multiple day events': "Événements d'une ou plusieurs journées", | ||
'Link to {{n}} more events on {{date}}': 'Lien vers {{n}} autres événements le {{date}}', | ||
'Link to 1 more event on {{date}}': 'Lien vers 1 autre événement le {{date}}', | ||
}; | ||
@@ -1357,2 +1377,4 @@ | ||
'Full day- and multiple day events': 'Heldagsbegivenheder og flerdagsbegivenheder', | ||
'Link to {{n}} more events on {{date}}': 'Link til {{n}} flere begivenheder den {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link til 1 mere begivenhed den {{date}}', | ||
}; | ||
@@ -1386,2 +1408,4 @@ | ||
'Full day- and multiple day events': 'Wydarzenia całodniowe i wielodniowe', | ||
'Link to {{n}} more events on {{date}}': 'Link do {{n}} kolejnych wydarzeń w dniu {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link do 1 kolejnego wydarzenia w dniu {{date}}', | ||
}; | ||
@@ -1415,2 +1439,4 @@ | ||
'Full day- and multiple day events': 'Día completo y eventos de múltiples días', | ||
'Link to {{n}} more events on {{date}}': 'Enlace a {{n}} eventos más el {{date}}', | ||
'Link to 1 more event on {{date}}': 'Enlace a 1 evento más el {{date}}', | ||
}; | ||
@@ -1435,2 +1461,4 @@ | ||
'Full day- and multiple day events': 'Evenementen van een hele dag en meerdere dagen', | ||
'Link to {{n}} more events on {{date}}': 'Link naar {{n}} meer evenementen op {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link naar 1 meer evenement op {{date}}', | ||
}; | ||
@@ -1473,2 +1501,4 @@ | ||
'Full day- and multiple day events': 'Dia inteiro e eventos de vários dias', | ||
'Link to {{n}} more events on {{date}}': 'Link para mais {{n}} eventos em {{date}}', | ||
'Link to 1 more event on {{date}}': 'Link para mais 1 evento em {{date}}', | ||
}; | ||
@@ -1502,2 +1532,4 @@ | ||
'Full day- and multiple day events': 'Celodenné a viacdňové udalosti', | ||
'Link to {{n}} more events on {{date}}': 'Odkaz na {{n}} ďalších udalostí dňa {{date}}', | ||
'Link to 1 more event on {{date}}': 'Odkaz na 1 ďalšiu udalosť dňa {{date}}', | ||
}; | ||
@@ -1531,2 +1563,4 @@ | ||
'Full day- and multiple day events': 'Целодневни и повеќедневни настани', | ||
'Link to {{n}} more events on {{date}}': 'Линк до {{n}} повеќе настани на {{date}}', | ||
'Link to 1 more event on {{date}}': 'Линк до 1 повеќе настан на {{date}}', | ||
}; | ||
@@ -1560,2 +1594,4 @@ | ||
'Full day- and multiple day events': 'Tüm gün ve çoklu gün etkinlikleri', | ||
'Link to {{n}} more events on {{date}}': '{{date}} tarihinde {{n}} etkinliğe bağlantı', | ||
'Link to 1 more event on {{date}}': '{{date}} tarihinde 1 etkinliğe bağlantı', | ||
}; | ||
@@ -1589,2 +1625,4 @@ | ||
'Full day- and multiple day events': 'Күн бою жана бир нече күн катары менен болгон окуялар', | ||
'Link to {{n}} more events on {{date}}': '{{date}} күнүндө {{n}} окуяга байланыш', | ||
'Link to 1 more event on {{date}}': '{{date}} күнүндө 1 окуяга байланыш', | ||
}; | ||
@@ -1618,2 +1656,4 @@ | ||
'Full day- and multiple day events': 'Sepanjang hari dan acara beberapa hari ', | ||
'Link to {{n}} more events on {{date}}': 'Tautan ke {{n}} acara lainnya pada {{date}}', | ||
'Link to 1 more event on {{date}}': 'Tautan ke 1 acara lainnya pada {{date}}', | ||
}; | ||
@@ -1647,2 +1687,4 @@ | ||
'Full day- and multiple day events': 'Celodenní a vícedenní události', | ||
'Link to {{n}} more events on {{date}}': 'Odkaz na {{n}} dalších událostí dne {{date}}', | ||
'Link to 1 more event on {{date}}': 'Odkaz na 1 další událost dne {{date}}', | ||
}; | ||
@@ -1661,3 +1703,3 @@ | ||
const translate = (locale, languages) => (key) => { | ||
const translate = (locale, languages) => (key, translationVariables) => { | ||
if (!/^[a-z]{2}-[A-Z]{2}$/.test(locale)) | ||
@@ -1669,3 +1711,10 @@ throw new InvalidLocaleError(locale); | ||
return key; | ||
return language[key] || 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; | ||
}; | ||
@@ -1672,0 +1721,0 @@ |
@@ -83,3 +83,6 @@ import { Signal } from "@preact/signals"; | ||
} | ||
type TranslateFn = (key: string) => string; | ||
type TranslationVariables = { | ||
[key: string]: string | number; | ||
}; | ||
type TranslateFn = (key: string, variables?: TranslationVariables) => string; | ||
/** | ||
@@ -86,0 +89,0 @@ * This interface serves as a bridge between the AppSingleton for the date picker and calendar |
{ | ||
"name": "@schedule-x/date-picker", | ||
"version": "1.48.0", | ||
"version": "1.49.0", | ||
"description": "Schedule-X date picker component", | ||
@@ -34,3 +34,3 @@ "author": { | ||
"homepage": "https://schedule-x.dev", | ||
"gitHead": "770bce0c213cded949c70cac797f3c8badb2725f" | ||
"gitHead": "10378f271ef2a416b7f625b34308846eda6254db" | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
266041
6936