]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/helpers/Technique.js
add language references to tech pages
[alttp.git] / resources / js / helpers / Technique.js
index 1a8f4fc91f0fe92d3bb874816340eab8d4be9ef6..c1375bb6c787810119c624aa7de5169aafd3e65d 100644 (file)
@@ -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,