X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fhelpers%2FTechnique.js;h=c1375bb6c787810119c624aa7de5169aafd3e65d;hb=52424eef6a48c5019d48cea8e38daa8375660b29;hp=1a8f4fc91f0fe92d3bb874816340eab8d4be9ef6;hpb=a66d944386be0800f8f60644adbac721d9f77dd1;p=alttp.git diff --git a/resources/js/helpers/Technique.js b/resources/js/helpers/Technique.js index 1a8f4fc..c1375bb 100644 --- a/resources/js/helpers/Technique.js +++ b/resources/js/helpers/Technique.js @@ -17,6 +17,8 @@ export const getRelations = (tech, type) => { export const hasRelations = (tech, type) => getRelations(tech, type).length > 0; +export const getLanguages = tech => ['en', ...tech.translations.map(t => t.locale)]; + export const getTranslation = (tech, prop, lang) => { const direct = tech.translations.find(t => t.locale === lang); if (direct) { @@ -36,6 +38,7 @@ export const sorted = (techs) => [...techs].sort(compareTranslation('title', i18 export default { compareTranslation, + getLanguages, getRelations, getTranslation, hasRelations,