UNPKG

@naturalcycles/js-lib

Version:

Standard library for universal (browser + Node.js) javascript

15 lines (14 loc) 317 B
/** * Use `baseUrl` to prefix your language files. * Example URL structure: * ${baseUrl}/${locale}.json */ export class FetchTranslationLoader { fetcher; constructor(fetcher) { this.fetcher = fetcher; } async load(locale) { return await this.fetcher.get(`${locale}.json`); } }