0.0.5 • Published 1 year ago

@qualityunit/liveagent-components-utils v0.0.5

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Utils for LiveAgent components

Localization example:

<script>
import {initI18N, fallbackLocale, initialLocale, initDayJS} from '@qualityunit/liveagent-components-utils/i18n';
import {_, isLoading} from 'svelte-i18n';

const options: {
    thousandsSeparator: 'S',
    decimalSeparator: 'D',
    dateFormat: 'MM/d/yyyy',
    timeFormat: 'HH:mm:ss',
    timeShortFormat: 'HH:mm',
    locale: 'sk'
};

initI18N(options, () => import(`./locales/${fallbackLocale}.json`), () => import(`./locales/${initialLocale}.json`));

// needed only if you use svelte-time with relative time
initDayJS(options.locale);

</script>

{#if $isLoading}
    <p>Loading translations...</p>
{:else}
    <p>{$_("Translated string")}</p>
{/if}
0.0.5

1 year ago

0.0.4

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago