From 76c9228721a7fbfa872d659945cac0d6f0f7a7f1 Mon Sep 17 00:00:00 2001 From: Collin Brown Date: Tue, 8 Sep 2020 18:33:13 -0400 Subject: [PATCH] Adding button to change languages Including examples using localePath and $t --- .../containers/documents/DocumentList.vue | 2 +- .../components/organisms/layout/TheHeader.vue | 27 +++++++++++++++++++ frontend/pages/projects/_id/index.vue | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/frontend/components/containers/documents/DocumentList.vue b/frontend/components/containers/documents/DocumentList.vue index bcc776a3..9cebbb38 100644 --- a/frontend/components/containers/documents/DocumentList.vue +++ b/frontend/components/containers/documents/DocumentList.vue @@ -137,7 +137,7 @@ export default { const offset = (this.options.page - 1) * this.options.itemsPerPage const page = offset + index + 1 this.$router.push({ - path: `/projects/${this.$route.params.id}/${this.getLink}`, + path: this.localePath(`/projects/${this.$route.params.id}/${this.getLink}`), query: { page, q: this.search diff --git a/frontend/components/organisms/layout/TheHeader.vue b/frontend/components/organisms/layout/TheHeader.vue index 4e6951f1..1c7ee512 100644 --- a/frontend/components/organisms/layout/TheHeader.vue +++ b/frontend/components/organisms/layout/TheHeader.vue @@ -29,6 +29,33 @@
+ + + + + + {{ locale.name }} + + + + - Welcome to doccano! + {{ $t('home.welcome') }}