diff --git a/src/data/translations.json b/src/data/translations.json index c0563c7..f4b051b 100644 --- a/src/data/translations.json +++ b/src/data/translations.json @@ -1,5 +1,6 @@ { "en" : { + "name": "English", "calls" : { "apprentice_seer" : "*Apprentice Seer, open your eyes.", "aura_seer" : "Aura Seer open your eyes, check a player.", @@ -169,6 +170,7 @@ }, "es" : { + "name": "Español", "calls" : { "apprentice_seer" : "*Aprendiz Vidente, abre tus ojos.", "aura_seer" : "Vidente Aura levántate, verifica un jugador.", diff --git a/src/languages.js b/src/languages.js index e650c43..0ea273d 100644 --- a/src/languages.js +++ b/src/languages.js @@ -1,7 +1,11 @@ const languages = require('./data/translations'); exports.get = (lang = 'en') => languages[lang] || {}; -exports.getLanguages = () => Object.keys(languages); +exports.getLanguages = () => Object.keys(languages).map(k => ({ + key: k, + value: languages[k].name +})); + exports.translateDeck = function translateDeck(deck, lang = 'en') { const pack = languages[lang]; const cards = Object.keys(deck);