qlik-oss/sn-org-chart

View on GitHub
src/locale/src/translations.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import all from "../all.json";

export default function autoRegister(translator) {
  if (translator && translator.get && translator.add) {
    const t = "Object.OrgChart.MaxData";
    const g = translator.get(t);
    // if translated string is different from its id
    // assume translations already exists for current locale
    if (g !== t) {
      return;
    }

    Object.keys(all).forEach((key) => {
      translator.add(all[key]);
    });
  }
}