This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Zaimki/src/translator.js

15 lines
341 B
JavaScript
Raw Normal View History

import translations from '../data/translations.suml';
export default key => {
let value = translations;
for (let part of key.split('.')) {
value = value[part];
if (value === undefined) {
console.error('Cannot find translation: ' + key);
return undefined;
}
}
return value;
}