0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-22 11:15:14 +00:00

Merge pull request #523 from gayolGate/main

New in-app translations (Developer mode)
This commit is contained in:
Luka 2022-08-27 13:39:41 -04:00 committed by GitHub
commit 661385ab9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 14 deletions

View file

@ -2,9 +2,9 @@
<div> <div>
<!-- Top Notice --> <!-- Top Notice -->
<center style="margin: 2em"> <center style="margin: 2em">
<h1>Registry Editor</h1> <h1>{{ lang.registryeditor }}</h1>
<v-alert text outlined type="warning"> <v-alert text outlined type="warning">
CHANGING ENTRIES MAY CAUSE YOUR APP TO BREAK! {{ lang.registrywarning }}
</v-alert> </v-alert>
</center> </center>
@ -18,7 +18,7 @@
" "
> >
<v-icon style="margin-right: 0.25em">mdi-plus</v-icon> <v-icon style="margin-right: 0.25em">mdi-plus</v-icon>
Create Entry {{ lang.createentry }}
</v-btn> </v-btn>
</center> </center>
@ -53,18 +53,18 @@
$vuetify.theme.dark ? 'background lighten-1' : 'background darken-1' $vuetify.theme.dark ? 'background lighten-1' : 'background darken-1'
" "
> >
<v-card-title class="text-h5">Confirm Delete</v-card-title> <v-card-title class="text-h5">{{ lang.confirmdelete }}</v-card-title>
<v-card-text <v-card-text
>Are you sure that you want to delete >{{ lang.areyousure }}
<span class="highlight" v-text="selectedKey" />?</v-card-text <span class="highlight" v-text="selectedKey" />?</v-card-text
> >
<v-divider /> <v-divider />
<v-card-actions> <v-card-actions>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn color="primary" text @click="deleteDialog = false" <v-btn color="primary" text @click="deleteDialog = false"
>Cancel</v-btn >{{ lang.cancel }}</v-btn
> >
<v-btn color="primary" text @click="deleteKey()">Delete</v-btn> <v-btn color="primary" text @click="deleteKey()">{{ lang.delete }}</v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
</v-dialog> </v-dialog>
@ -84,8 +84,8 @@
<v-divider /> <v-divider />
<v-card-actions> <v-card-actions>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn color="primary" text @click="editDialog = false">Cancel</v-btn> <v-btn color="primary" text @click="editDialog = false">{{ lang.cancel }}</v-btn>
<v-btn color="primary" text @click="updateKey()">Change</v-btn> <v-btn color="primary" text @click="updateKey()">{{ lang.change }}</v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
</v-dialog> </v-dialog>
@ -98,12 +98,12 @@
$vuetify.theme.dark ? 'background lighten-1' : 'background darken-1' $vuetify.theme.dark ? 'background lighten-1' : 'background darken-1'
" "
> >
<v-card-title class="text-h5">Create Registry Entry</v-card-title> <v-card-title class="text-h5">{{ lang.createentryfull }}</v-card-title>
<v-card-text> <v-card-text>
<v-text-field v-model="selectedKey" label="Key" solo /> <v-text-field v-model="selectedKey" label="{{ lang.key }}" solo />
<v-text-field <v-text-field
v-model="selectedKeyData" v-model="selectedKeyData"
label="Value" label="{{ lang.value }}"
solo solo
style="margin-bottom: -2em" style="margin-bottom: -2em"
/> />
@ -111,8 +111,8 @@
<v-divider /> <v-divider />
<v-card-actions> <v-card-actions>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn color="primary" text @click="addDialog = false">Cancel</v-btn> <v-btn color="primary" text @click="addDialog = false">{{ lang.cancel }}</v-btn>
<v-btn color="primary" text @click="createKey()">Create</v-btn> <v-btn color="primary" text @click="createKey()">{{ lang.create }}</v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
</v-dialog> </v-dialog>
@ -120,6 +120,7 @@
</template> </template>
<script> <script>
import language from "~/components/Settings/language.vue";
export default { export default {
computed: { computed: {
roundTweak() { roundTweak() {
@ -129,6 +130,7 @@ export default {
data() { data() {
return { return {
lang: { mods: { general: { language: "" } } },
keys: [], keys: [],
selectedKey: null, selectedKey: null,
@ -140,6 +142,8 @@ export default {
}, },
mounted() { mounted() {
this.syncRegistry(); this.syncRegistry();
const lang = this.$lang();
this.lang = lang.mods.general;
}, },
methods: { methods: {

View file

@ -90,6 +90,20 @@ module.exports = {
github: "GitHub", github: "GitHub",
discord: "Discord", discord: "Discord",
}, },
developer: {
registryeditor: "Registry editor",
registrywarning: "CHANGING ENTRIES MAY CAUSE YOUR APP TO BREAK!",
createentry: "Create entry",
createentryfull: "Create registry entry",
cancel: "Cancel",
create: "Create",
key: "Key",
value: "Value",
confirmdelete: "Confirm delete",
areyousure: "Are you sure that you want to delete",
delete: "Delete",
change: "Change",
},
}, },
events: { events: {

View file

@ -89,6 +89,20 @@ module.exports = {
github: "GitHub", github: "GitHub",
discord: "Discord", discord: "Discord",
}, },
developer: {
registryeditor: "Editor del registro",
registrywarning: "¡CAMBIAR ENTRADAS PODRÍA ROMPER LA APLICACIÓN!",
createentry: "Crear entrada",
createentryfull: "Crear entrada del registro",
cancel: "Cancelar",
create: "Crear",
key: "Clave",
value: "Valor",
confirmdelete: "Confirmar borrado",
areyousure: "¿Estás seguro de que quieres eliminar",
delete: "Borrar",
change: "Cambiar",
},
}, },
events: { events: {