]> git.localhorst.tv Git - alttp.git/blob - resources/js/helpers/Technique.js
technique translations
[alttp.git] / resources / js / helpers / Technique.js
1 export const getTranslation = (tech, prop, lang) => {
2         const direct = tech.translations.find(t => t.locale === lang);
3         if (direct) {
4                 return direct[prop];
5         }
6         const sameLang = tech.translations.find(t => t.locale.substr(0, 2) === lang.substr(0, 2));
7         if (sameLang) {
8                 return sameLang[prop];
9         }
10         return tech[prop];
11 };
12
13 export default {
14         getTranslation,
15 };