docbrown/app/javascript/__support__/i18n.js
PJ 9754d14182
Fix intermittently broken reaction images on home feed (#19779)
* move reaction icons to base layout

* fix reactions count specs??

* also fix article specs
2023-07-27 19:48:07 +01:00

18 lines
574 B
JavaScript

//Load the package
const fs = require('fs');
const yaml = require('js-yaml');
//Read the Yaml file
const locale = './config/locales/en.yml';
const data = fs.readFileSync(locale, 'utf8');
const yamlData = yaml.load(data);
document.body.innerHTML += `<div id="i18n-translations"></div>`;
document.getElementById('i18n-translations').dataset.translations =
JSON.stringify(yamlData);
export function i18nSupport() {
// this function doesn't really do anything
// so long as you load this module before the 'locale' utility
// the div will be there when it needs it
}