Socket
Socket
Sign inDemoInstall

lisan-plugin-l10n

Package Overview
Dependencies
1
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.34-aplha.1 to 0.0.34

1

dist/index.d.ts

@@ -6,3 +6,2 @@ import { Lisan as LisanClass } from 'lisan';

class Lisan extends LisanClass {
localeName: string;
setLocale(locale: TSLisan.Locale): void;

@@ -9,0 +8,0 @@ toNumber(number: number): string;

2

dist/index.esm.js

@@ -1,2 +0,2 @@

var n=function(){return(n=Object.assign||function(n){for(var t,r=1,e=arguments.length;r<e;r++)for(var u in t=arguments[r])Object.prototype.hasOwnProperty.call(t,u)&&(n[u]=t[u]);return n}).apply(this,arguments)},t=function(n){return n.toString()},r=function(n,r){void 0===r&&(r=2);var e=t(n);return e.length>=r?e:e.padStart(r,"0")},e=function(n,r){var e=r.grouping,u=r.fraction,o=r.zeroFormat,i=r.nullFormat;if(null===n)return null!==i?i:"null";if(0===n)return null!==o?o:"0";var a=n<0?"-":"",c=Math.abs(n),f=(u.digits>-1?c.toFixed(u.digits):t(c)).split("."),l=f[0],s=f[1],d=l,h=e.blocks.length;if(h>0&&e.delimiters.length>0){var m=l.length,g="",D=0;for(d="";m>0;){var M=e.blocks[D],v=Math.max(m-M,0);if(d=""+l.substring(v,m)+d,0===v)break;d=""+(g=e.delimiters[D]||g)+d,m=v,D<h-1&&(D+=1)}}return""+a+d+(s?""+u.delimiter+s:"")},u=function(n){var t=Math.abs(15*Math.round(n/15)),e=Math.floor(t/60),u=t%60;return(n<=0?"+":"-")+r(Math.abs(e))+":"+r(u)},o=function(n){for(var e,o=n.mask,i=n.months,a=n.monthsShort,c=n.weekdays,f=n.weekdaysShort,l=n.weekdaysMin,s=n.amPm,d=n.ordinal,h=new RegExp(/YYYY|YY|Mo|M{1,4}|wo|w{1,2}|Qo|Q|Do|DDDo|D{1,4}|do|d{1,4}|([Hhskm])\1?|S{1,3}|Z{1,2}|[aA]|X|x/,"gm"),m=[],g=[],D=0;null!==(e=h.exec(o));){var M=e[0],v=h.lastIndex-M.length;v>0&&m.push([o.substring(D,v)]),m.push(M),g.push(M),D=h.lastIndex}var p=function(n){var e,o=n.getMonth(),h=n.getDay(),m=n.getFullYear(),D=n.getDate(),M=n.getTime(),v=n.getHours(),p=n.getMinutes(),w=n.getSeconds(),k=n.getMilliseconds(),b=n.getTimezoneOffset(),y=(e=o,Math.ceil((e+1)/3)),Y=function(n,t,r){var e=new Date(n,0,0),u=t-e.getTime()+60*(e.getTimezoneOffset()-r)*1e3;return Math.floor(u/864e5)}(m,M,b),S=function(n){var t=new Date(n);t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var r=new Date(t.getFullYear(),0,4);return 1+Math.round(((n-r.getTime())/864e5-3+(r.getDay()+6)%7)/7)}(M),x=function(n){return n%12||12}(v),O=function(n){return n||24}(v),E=s[v>=0&&v<12?0:1],F={MMMM:function(){return i[o]},MMM:function(){return a[o]},MM:function(){return r(o+1)},Mo:function(){return d(o+1)},M:function(){return t(o+1)},Qo:function(){return d(y)},Q:function(){return t(y)},DDDD:function(){return r(Y,3)},DDDo:function(){return d(Y)},DDD:function(){return t(Y)},DD:function(){return r(D)},Do:function(){return d(D)},D:function(){return t(D)},dddd:function(){return c[h]},ddd:function(){return f[h]},dd:function(){return l[h]},do:function(){return d(h)},d:function(){return t(h)},w:function(){return t(S)},wo:function(){return d(S)},ww:function(){return r(S)},YYYY:function(){return t(m)},YY:function(){return t(m%100)},A:function(){return E.toUpperCase()},a:function(){return E},H:function(){return t(v)},HH:function(){return r(v)},h:function(){return t(x)},hh:function(){return r(x)},k:function(){return t(O)},kk:function(){return r(O)},m:function(){return t(p)},mm:function(){return r(p)},s:function(){return t(w)},ss:function(){return r(w)},S:function(){return t(Math.floor(k/100))},SS:function(){return r(Math.floor(k/10))},SSS:function(){return r(k,3)},Z:function(){return u(b)},ZZ:function(){return u(b).replace(":","")},X:function(){return t(Math.floor(M/1e3))},x:function(){return t(M)}},H={};return g.forEach((function(n){H[n]=F[n]()})),H};return function(n){var t="number"==typeof n?new Date(n):n,r=p(t),e="";return m.forEach((function(n){var t=r[n];e+=t||n[0]})),e}},i=function(t){t.setLocale=function(t){var r=this;this.reset(),t.conditions&&this.addConditions(t.conditions);var u,i,a,c,f,l,s,d=(i=(u=t).date,a=u.ordinal,c=void 0===a?function(n){return n.toString()}:a,f=u.number,l=u.currency,s={},f&&(s.number=function(n){return e(n,f)}),(null==l?void 0:l.template)&&(s.currency=function(t){var r=n(n({},f),l),u=e(t,r);return""+r.template(u)}),s.ordinal=function(n){return c(n)},i&&Object.keys(i.masks).forEach((function(t){var r=i.masks[t];s[t]=o(n(n({mask:r},i),{ordinal:c}))})),s);this.addFormatters(d),Object.keys(d).forEach((function(n){r["to"+function(n){return n.charAt(0).toUpperCase()+n.slice(1)}(n)]=d[n]})),this.localeName=t.name};var r=t.add;t.add=function(n){var e=n.locale,u=n.entries;if(t.localeName&&e&&e!==t.localeName)throw new Error('Dictionary locale "'+e+'" is different than selected locale "'+t.localeName+'"');return r.call(this,{locale:e,entries:u})}};export{i as Localization};
var n=function(){return(n=Object.assign||function(n){for(var t,r=1,e=arguments.length;r<e;r++)for(var u in t=arguments[r])Object.prototype.hasOwnProperty.call(t,u)&&(n[u]=t[u]);return n}).apply(this,arguments)},t=function(n){return n.toString()},r=function(n,r){void 0===r&&(r=2);var e=t(n);return e.length>=r?e:e.padStart(r,"0")},e=function(n,r){var e=r.grouping,u=r.fraction,o=r.zeroFormat,i=r.nullFormat;if(null===n)return null!==i?i:"null";if(0===n)return null!==o?o:"0";var a=n<0?"-":"",c=Math.abs(n),f=(u.digits>-1?c.toFixed(u.digits):t(c)).split("."),s=f[0],l=f[1],d=s,h=e.blocks.length;if(h>0&&e.delimiters.length>0){var g=s.length,m="",D=0;for(d="";g>0;){var M=e.blocks[D],v=Math.max(g-M,0);if(d=""+s.substring(v,g)+d,0===v)break;d=""+(m=e.delimiters[D]||m)+d,g=v,D<h-1&&(D+=1)}}return""+a+d+(l?""+u.delimiter+l:"")},u=function(n){var t=Math.abs(15*Math.round(n/15)),e=Math.floor(t/60),u=t%60;return(n<=0?"+":"-")+r(Math.abs(e))+":"+r(u)},o=function(n){for(var e,o=n.mask,i=n.months,a=n.monthsShort,c=n.weekdays,f=n.weekdaysShort,s=n.weekdaysMin,l=n.amPm,d=n.ordinal,h=new RegExp(/YYYY|YY|Mo|M{1,4}|wo|w{1,2}|Qo|Q|Do|DDDo|D{1,4}|do|d{1,4}|([Hhskm])\1?|S{1,3}|Z{1,2}|[aA]|X|x/,"gm"),g=[],m=[],D=0;null!==(e=h.exec(o));){var M=e[0],v=h.lastIndex-M.length;v>0&&g.push([o.substring(D,v)]),g.push(M),m.push(M),D=h.lastIndex}var p=function(n){var e,o=n.getMonth(),h=n.getDay(),g=n.getFullYear(),D=n.getDate(),M=n.getTime(),v=n.getHours(),p=n.getMinutes(),k=n.getSeconds(),b=n.getMilliseconds(),w=n.getTimezoneOffset(),y=(e=o,Math.ceil((e+1)/3)),Y=function(n,t,r){var e=new Date(n,0,0),u=t-e.getTime()+60*(e.getTimezoneOffset()-r)*1e3;return Math.floor(u/864e5)}(g,M,w),S=function(n){var t=new Date(n);t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var r=new Date(t.getFullYear(),0,4);return 1+Math.round(((n-r.getTime())/864e5-3+(r.getDay()+6)%7)/7)}(M),x=function(n){return n%12||12}(v),O=function(n){return n||24}(v),F=l[v>=0&&v<12?0:1],H={MMMM:function(){return i[o]},MMM:function(){return a[o]},MM:function(){return r(o+1)},Mo:function(){return d(o+1)},M:function(){return t(o+1)},Qo:function(){return d(y)},Q:function(){return t(y)},DDDD:function(){return r(Y,3)},DDDo:function(){return d(Y)},DDD:function(){return t(Y)},DD:function(){return r(D)},Do:function(){return d(D)},D:function(){return t(D)},dddd:function(){return c[h]},ddd:function(){return f[h]},dd:function(){return s[h]},do:function(){return d(h)},d:function(){return t(h)},w:function(){return t(S)},wo:function(){return d(S)},ww:function(){return r(S)},YYYY:function(){return t(g)},YY:function(){return t(g%100)},A:function(){return F.toUpperCase()},a:function(){return F},H:function(){return t(v)},HH:function(){return r(v)},h:function(){return t(x)},hh:function(){return r(x)},k:function(){return t(O)},kk:function(){return r(O)},m:function(){return t(p)},mm:function(){return r(p)},s:function(){return t(k)},ss:function(){return r(k)},S:function(){return t(Math.floor(b/100))},SS:function(){return r(Math.floor(b/10))},SSS:function(){return r(b,3)},Z:function(){return u(w)},ZZ:function(){return u(w).replace(":","")},X:function(){return t(Math.floor(M/1e3))},x:function(){return t(M)}},E={};return m.forEach((function(n){E[n]=H[n]()})),E};return function(n){var t="number"==typeof n?new Date(n):n,r=p(t),e="";return g.forEach((function(n){var t=r[n];e+=t||n[0]})),e}},i=function(t){t.setLocale=function(t){var r=this;this.reset(),t.conditions&&this.addConditions(t.conditions);var u,i,a,c,f,s,l,d=(i=(u=t).date,a=u.ordinal,c=void 0===a?function(n){return n.toString()}:a,f=u.number,s=u.currency,l={},f&&(l.number=function(n){return e(n,f)}),(null==s?void 0:s.template)&&(l.currency=function(t){var r=n(n({},f),s),u=e(t,r);return""+r.template(u)}),l.ordinal=function(n){return c(n)},i&&Object.keys(i.masks).forEach((function(t){var r=i.masks[t];l[t]=o(n(n({mask:r},i),{ordinal:c}))})),l);this.addFormatters(d),Object.keys(d).forEach((function(n){r["to"+function(n){return n.charAt(0).toUpperCase()+n.slice(1)}(n)]=d[n]})),this.localeName(t.name)}};export{i as Localization};
//# sourceMappingURL=index.esm.js.map

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=function(){return(n=Object.assign||function(n){for(var t,r=1,e=arguments.length;r<e;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}).apply(this,arguments)},t=function(n){return n.toString()},r=function(n,r){void 0===r&&(r=2);var e=t(n);return e.length>=r?e:e.padStart(r,"0")},e=function(n,r){var e=r.grouping,o=r.fraction,u=r.zeroFormat,i=r.nullFormat;if(null===n)return null!==i?i:"null";if(0===n)return null!==u?u:"0";var a=n<0?"-":"",c=Math.abs(n),f=(o.digits>-1?c.toFixed(o.digits):t(c)).split("."),l=f[0],s=f[1],d=l,h=e.blocks.length;if(h>0&&e.delimiters.length>0){var m=l.length,g="",D=0;for(d="";m>0;){var M=e.blocks[D],v=Math.max(m-M,0);if(d=""+l.substring(v,m)+d,0===v)break;d=""+(g=e.delimiters[D]||g)+d,m=v,D<h-1&&(D+=1)}}return""+a+d+(s?""+o.delimiter+s:"")},o=function(n){var t=Math.abs(15*Math.round(n/15)),e=Math.floor(t/60),o=t%60;return(n<=0?"+":"-")+r(Math.abs(e))+":"+r(o)},u=function(n){for(var e,u=n.mask,i=n.months,a=n.monthsShort,c=n.weekdays,f=n.weekdaysShort,l=n.weekdaysMin,s=n.amPm,d=n.ordinal,h=new RegExp(/YYYY|YY|Mo|M{1,4}|wo|w{1,2}|Qo|Q|Do|DDDo|D{1,4}|do|d{1,4}|([Hhskm])\1?|S{1,3}|Z{1,2}|[aA]|X|x/,"gm"),m=[],g=[],D=0;null!==(e=h.exec(u));){var M=e[0],v=h.lastIndex-M.length;v>0&&m.push([u.substring(D,v)]),m.push(M),g.push(M),D=h.lastIndex}var p=function(n){var e,u=n.getMonth(),h=n.getDay(),m=n.getFullYear(),D=n.getDate(),M=n.getTime(),v=n.getHours(),p=n.getMinutes(),w=n.getSeconds(),b=n.getMilliseconds(),k=n.getTimezoneOffset(),y=(e=u,Math.ceil((e+1)/3)),Y=function(n,t,r){var e=new Date(n,0,0),o=t-e.getTime()+60*(e.getTimezoneOffset()-r)*1e3;return Math.floor(o/864e5)}(m,M,k),S=function(n){var t=new Date(n);t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var r=new Date(t.getFullYear(),0,4);return 1+Math.round(((n-r.getTime())/864e5-3+(r.getDay()+6)%7)/7)}(M),x=function(n){return n%12||12}(v),O=function(n){return n||24}(v),E=s[v>=0&&v<12?0:1],F={MMMM:function(){return i[u]},MMM:function(){return a[u]},MM:function(){return r(u+1)},Mo:function(){return d(u+1)},M:function(){return t(u+1)},Qo:function(){return d(y)},Q:function(){return t(y)},DDDD:function(){return r(Y,3)},DDDo:function(){return d(Y)},DDD:function(){return t(Y)},DD:function(){return r(D)},Do:function(){return d(D)},D:function(){return t(D)},dddd:function(){return c[h]},ddd:function(){return f[h]},dd:function(){return l[h]},do:function(){return d(h)},d:function(){return t(h)},w:function(){return t(S)},wo:function(){return d(S)},ww:function(){return r(S)},YYYY:function(){return t(m)},YY:function(){return t(m%100)},A:function(){return E.toUpperCase()},a:function(){return E},H:function(){return t(v)},HH:function(){return r(v)},h:function(){return t(x)},hh:function(){return r(x)},k:function(){return t(O)},kk:function(){return r(O)},m:function(){return t(p)},mm:function(){return r(p)},s:function(){return t(w)},ss:function(){return r(w)},S:function(){return t(Math.floor(b/100))},SS:function(){return r(Math.floor(b/10))},SSS:function(){return r(b,3)},Z:function(){return o(k)},ZZ:function(){return o(k).replace(":","")},X:function(){return t(Math.floor(M/1e3))},x:function(){return t(M)}},H={};return g.forEach((function(n){H[n]=F[n]()})),H};return function(n){var t="number"==typeof n?new Date(n):n,r=p(t),e="";return m.forEach((function(n){var t=r[n];e+=t||n[0]})),e}};exports.Localization=function(t){t.setLocale=function(t){var r=this;this.reset(),t.conditions&&this.addConditions(t.conditions);var o,i,a,c,f,l,s,d=(i=(o=t).date,a=o.ordinal,c=void 0===a?function(n){return n.toString()}:a,f=o.number,l=o.currency,s={},f&&(s.number=function(n){return e(n,f)}),(null==l?void 0:l.template)&&(s.currency=function(t){var r=n(n({},f),l),o=e(t,r);return""+r.template(o)}),s.ordinal=function(n){return c(n)},i&&Object.keys(i.masks).forEach((function(t){var r=i.masks[t];s[t]=u(n(n({mask:r},i),{ordinal:c}))})),s);this.addFormatters(d),Object.keys(d).forEach((function(n){r["to"+function(n){return n.charAt(0).toUpperCase()+n.slice(1)}(n)]=d[n]})),this.localeName=t.name};var r=t.add;t.add=function(n){var e=n.locale,o=n.entries;if(t.localeName&&e&&e!==t.localeName)throw new Error('Dictionary locale "'+e+'" is different than selected locale "'+t.localeName+'"');return r.call(this,{locale:e,entries:o})}};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=function(){return(n=Object.assign||function(n){for(var t,r=1,e=arguments.length;r<e;r++)for(var u in t=arguments[r])Object.prototype.hasOwnProperty.call(t,u)&&(n[u]=t[u]);return n}).apply(this,arguments)},t=function(n){return n.toString()},r=function(n,r){void 0===r&&(r=2);var e=t(n);return e.length>=r?e:e.padStart(r,"0")},e=function(n,r){var e=r.grouping,u=r.fraction,o=r.zeroFormat,i=r.nullFormat;if(null===n)return null!==i?i:"null";if(0===n)return null!==o?o:"0";var a=n<0?"-":"",c=Math.abs(n),f=(u.digits>-1?c.toFixed(u.digits):t(c)).split("."),s=f[0],l=f[1],d=s,h=e.blocks.length;if(h>0&&e.delimiters.length>0){var g=s.length,m="",M=0;for(d="";g>0;){var D=e.blocks[M],v=Math.max(g-D,0);if(d=""+s.substring(v,g)+d,0===v)break;d=""+(m=e.delimiters[M]||m)+d,g=v,M<h-1&&(M+=1)}}return""+a+d+(l?""+u.delimiter+l:"")},u=function(n){var t=Math.abs(15*Math.round(n/15)),e=Math.floor(t/60),u=t%60;return(n<=0?"+":"-")+r(Math.abs(e))+":"+r(u)},o=function(n){for(var e,o=n.mask,i=n.months,a=n.monthsShort,c=n.weekdays,f=n.weekdaysShort,s=n.weekdaysMin,l=n.amPm,d=n.ordinal,h=new RegExp(/YYYY|YY|Mo|M{1,4}|wo|w{1,2}|Qo|Q|Do|DDDo|D{1,4}|do|d{1,4}|([Hhskm])\1?|S{1,3}|Z{1,2}|[aA]|X|x/,"gm"),g=[],m=[],M=0;null!==(e=h.exec(o));){var D=e[0],v=h.lastIndex-D.length;v>0&&g.push([o.substring(M,v)]),g.push(D),m.push(D),M=h.lastIndex}var p=function(n){var e,o=n.getMonth(),h=n.getDay(),g=n.getFullYear(),M=n.getDate(),D=n.getTime(),v=n.getHours(),p=n.getMinutes(),b=n.getSeconds(),k=n.getMilliseconds(),w=n.getTimezoneOffset(),y=(e=o,Math.ceil((e+1)/3)),Y=function(n,t,r){var e=new Date(n,0,0),u=t-e.getTime()+60*(e.getTimezoneOffset()-r)*1e3;return Math.floor(u/864e5)}(g,D,w),S=function(n){var t=new Date(n);t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var r=new Date(t.getFullYear(),0,4);return 1+Math.round(((n-r.getTime())/864e5-3+(r.getDay()+6)%7)/7)}(D),x=function(n){return n%12||12}(v),O=function(n){return n||24}(v),F=l[v>=0&&v<12?0:1],H={MMMM:function(){return i[o]},MMM:function(){return a[o]},MM:function(){return r(o+1)},Mo:function(){return d(o+1)},M:function(){return t(o+1)},Qo:function(){return d(y)},Q:function(){return t(y)},DDDD:function(){return r(Y,3)},DDDo:function(){return d(Y)},DDD:function(){return t(Y)},DD:function(){return r(M)},Do:function(){return d(M)},D:function(){return t(M)},dddd:function(){return c[h]},ddd:function(){return f[h]},dd:function(){return s[h]},do:function(){return d(h)},d:function(){return t(h)},w:function(){return t(S)},wo:function(){return d(S)},ww:function(){return r(S)},YYYY:function(){return t(g)},YY:function(){return t(g%100)},A:function(){return F.toUpperCase()},a:function(){return F},H:function(){return t(v)},HH:function(){return r(v)},h:function(){return t(x)},hh:function(){return r(x)},k:function(){return t(O)},kk:function(){return r(O)},m:function(){return t(p)},mm:function(){return r(p)},s:function(){return t(b)},ss:function(){return r(b)},S:function(){return t(Math.floor(k/100))},SS:function(){return r(Math.floor(k/10))},SSS:function(){return r(k,3)},Z:function(){return u(w)},ZZ:function(){return u(w).replace(":","")},X:function(){return t(Math.floor(D/1e3))},x:function(){return t(D)}},j={};return m.forEach((function(n){j[n]=H[n]()})),j};return function(n){var t="number"==typeof n?new Date(n):n,r=p(t),e="";return g.forEach((function(n){var t=r[n];e+=t||n[0]})),e}};exports.Localization=function(t){t.setLocale=function(t){var r=this;this.reset(),t.conditions&&this.addConditions(t.conditions);var u,i,a,c,f,s,l,d=(i=(u=t).date,a=u.ordinal,c=void 0===a?function(n){return n.toString()}:a,f=u.number,s=u.currency,l={},f&&(l.number=function(n){return e(n,f)}),(null==s?void 0:s.template)&&(l.currency=function(t){var r=n(n({},f),s),u=e(t,r);return""+r.template(u)}),l.ordinal=function(n){return c(n)},i&&Object.keys(i.masks).forEach((function(t){var r=i.masks[t];l[t]=o(n(n({mask:r},i),{ordinal:c}))})),l);this.addFormatters(d),Object.keys(d).forEach((function(n){r["to"+function(n){return n.charAt(0).toUpperCase()+n.slice(1)}(n)]=d[n]})),this.localeName(t.name)}};
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).lisanPluginL10n={})}(this,(function(n){"use strict";var t=function(){return(t=Object.assign||function(n){for(var t,r=1,e=arguments.length;r<e;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o]);return n}).apply(this,arguments)},r=function(n){return n.toString()},e=function(n,t){void 0===t&&(t=2);var e=r(n);return e.length>=t?e:e.padStart(t,"0")},o=function(n,t){var e=t.grouping,o=t.fraction,u=t.zeroFormat,i=t.nullFormat;if(null===n)return null!==i?i:"null";if(0===n)return null!==u?u:"0";var a=n<0?"-":"",c=Math.abs(n),f=(o.digits>-1?c.toFixed(o.digits):r(c)).split("."),l=f[0],s=f[1],d=l,h=e.blocks.length;if(h>0&&e.delimiters.length>0){var m=l.length,g="",D=0;for(d="";m>0;){var M=e.blocks[D],v=Math.max(m-M,0);if(d=""+l.substring(v,m)+d,0===v)break;d=""+(g=e.delimiters[D]||g)+d,m=v,D<h-1&&(D+=1)}}return""+a+d+(s?""+o.delimiter+s:"")},u=function(n){var t=Math.abs(15*Math.round(n/15)),r=Math.floor(t/60),o=t%60;return(n<=0?"+":"-")+e(Math.abs(r))+":"+e(o)},i=function(n){for(var t,o=n.mask,i=n.months,a=n.monthsShort,c=n.weekdays,f=n.weekdaysShort,l=n.weekdaysMin,s=n.amPm,d=n.ordinal,h=new RegExp(/YYYY|YY|Mo|M{1,4}|wo|w{1,2}|Qo|Q|Do|DDDo|D{1,4}|do|d{1,4}|([Hhskm])\1?|S{1,3}|Z{1,2}|[aA]|X|x/,"gm"),m=[],g=[],D=0;null!==(t=h.exec(o));){var M=t[0],v=h.lastIndex-M.length;v>0&&m.push([o.substring(D,v)]),m.push(M),g.push(M),D=h.lastIndex}var p=function(n){var t,o=n.getMonth(),h=n.getDay(),m=n.getFullYear(),D=n.getDate(),M=n.getTime(),v=n.getHours(),p=n.getMinutes(),y=n.getSeconds(),b=n.getMilliseconds(),w=n.getTimezoneOffset(),k=(t=o,Math.ceil((t+1)/3)),Y=function(n,t,r){var e=new Date(n,0,0),o=t-e.getTime()+60*(e.getTimezoneOffset()-r)*1e3;return Math.floor(o/864e5)}(m,M,w),S=function(n){var t=new Date(n);t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var r=new Date(t.getFullYear(),0,4);return 1+Math.round(((n-r.getTime())/864e5-3+(r.getDay()+6)%7)/7)}(M),x=function(n){return n%12||12}(v),O=function(n){return n||24}(v),j=s[v>=0&&v<12?0:1],E={MMMM:function(){return i[o]},MMM:function(){return a[o]},MM:function(){return e(o+1)},Mo:function(){return d(o+1)},M:function(){return r(o+1)},Qo:function(){return d(k)},Q:function(){return r(k)},DDDD:function(){return e(Y,3)},DDDo:function(){return d(Y)},DDD:function(){return r(Y)},DD:function(){return e(D)},Do:function(){return d(D)},D:function(){return r(D)},dddd:function(){return c[h]},ddd:function(){return f[h]},dd:function(){return l[h]},do:function(){return d(h)},d:function(){return r(h)},w:function(){return r(S)},wo:function(){return d(S)},ww:function(){return e(S)},YYYY:function(){return r(m)},YY:function(){return r(m%100)},A:function(){return j.toUpperCase()},a:function(){return j},H:function(){return r(v)},HH:function(){return e(v)},h:function(){return r(x)},hh:function(){return e(x)},k:function(){return r(O)},kk:function(){return e(O)},m:function(){return r(p)},mm:function(){return e(p)},s:function(){return r(y)},ss:function(){return e(y)},S:function(){return r(Math.floor(b/100))},SS:function(){return e(Math.floor(b/10))},SSS:function(){return e(b,3)},Z:function(){return u(w)},ZZ:function(){return u(w).replace(":","")},X:function(){return r(Math.floor(M/1e3))},x:function(){return r(M)}},F={};return g.forEach((function(n){F[n]=E[n]()})),F};return function(n){var t="number"==typeof n?new Date(n):n,r=p(t),e="";return m.forEach((function(n){var t=r[n];e+=t||n[0]})),e}};n.Localization=function(n){n.setLocale=function(n){var r=this;this.reset(),n.conditions&&this.addConditions(n.conditions);var e,u,a,c,f,l,s,d=(u=(e=n).date,a=e.ordinal,c=void 0===a?function(n){return n.toString()}:a,f=e.number,l=e.currency,s={},f&&(s.number=function(n){return o(n,f)}),(null==l?void 0:l.template)&&(s.currency=function(n){var r=t(t({},f),l),e=o(n,r);return""+r.template(e)}),s.ordinal=function(n){return c(n)},u&&Object.keys(u.masks).forEach((function(n){var r=u.masks[n];s[n]=i(t(t({mask:r},u),{ordinal:c}))})),s);this.addFormatters(d),Object.keys(d).forEach((function(n){r["to"+function(n){return n.charAt(0).toUpperCase()+n.slice(1)}(n)]=d[n]})),this.localeName=n.name};var r=n.add;n.add=function(t){var e=t.locale,o=t.entries;if(n.localeName&&e&&e!==n.localeName)throw new Error('Dictionary locale "'+e+'" is different than selected locale "'+n.localeName+'"');return r.call(this,{locale:e,entries:o})}},Object.defineProperty(n,"__esModule",{value:!0})}));
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).lisanPluginL10n={})}(this,(function(n){"use strict";var t=function(){return(t=Object.assign||function(n){for(var t,r=1,e=arguments.length;r<e;r++)for(var u in t=arguments[r])Object.prototype.hasOwnProperty.call(t,u)&&(n[u]=t[u]);return n}).apply(this,arguments)},r=function(n){return n.toString()},e=function(n,t){void 0===t&&(t=2);var e=r(n);return e.length>=t?e:e.padStart(t,"0")},u=function(n,t){var e=t.grouping,u=t.fraction,o=t.zeroFormat,i=t.nullFormat;if(null===n)return null!==i?i:"null";if(0===n)return null!==o?o:"0";var f=n<0?"-":"",c=Math.abs(n),a=(u.digits>-1?c.toFixed(u.digits):r(c)).split("."),s=a[0],l=a[1],d=s,h=e.blocks.length;if(h>0&&e.delimiters.length>0){var g=s.length,m="",M=0;for(d="";g>0;){var D=e.blocks[M],p=Math.max(g-D,0);if(d=""+s.substring(p,g)+d,0===p)break;d=""+(m=e.delimiters[M]||m)+d,g=p,M<h-1&&(M+=1)}}return""+f+d+(l?""+u.delimiter+l:"")},o=function(n){var t=Math.abs(15*Math.round(n/15)),r=Math.floor(t/60),u=t%60;return(n<=0?"+":"-")+e(Math.abs(r))+":"+e(u)},i=function(n){for(var t,u=n.mask,i=n.months,f=n.monthsShort,c=n.weekdays,a=n.weekdaysShort,s=n.weekdaysMin,l=n.amPm,d=n.ordinal,h=new RegExp(/YYYY|YY|Mo|M{1,4}|wo|w{1,2}|Qo|Q|Do|DDDo|D{1,4}|do|d{1,4}|([Hhskm])\1?|S{1,3}|Z{1,2}|[aA]|X|x/,"gm"),g=[],m=[],M=0;null!==(t=h.exec(u));){var D=t[0],p=h.lastIndex-D.length;p>0&&g.push([u.substring(M,p)]),g.push(D),m.push(D),M=h.lastIndex}var v=function(n){var t,u=n.getMonth(),h=n.getDay(),g=n.getFullYear(),M=n.getDate(),D=n.getTime(),p=n.getHours(),v=n.getMinutes(),y=n.getSeconds(),b=n.getMilliseconds(),k=n.getTimezoneOffset(),w=(t=u,Math.ceil((t+1)/3)),Y=function(n,t,r){var e=new Date(n,0,0),u=t-e.getTime()+60*(e.getTimezoneOffset()-r)*1e3;return Math.floor(u/864e5)}(g,D,k),S=function(n){var t=new Date(n);t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var r=new Date(t.getFullYear(),0,4);return 1+Math.round(((n-r.getTime())/864e5-3+(r.getDay()+6)%7)/7)}(D),x=function(n){return n%12||12}(p),O=function(n){return n||24}(p),j=l[p>=0&&p<12?0:1],F={MMMM:function(){return i[u]},MMM:function(){return f[u]},MM:function(){return e(u+1)},Mo:function(){return d(u+1)},M:function(){return r(u+1)},Qo:function(){return d(w)},Q:function(){return r(w)},DDDD:function(){return e(Y,3)},DDDo:function(){return d(Y)},DDD:function(){return r(Y)},DD:function(){return e(M)},Do:function(){return d(M)},D:function(){return r(M)},dddd:function(){return c[h]},ddd:function(){return a[h]},dd:function(){return s[h]},do:function(){return d(h)},d:function(){return r(h)},w:function(){return r(S)},wo:function(){return d(S)},ww:function(){return e(S)},YYYY:function(){return r(g)},YY:function(){return r(g%100)},A:function(){return j.toUpperCase()},a:function(){return j},H:function(){return r(p)},HH:function(){return e(p)},h:function(){return r(x)},hh:function(){return e(x)},k:function(){return r(O)},kk:function(){return e(O)},m:function(){return r(v)},mm:function(){return e(v)},s:function(){return r(y)},ss:function(){return e(y)},S:function(){return r(Math.floor(b/100))},SS:function(){return e(Math.floor(b/10))},SSS:function(){return e(b,3)},Z:function(){return o(k)},ZZ:function(){return o(k).replace(":","")},X:function(){return r(Math.floor(D/1e3))},x:function(){return r(D)}},H={};return m.forEach((function(n){H[n]=F[n]()})),H};return function(n){var t="number"==typeof n?new Date(n):n,r=v(t),e="";return g.forEach((function(n){var t=r[n];e+=t||n[0]})),e}};n.Localization=function(n){n.setLocale=function(n){var r=this;this.reset(),n.conditions&&this.addConditions(n.conditions);var e,o,f,c,a,s,l,d=(o=(e=n).date,f=e.ordinal,c=void 0===f?function(n){return n.toString()}:f,a=e.number,s=e.currency,l={},a&&(l.number=function(n){return u(n,a)}),(null==s?void 0:s.template)&&(l.currency=function(n){var r=t(t({},a),s),e=u(n,r);return""+r.template(e)}),l.ordinal=function(n){return c(n)},o&&Object.keys(o.masks).forEach((function(n){var r=o.masks[n];l[n]=i(t(t({mask:r},o),{ordinal:c}))})),l);this.addFormatters(d),Object.keys(d).forEach((function(n){r["to"+function(n){return n.charAt(0).toUpperCase()+n.slice(1)}(n)]=d[n]})),this.localeName(n.name)}},Object.defineProperty(n,"__esModule",{value:!0})}));
//# sourceMappingURL=index.umd.js.map
{
"name": "lisan-plugin-l10n",
"version": "0.0.34-aplha.1",
"version": "0.0.34",
"description": "Lisan Localization Plugin",

@@ -43,4 +43,5 @@ "author": "Mehmet Yatkı <mehmet@yatki.com>",

"devDependencies": {
"lisan": "^0.0.34-aplha.1"
}
"lisan": "^0.0.34"
},
"gitHead": "3df8848031e220f0e952c7e986f12955e4236d19"
}

