This commit is contained in:
2025-03-18 12:21:21 +02:00
parent eaa46eeda8
commit 1f6ee77c24
17 changed files with 407 additions and 275 deletions
+63 -34
View File
@@ -1,5 +1,39 @@
const lang = {
bg0: {
en: {
_code: 'en',
createGameObject: 'Add game object',
editGameObject: 'Edit game object',
name: 'Name',
description: 'Description',
fieldRequired: 'Field is required',
objectType: 'Object type',
objectFile: 'File',
panorama2d: 'Panorama picture',
environment3d: 'Environment',
object3d: '3D object',
object2d: '2D object (picture)',
audio: 'Audio',
video: 'Video',
player3d: 'Player',
save: 'Save',
saveAndPreview: 'Save and preview',
preview: 'Preview',
captureThumbnail: 'Save thumbnail',
publish: 'Publish',
gameObjects: 'Objects',
gameScenarios: 'Scenarios',
gameRules: 'Rules',
games: 'Games',
darkMode: 'Dark mode',
confirmDeletionOf: 'Confirm deletion of',
yes: 'Yes',
no: 'No',
createScenario: 'Create scenario',
editScenario: 'Edit scenario',
addScene: 'Add scene'
},
bg: {
_code: 'bg',
createGameObject: 'Добавяне на игрови обект',
editGameObject: 'Редактиране на игрови обект',
name: 'Име',
@@ -14,6 +48,7 @@ const lang = {
audio: 'Аудио',
video: 'Видео',
player3d: 'Играч',
save: 'Запис',
saveAndPreview: 'Запис и преглед',
preview: 'Преглед',
captureThumbnail: 'Save thumbnail',
@@ -30,43 +65,37 @@ const lang = {
editScenario: 'Редактиране на сценарий',
addScene: 'Добавяне на сцена'
},
bg: {
createGameObject: 'Add game object',
editGameObject: 'Edit game object',
name: 'Name',
description: 'Description',
fieldRequired: 'Field is required',
objectType: 'Object type',
objectFile: 'File',
panorama2d: 'Panorama picture',
environment3d: 'Environment',
object3d: '3D object',
object2d: '2D object (picture)',
audio: 'Audio',
video: 'Video',
player3d: 'Player',
saveAndPreview: 'Save and preview',
preview: 'Preview',
captureThumbnail: 'Save thumbnail',
publish: 'Publish',
gameObjects: 'Objects',
gameScenarios: 'Scenarios',
gameRules: 'Rules',
games: 'Games',
darkMode: 'Dark mode',
confirmDeletionOf: 'Confirm deletion of',
yes: 'Yes',
no: 'No',
createScenario: 'Create scenario',
editScenario: 'Edit scenario',
addScene: 'Add scene'
}
}
import { ref } from 'vue';
export default {
install: (app, options) => {
// inject a globally available $translate() method
app.config.globalProperties.$l = lang.bg
}
app.config.globalProperties.$lang = ref('bg');
// app.config.globalProperties.$l = computed(()=>lang[app.config.globalProperties.$lang]);
app.mixin({
data(){
return {
}
},
created(){
},
computed:{
lang:{
get(){
return app.config.globalProperties.$lang.value
},
set(v){
app.config.globalProperties.$lang.value = v
}
},
l(){
return lang[this.lang];
}
}
})
},
}