- {{ merchandise.gear.name }}
+ {{ gearName }}
@@ -36,7 +36,7 @@
-
![]()
+

@@ -55,10 +55,10 @@
-
{{ merchandise.gear.brand.name }}
+
{{ brandName }}
-
![]()
+
Common Ability
@@ -76,5 +76,28 @@
diff --git a/src/js/components/splatoon/NewWeaponBox.vue b/src/js/components/splatoon/NewWeaponBox.vue
index 6d5af95..9e0090c 100644
--- a/src/js/components/splatoon/NewWeaponBox.vue
+++ b/src/js/components/splatoon/NewWeaponBox.vue
@@ -7,13 +7,13 @@
-
+
-
+
- {{ weapon.name }}
+ {{ name }}
@@ -38,5 +38,18 @@ export default {
weapon: {},
title: { default: 'New Weapon' },
},
+ computed: {
+ name() {
+ return this.$t(`splatnet.weapons.${this.weapon.id}.name`, this.weapon.name);
+ },
+ subName() {
+ let sub = this.weapon.sub;
+ return 'Sub: ' + this.$t(`splatnet.weapon_subs.${sub.id}.name`, sub.name);
+ },
+ specialName() {
+ let special = this.weapon.special;
+ return 'Special: ' + this.$t(`splatnet.weapon_specials.${special.id}.name`, special.name);
+ },
+ }
}
diff --git a/src/js/components/splatoon/SalmonRunBox.vue b/src/js/components/splatoon/SalmonRunBox.vue
index bec9b1a..777edc6 100644
--- a/src/js/components/splatoon/SalmonRunBox.vue
+++ b/src/js/components/splatoon/SalmonRunBox.vue
@@ -25,7 +25,7 @@
This month's gear
-
+
@@ -139,6 +139,12 @@ export default {
if (this.allSchedules.length > 0 && this.allSchedules[0].start_time <= this.now)
return this.allSchedules[0];
},
+ rewardGearName() {
+ if (this.coop.reward_gear) {
+ let gear = this.coop.reward_gear.gear;
+ return this.$t(`splatnet.gear.${gear.id}.name`, gear.name);
+ }
+ },
},
}
diff --git a/src/js/components/splatoon/SalmonRunDetailsBar.vue b/src/js/components/splatoon/SalmonRunDetailsBar.vue
index 4a405cb..8ee4875 100644
--- a/src/js/components/splatoon/SalmonRunDetailsBar.vue
+++ b/src/js/components/splatoon/SalmonRunDetailsBar.vue
@@ -1,11 +1,11 @@
-
+
- {{ schedule.stage.name }}
+ {{ stageName }}
@@ -15,7 +15,7 @@
@@ -31,5 +31,11 @@ import Stage from './Stage.vue';
export default {
components: { Stage },
props: ['schedule', 'mini'],
+ computed: {
+ stageName() {
+ let stage = this.schedule.stage;
+ return this.$t(`splatnet.coop_stages.${stage.image}.name`, stage.name);
+ },
+ },
}
diff --git a/src/js/components/splatoon/ScheduleBox.vue b/src/js/components/splatoon/ScheduleBox.vue
index a563a6d..a4b3b8f 100644
--- a/src/js/components/splatoon/ScheduleBox.vue
+++ b/src/js/components/splatoon/ScheduleBox.vue
@@ -5,7 +5,7 @@
-
{{ currentSchedule.rule.name }}
+
{{ currentRuleName }}
@@ -79,6 +79,10 @@ export default {
if (this.schedules && this.schedules[0] && this.schedules[0].start_time <= this.now)
return this.schedules[0];
},
+ currentRuleName() {
+ let rule = this.currentSchedule.rule;
+ return this.$t(`splatnet.rules.${rule.key}.name`, rule.name);
+ },
upcomingSchedules() {
if (this.schedules) {
if (this.currentSchedule)
diff --git a/src/js/components/splatoon/ScheduleRow.vue b/src/js/components/splatoon/ScheduleRow.vue
index 35b2c88..09b2ae5 100644
--- a/src/js/components/splatoon/ScheduleRow.vue
+++ b/src/js/components/splatoon/ScheduleRow.vue
@@ -2,7 +2,7 @@
-
{{ schedule.rule.name }}
+
{{ ruleName }}
@@ -21,7 +21,7 @@
-
{{ schedule.rule.name }}
+
{{ ruleName }}
in {{ schedule.start_time - now | duration }}
@@ -57,6 +57,10 @@ export default {
let start = new Date(this.schedule.start_time * 1000);
return (now.getDate() == start.getDate() && now.getMonth() == start.getMonth() && now.getFullYear() == start.getFullYear());
},
+ ruleName() {
+ let rule = this.schedule.rule;
+ return this.$t(`splatnet.rules.${rule.key}.name`, rule.name);
+ },
ruleNameClass() { return this.smallSize ? 'is-6' : 'is-5' },
scheduleClass() { return this.smallSize ? 'is-7' : 'is-6' },
}
diff --git a/src/js/components/splatoon/SplatfestBox.vue b/src/js/components/splatoon/SplatfestBox.vue
index 46da8b8..b2816fc 100644
--- a/src/js/components/splatoon/SplatfestBox.vue
+++ b/src/js/components/splatoon/SplatfestBox.vue
@@ -13,11 +13,11 @@
- {{ festival.names.alpha_short }}
+ {{ $t(`splatnet.festivals.${festival.festival_id}.names.alpha_short`, festival.names.alpha_short) }}
- {{ festival.names.bravo_short }}
+ {{ $t(`splatnet.festivals.${festival.festival_id}.names.bravo_short`, festival.names.bravo_short) }}
diff --git a/src/js/components/splatoon/SplatfestResultsBox.vue b/src/js/components/splatoon/SplatfestResultsBox.vue
index 3fbadf6..b46aeae 100644
--- a/src/js/components/splatoon/SplatfestResultsBox.vue
+++ b/src/js/components/splatoon/SplatfestResultsBox.vue
@@ -6,7 +6,7 @@
-
diff --git a/src/js/components/splatoon/Stage.vue b/src/js/components/splatoon/Stage.vue
index 9912764..7e93b5d 100644
--- a/src/js/components/splatoon/Stage.vue
+++ b/src/js/components/splatoon/Stage.vue
@@ -1,7 +1,7 @@
-
{{ stageDetails.name }}
+
{{ name }}
@@ -10,7 +10,7 @@
- {{ stageDetails.name }}
+ {{ name }}
@@ -35,6 +35,7 @@ export default {
stage: {},
showTitle: { default: true },
clickable: { default: true },
+ isSalmonRun: { default: false },
},
data() {
return {
@@ -48,6 +49,12 @@ export default {
return Object.assign({}, SplatoonStages.find(stage => stage.id === this.stage.id), this.stage);
}
},
+ name() {
+ if (this.isSalmonRun)
+ return this.$t(`splatnet.coop_stages.${this.stage.image}.name`, this.stage.name);
+
+ return this.$t(`splatnet.stages.${this.stageDetails.id}.name`, this.stageDetails.name);
+ },
image() {
if (this.stageDetails)
return Vue.filter('localSplatNetImageUrl')(this.stageDetails.image);
diff --git a/src/js/i18n/index.js b/src/js/i18n/index.js
new file mode 100644
index 0000000..4221e90
--- /dev/null
+++ b/src/js/i18n/index.js
@@ -0,0 +1,8 @@
+import Vue from 'vue';
+import VuexI18n from 'vuex-i18n';
+import store from '../store';
+
+Vue.use(VuexI18n.plugin, store);
+
+Vue.i18n.set('en');
+Vue.i18n.fallback('en');
diff --git a/src/js/main.js b/src/js/main.js
index a4ec2d8..4e57fb3 100644
--- a/src/js/main.js
+++ b/src/js/main.js
@@ -1,10 +1,16 @@
import Vue from 'vue';
+import store from './store';
+
+import './i18n';
import './directives.js';
import './filters.js';
// Start the Vue app with our root component
import App from './components/App.vue';
-new Vue(App).$mount('#app');
+new Vue({
+ render: h => h(App),
+ store,
+}).$mount('#app');
// Start analytics
require('./analytics');
diff --git a/src/js/screenshots.js b/src/js/screenshots.js
index d596d02..c0c0fc3 100644
--- a/src/js/screenshots.js
+++ b/src/js/screenshots.js
@@ -1,6 +1,9 @@
// Entry point for the automated screenshots page
import Vue from 'vue';
+import store from './store';
+
+import './i18n';
import './directives.js';
import './filters.js';
@@ -27,6 +30,7 @@ const router = new VueRouter({ routes });
import Screenshots from './components/Screenshots.vue';
new Vue({
render: h => h(Screenshots),
+ store,
router,
}).$mount('#app');
diff --git a/src/js/store/index.js b/src/js/store/index.js
new file mode 100644
index 0000000..8c69f5d
--- /dev/null
+++ b/src/js/store/index.js
@@ -0,0 +1,10 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+
+Vue.use(Vuex);
+
+const debug = process.env.NODE_ENV !== 'production';
+
+export default new Vuex.Store({
+ strict: debug,
+});
diff --git a/yarn.lock b/yarn.lock
index d2846ff..cf3d85c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5426,6 +5426,14 @@ vue@^2.4.2:
version "2.5.6"
resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.6.tgz#73654fefa4b37f25dfc657b8b834b44c90822cd7"
+vuex-i18n@^1.8.0:
+ version "1.8.0"
+ resolved "https://registry.yarnpkg.com/vuex-i18n/-/vuex-i18n-1.8.0.tgz#9a13983fd6ed88f1d8510831364b230083c1df72"
+
+vuex@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/vuex/-/vuex-3.0.1.tgz#e761352ebe0af537d4bb755a9b9dc4be3df7efd2"
+
watchpack@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.4.0.tgz#4a1472bcbb952bd0a9bb4036801f954dfb39faac"