Sha256: 1941ab401cfdf7bd06138e374b1f5360c09c6c204cf54e6349b806dd0f472876
Contents?: true
Size: 806 Bytes
Versions: 9
Compression:
Stored size: 806 Bytes
Contents
import flatpickr from 'flatpickr' // Container for i18n translations export const i18n = {} // Some of Flatpickr's locale names differ from Rails. This maps the Rails I18n locale to their Flatpickr equivalent. const FlatpickrLocaleConversions = { ca: 'cat', el: 'gr', nb: 'no', vi: 'vn' } // Sets up localization for Trestle and its dependencies, in particular Flatpickr. // This method accepts a list of locales in descending order of priority. // // Trestle.localize('es-MX', 'es', 'en') // export function localize () { for (var i = 0; i < arguments.length; ++i) { var locale = arguments[i] var flatpickrLocale = FlatpickrLocaleConversions[locale] || locale if (flatpickr.l10ns[flatpickrLocale]) { flatpickr.localize(flatpickr.l10ns[flatpickrLocale]) break } } }
Version data entries
9 entries across 9 versions & 1 rubygems