Skip to content

Commit

Permalink
- add locales for translation of what's new screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennievon committed Oct 17, 2022
1 parent 2e8aa14 commit 0fc65ac
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/components/WhatsNewModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
</template>
<script>
import Modal from '@/components/Modal'
import whatsNew from '@/assets/whats_new.json'
import Logo from '@/components/icons/Logo'
import { version } from '/package.json'
import { mapActions, mapState } from 'vuex'
Expand All @@ -87,7 +86,9 @@ export default {
currentView: 1,
hasClapped: false,
loading: false,
clapCount: 0
loadingContent: true,
clapCount: 0,
whatsNewModalContent: {}
}
},
mounted() {
Expand All @@ -105,9 +106,7 @@ export default {
appVersion() {
return version
},
whatsNewModalContent() {
return whatsNew
},
carouselLines() {
return this.whatsNewModalContent.length
}
Expand Down Expand Up @@ -153,8 +152,15 @@ export default {
}
}
},
created() {
if (this.whatsNewModalVersion !== this.appVersion) {
async created() {
if (
this.whatsNewModalVersion !== this.appVersion ||
process.env.VUE_APP_SHOW_WHATS_NEW_ALWAYS
) {
const locale = this.currentLocale || process.env.VUE_APP_DEFAULT_LOCALE
const content = await import(`@/locales/${locale}/whats_new.json`)
this.whatsNewModalContent = content.default
this.loadingContent = false
this.open = true
this.setWhatsNewModalVersion({ version: this.appVersion })
}
Expand Down
12 changes: 12 additions & 0 deletions src/locales/cb/whats_new.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"page": "1",
"title": "Did You Know...",
"description": "Change the language by going to settings?"
},
{
"page": "2",
"title": "Issues Fixed",
"content": ["Localization updates", "Easy EVM chains build", "Ledger bug fixes"]
}
]
12 changes: 12 additions & 0 deletions src/locales/en/whats_new.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"page": "1",
"title": "Did You Know...",
"description": "Change the language by going to settings?"
},
{
"page": "2",
"title": "Issues Fixed",
"content": ["Localization updates", "Easy EVM chains build", "Ledger bug fixes"]
}
]
12 changes: 12 additions & 0 deletions src/locales/es/whats_new.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"page": "1",
"title": "Did You Know...",
"description": "Change the language by going to settings?"
},
{
"page": "2",
"title": "Issues Fixed",
"content": ["Localization updates", "Easy EVM chains build", "Ledger bug fixes"]
}
]
12 changes: 12 additions & 0 deletions src/locales/ph/whats_new.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"page": "1",
"title": "Did You Know...",
"description": "Change the language by going to settings?"
},
{
"page": "2",
"title": "Issues Fixed",
"content": ["Localization updates", "Easy EVM chains build", "Ledger bug fixes"]
}
]
12 changes: 12 additions & 0 deletions src/locales/pt/whats_new.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"page": "1",
"title": "Did You Know...",
"description": "Change the language by going to settings?"
},
{
"page": "2",
"title": "Issues Fixed",
"content": ["Localization updates", "Easy EVM chains build", "Ledger bug fixes"]
}
]
12 changes: 12 additions & 0 deletions src/locales/zh/whats_new.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"page": "1",
"title": "Did You Know...",
"description": "Change the language by going to settings?"
},
{
"page": "2",
"title": "Issues Fixed",
"content": ["Localization updates", "Easy EVM chains build", "Ledger bug fixes"]
}
]

0 comments on commit 0fc65ac

Please sign in to comment.