mirror of
https://github.com/manyfold3d/manyfold.git
synced 2026-10-22 11:42:19 -05:00
14 lines
359 B
TypeScript
14 lines
359 B
TypeScript
import { Controller } from '@hotwired/stimulus'
|
|
|
|
// Load i18n definitions
|
|
import { I18n } from 'i18n-js'
|
|
import locales from '../src/locales.json'
|
|
|
|
// Connects to data-controller="i18n"
|
|
export default class extends Controller {
|
|
connect (): void {
|
|
window.i18n = new I18n(locales)
|
|
window.i18n.locale = (this.element as HTMLElement).lang ?? 'en'
|
|
}
|
|
}
|