From 993b840a09f0e86bc954a900099056a656c7e8e0 Mon Sep 17 00:00:00 2001 From: Matteias Collet Date: Fri, 10 Jul 2020 05:21:13 +0200 Subject: [PATCH] oopsie --- site/.vuepress/components/DownloadButton.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/site/.vuepress/components/DownloadButton.vue b/site/.vuepress/components/DownloadButton.vue index 09f98a6..29078e0 100644 --- a/site/.vuepress/components/DownloadButton.vue +++ b/site/.vuepress/components/DownloadButton.vue @@ -13,6 +13,9 @@ import ButtonComponent from './ButtonComponent'; // Data import gameVersions from '../data/gameVersions.json'; +// Util +import { translateCode } from '../i18n/localeHelper'; + export default { props: { codes: { type: Array }, @@ -84,7 +87,10 @@ export default { let data = 'Paste the following on top of your games .ini file:\r\n[Gecko]'; codes.forEach((code) => { - data += `\r\n$${code.title} (${code.date}) [${code.author}]\r\n`; + const codeTitle = + typeof code.title === 'string' ? code.title : translateCode(code, this.$lang).title; + + data += `\r\n$${codeTitle} (${code.date}) [${code.author}]\r\n`; data += code.source .match(/.{8}/g) .join(' ') @@ -97,7 +103,10 @@ export default { let data = `${version}\r\nSuper Mario Sunshine`; codes.forEach((code) => { - data += `\r\n\r\n${code.title} (${code.date}) [${code.author}]\r\n`; + const codeTitle = + typeof code.title === 'string' ? code.title : translateCode(code, this.$lang).title; + + data += `\r\n\r\n${codeTitle} (${code.date}) [${code.author}]\r\n`; data += code.source .match(/.{8}/g) .join(' ')