Skip to content
This repository was archived by the owner on Apr 19, 2023. It is now read-only.

Commit 203bd23

Browse files
✨ Basic I18N
1 parent 632fd9e commit 203bd23

File tree

5 files changed

+34
-2
lines changed

5 files changed

+34
-2
lines changed

components/Translate.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<span>{{ en[t] }}</span>
3+
</template>
4+
5+
<script lang="ts">
6+
import { Component, Vue, Prop } from "vue-property-decorator";
7+
import flat from "flat";
8+
import en from "@/locales/en";
9+
10+
@Component
11+
export default class Translate extends Vue {
12+
en = flat(en);
13+
@Prop({ required: true }) t;
14+
}
15+
</script>

locales/en.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,12 @@ export default {
108108
10: "October",
109109
11: "November",
110110
12: "December"
111+
},
112+
pages: {
113+
index: {
114+
hero: {
115+
title: "Staart is a SaaS starter for your next big idea."
116+
}
117+
}
111118
}
112119
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"countries-and-timezones": "^1.0.1",
2424
"date-fns": "^1.30.1",
2525
"downloadjs": "^1.4.7",
26+
"flat": "^4.1.0",
2627
"hashids": "^1.2.2",
2728
"jwt-decode": "^2.2.0",
2829
"meta-ctrl-enter": "^1.0.2",

pages/index.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="container">
55
<div class="row">
66
<div>
7-
<h1>Staart is a SaaS starter for your next big idea.</h1>
7+
<h1><Translate t="pages.index.hero.title" /></h1>
88
<p style="max-width: 500px">
99
Written in TypeScript and Vue, Staart gives you a 6-month
1010
headstart in building your SaaS product. Free and open-source.
@@ -452,6 +452,7 @@ import {
452452
faVuejs,
453453
faAccessibleIcon
454454
} from "@fortawesome/free-brands-svg-icons";
455+
import Translate from "@/components/Translate.vue";
455456
library.add(
456457
faSync,
457458
faMagic,
@@ -480,6 +481,7 @@ library.add(
480481
isAuthenticated: "auth/isAuthenticated"
481482
}),
482483
components: {
484+
Translate,
483485
FontAwesomeIcon
484486
}
485487
})

yarn.lock

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4401,6 +4401,13 @@ flat-cache@^2.0.1:
44014401
rimraf "2.6.3"
44024402
write "1.0.3"
44034403

4404+
flat@^4.1.0:
4405+
version "4.1.0"
4406+
resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.0.tgz#090bec8b05e39cba309747f1d588f04dbaf98db2"
4407+
integrity sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==
4408+
dependencies:
4409+
is-buffer "~2.0.3"
4410+
44044411
flatted@^2.0.0:
44054412
version "2.0.0"
44064413
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916"
@@ -5284,7 +5291,7 @@ is-buffer@^1.1.5:
52845291
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
52855292
integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==
52865293

5287-
is-buffer@^2.0.2:
5294+
is-buffer@^2.0.2, is-buffer@~2.0.3:
52885295
version "2.0.3"
52895296
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725"
52905297
integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==

0 commit comments

Comments
 (0)