@@ -61,7 +61,7 @@ <p align="center">

const { Localization } = require('lisan-plugin-l10n');
const { trTR } = require('lisan-locales');
const { tr } = require('lisan-locales');
lisan.use(Localization);
lisan.setLocale(trTR);
lisan.setLocale(tr);

@@ -138,2 +138,6 @@ lisan.toOrdinal(3); // Returns: 3'üncü

`conditions` object will be passed down to
[`lisan.addConditions`](https://lisanjs.com/docs/full-api-reference#lisanaddconditionsconditions)
method.
**Type Signature**

@@ -155,7 +159,8 @@

`number` is being used to set the configuration for
[`lisan.toNumber`](https://lisanjs.com/docs/full-api-reference#lisantonumbernumber) Localization Helper
and it has the following type definition.
`number` takes number formatting options. When defined,
the `number` formatter will be available in translations and
[`lisan.toNumber`](https://lisanjs.com/docs/full-api-reference#lisantonumbernumber)
method will be added to lisan instance.
> If this option is not set `lisan.toNumber` method won't be available.
Number formatting options have the following type definition.

@@ -324,7 +329,8 @@ **Type Signature**

`currency` is being used to set the configuration for
[`lisan.toCurrency`](https://lisanjs.com/docs/full-api-reference#lisantocurrencyamount)
Localization Helper and it has the following type definition.
`currency` takes currency formatting options. When defined,
the `currency` formatter will be available in translations and
[`lisan.toCurrency`](https://lisanjs.com/docs/full-api-reference#lisantocurrencyamount) method
will be added to lisan instance.
> If this option is not set `lisan.toCurrency` method won't be available.
Currency formatting options have the following type definition.

@@ -383,5 +389,6 @@ **Type Signature**

`ordinal` is being used to set the configuration for
[`lisan.toOrdinal`](https://lisanjs.com/docs/full-api-reference#lisantoordinalnumber)
Localization Helper and it has the following type definition.
`ordinal` takes ordinal function.
The `ordinal` formatter is always available in translations and
[`lisan.toOrdinal`](https://lisanjs.com/docs/full-api-reference#lisantoordinalnumber) method
is always added lisan instance.

@@ -404,3 +411,3 @@ **Type Signature**

`date` is being used to set the configuration for
various date Localization Helpers and
various date formatters and
it has the following type definition.

@@ -435,4 +442,26 @@

`date.masks` is being used to modify listed localization helper formats.
`date.masks` is being used to generate formatters with the same mask name:
- `dateTime`
- `dateShort`
- `dateMedium`
- `dateLong`
- `dateFull`
- `timeShort`
- `timeMedium`
- `timeLong`
These formatters then can be used in dictionaries as below:
```js
lisan.add({
entries: {
simpleExample: ({ date }, { dateTime }) =>
`This is formatted ${dateTime(date)}`,
},
});
```
Also a method is created for corresponding formatter.
- [`lisan.toDateTime()`](https://lisanjs.com/docs/full-api-reference#lisantodatetimetime)

@@ -439,0 +468,0 @@ - [`lisan.toDateFull()`](https://lisanjs.com/docs/full-api-reference#lisantodatefulltime)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc