Skip to content

Commit

Permalink
Merge pull request #7 from DaywisonSilva/master
Browse files Browse the repository at this point in the history
feat: add translations
  • Loading branch information
thauska authored Oct 28, 2022
2 parents 485d776 + ee27839 commit 53dc240
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 16 deletions.
6 changes: 1 addition & 5 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",

"octref.vetur"
],
"recommendations": ["dbaeumer.vscode-eslint", "octref.vetur"],
"unwantedRecommendations": [
"hookyqr.beautify",
"dbaeumer.jshint",
Expand Down
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"vetur.validation.template": false,
"vetur.format.enable": false,
"vetur.format.enable": true,
"eslint.validate": ["javascript", "javascriptreact", "typescript", "vue"],

"vetur.experimental.templateInterpolationService": true
"vetur.experimental.templateInterpolationService": true,
"editor.formatOnSave": false
}
38 changes: 38 additions & 0 deletions src/components/ToggleLanguage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<template>
<q-select
v-model="lang"
:options="langOptions"
:label="$t('language')"
dense
borderless
emit-value
map-options
options-dense
style="min-width: 150px"
color="purple"
label-color="white"
>
<template v-slot:prepend>
<q-icon name="translate" color="white"/>
</template>
</q-select>
</template>

<script>
export default {
data () {
return {
lang: this.$i18n.locale,
langOptions: [
{ value: 'en-us', label: 'English' },
{ value: 'pt-br', label: 'Português' }
]
}
},
watch: {
lang (lang) {
this.$i18n.locale = lang
}
}
}
</script>
14 changes: 13 additions & 1 deletion src/i18n/en-us/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,17 @@

export default {
failed: 'Action failed',
success: 'Action was successful'
success: 'Action was successful',
language: 'language',
startAugmentedReality: 'start augmented reality',
usageInfoPartOne: 'For usage instructions, click on the button',
usageInfoPartTwo: 'from the navigation bar.',
// mainTitle: "Antônio Peticov's art in Augmented Reality",
name: "Antonio Peticov's",
art: 'art',
in: 'in',
augumented: 'Augmented',
reality: 'Reality',

subtitleInfo: 'Antonio Peticov (born July 2, 1946) is a Brazilian painter, designer, sculptor, and engraver.'
}
4 changes: 3 additions & 1 deletion src/i18n/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import enUS from './en-us'
import ptBR from './pt-br'

export default {
'en-us': enUS
'en-us': enUS,
'pt-br': ptBR
}
18 changes: 18 additions & 0 deletions src/i18n/pt-br/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// This is just an example,
// so you can safely delete all default props below

export default {
failed: 'Action failed',
success: 'Action was successful',
language: 'idioma',
startAugmentedReality: 'Iniciar realidade aumentada',
usageInfoPartOne: 'Para instruções de uso, clique no botão',
usageInfoPartTwo: 'da barra de navegação.',
mainTitle: 'A arte de Antônio Peticov em Realidade Aumentada',
name: 'Antonio Peticov',
art: 'arte',
in: 'de',
augumented: 'Aumentada',
reality: 'Realidade',
subtitleInfo: 'Antonio Peticov (nascido em 2 de julho de 1946) é um pintor, desenhista, escultor e gravador brasileiro.'
}
5 changes: 3 additions & 2 deletions src/layouts/MainLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</q-toolbar-title>

<q-btn flat round dense icon="info" @click="dialog = true" />

<toggle-language class="q-ml-sm"/>
</q-toolbar>
</q-header>

Expand Down Expand Up @@ -57,6 +57,7 @@

<script>
import EssentialLink from 'components/EssentialLink.vue'
import ToggleLanguage from 'components/ToggleLanguage.vue'
import readme from '../../README.md'
const linksData = [
Expand All @@ -70,7 +71,7 @@ const linksData = [
export default {
name: 'MainLayout',
components: { EssentialLink },
components: { EssentialLink, ToggleLanguage },
data () {
return {
readme: readme,
Expand Down
12 changes: 8 additions & 4 deletions src/pages/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,24 @@
</div>
<div class="col q-pt-md">
<p class="text-h4 text-bold text-black text-center">
<span class="bottom-dotted">Antônio Peticov's</span> art in Augmented Reality
<span class="bottom-dotted">{{$t('name')}}</span> {{$t('art')}} {{$t('in')}}

<span v-if="this.$i18n.locale === 'en-us'"> {{$t('augumented')}} {{$t('reality')}}</span>
<span v-else>{{$t('reality')}} {{$t('augumented')}}</span>

<q-tooltip anchor="top left" self="center middle">
Antonio Peticov (born July 2, 1946) is a Brazilian painter, designer, sculptor, and engraver.
{{$t('subtitleInfo')}}
</q-tooltip>
</p>
</div>
<div class="col text-justify">
<p class="text-body1">For usage instructions, click on the button <span><q-icon size="sm" name="info" /></span> from the navigation bar.</p>
<p class="text-body1">{{$t('usageInfoPartOne')}} <span><q-icon size="sm" name="info" /></span> {{$t('usageInfoPartTwo')}}</p>
</div>
<div class="col q-pa-md">
<q-btn color="purple" glossy
class="q-mt-xs text-no-wrap"
push
label="Iniciar realidade aumentada"
:label="$t('startAugmentedReality')"
to="/ar"
/>
</div>
Expand Down

0 comments on commit 53dc240

Please sign in to comment.