mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 06:43:51 +02:00
i18n
This commit is contained in:
@@ -103,6 +103,7 @@
|
||||
import { acquireModalPortalLayer } from '@/lib/modalPortalLayers';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { toast } from 'vue-sonner';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import Noty from 'noty';
|
||||
|
||||
@@ -111,6 +112,7 @@
|
||||
|
||||
const galleryStore = useGalleryStore();
|
||||
const { fullscreenImageDialog } = storeToRefs(galleryStore);
|
||||
const { t } = useI18n();
|
||||
|
||||
const viewerEl = ref(null);
|
||||
const portalLayer = acquireModalPortalLayer();
|
||||
@@ -286,7 +288,7 @@
|
||||
|
||||
async function copyImageToClipboard(url) {
|
||||
if (!url) return;
|
||||
const msg = toast.info('Downloading image...');
|
||||
const msg = toast.info(t('message.image.downloading'));
|
||||
try {
|
||||
const response = await webApiService.execute({ url, method: 'GET' });
|
||||
if (response.status !== 200 || !String(response.data).startsWith('data:image/png')) {
|
||||
@@ -294,7 +296,7 @@
|
||||
}
|
||||
const blob = await (await fetch(response.data)).blob();
|
||||
await navigator.clipboard.write([new ClipboardItem({ 'image/png': blob })]);
|
||||
toast.success('Image copied to clipboard');
|
||||
toast.success(t('message.image.copied_to_clipboard'));
|
||||
} catch (error) {
|
||||
console.error('Error downloading image:', error);
|
||||
new Noty({ type: 'error', text: escapeTag(`Failed to download image. ${url}`) }).show();
|
||||
@@ -305,7 +307,7 @@
|
||||
|
||||
async function downloadAndSaveImage(url, fileName) {
|
||||
if (!url) return;
|
||||
const msg = toast.info('Downloading image...');
|
||||
const msg = toast.info(t('message.image.downloading'));
|
||||
try {
|
||||
const response = await webApiService.execute({ url, method: 'GET' });
|
||||
if (response.status !== 200 || !String(response.data).startsWith('data:image/png')) {
|
||||
|
||||
@@ -359,8 +359,8 @@
|
||||
const closeInstance = (location) => {
|
||||
modalStore
|
||||
.confirm({
|
||||
description: 'Continue? X Instance, nobody will be able to join',
|
||||
title: 'Confirm'
|
||||
description: t('confirm.close_instance'),
|
||||
title: t('confirm.title')
|
||||
})
|
||||
.then(async ({ ok }) => {
|
||||
if (!ok) return;
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: { type: String, default: '' },
|
||||
@@ -93,7 +96,9 @@
|
||||
@input="onInput" />
|
||||
|
||||
<div v-if="clearable" class="mt-3 flex justify-end">
|
||||
<Button variant="ghost" size="sm" :disabled="disabled" @click="clear"> Clear </Button>
|
||||
<Button variant="ghost" size="sm" :disabled="disabled" @click="clear">
|
||||
{{ t('view.favorite.clear') }}
|
||||
</Button>
|
||||
</div>
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
v-if="avatarDialog.ref.styles?.primary || avatarDialog.ref.styles?.secondary"
|
||||
variant="outline"
|
||||
style="margin-right: 5px; margin-top: 5px"
|
||||
>Styles
|
||||
>{{ t('view.favorite.avatars.styles') }}
|
||||
<span v-if="avatarDialog.ref.styles.primary" :class="['x-grey', 'x-tag-border-left']">{{
|
||||
avatarDialog.ref.styles.primary
|
||||
}}</span>
|
||||
@@ -841,7 +841,7 @@
|
||||
avatarId: D.id
|
||||
})
|
||||
.then((args) => {
|
||||
toast.success('Fallback avatar changed');
|
||||
toast.success(t('message.avatar.fallback_changed'));
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -854,7 +854,7 @@
|
||||
.then((args) => {
|
||||
// 'AVATAR-MODERATION';
|
||||
applyAvatarModeration(args.json);
|
||||
toast.success('Avatar blocked');
|
||||
toast.success(t('message.avatar.blocked'));
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -883,7 +883,7 @@
|
||||
})
|
||||
.then((args) => {
|
||||
applyAvatar(args.json);
|
||||
toast.success('Avatar updated to public');
|
||||
toast.success(t('message.avatar.updated_public'));
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -895,7 +895,7 @@
|
||||
})
|
||||
.then((args) => {
|
||||
applyAvatar(args.json);
|
||||
toast.success('Avatar updated to private');
|
||||
toast.success(t('message.avatar.updated_private'));
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -918,7 +918,7 @@
|
||||
sortUserDialogAvatars(array);
|
||||
}
|
||||
|
||||
toast.success('Avatar deleted');
|
||||
toast.success(t('message.avatar.deleted'));
|
||||
D.visible = false;
|
||||
return args;
|
||||
});
|
||||
@@ -929,7 +929,7 @@
|
||||
avatarId: D.id
|
||||
})
|
||||
.then((args) => {
|
||||
toast.success('Imposter deleted');
|
||||
toast.success(t('message.avatar.impostor_deleted'));
|
||||
showAvatarDialog(D.id);
|
||||
return args;
|
||||
});
|
||||
@@ -940,7 +940,7 @@
|
||||
avatarId: D.id
|
||||
})
|
||||
.then((args) => {
|
||||
toast.success('Imposter queued for creation');
|
||||
toast.success(t('message.avatar.impostor_queued'));
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -959,7 +959,7 @@
|
||||
avatarId: D.id
|
||||
})
|
||||
.then((args) => {
|
||||
toast.success('Imposter deleted and queued for creation');
|
||||
toast.success(t('message.avatar.impostor_regenerated'));
|
||||
return args;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1467,8 +1467,8 @@
|
||||
function confirmDeleteGroupPost(post) {
|
||||
modalStore
|
||||
.confirm({
|
||||
description: 'Are you sure you want to delete this post?',
|
||||
title: 'Confirm'
|
||||
description: t('confirm.delete_post'),
|
||||
title: t('confirm.title')
|
||||
})
|
||||
.then(({ ok }) => {
|
||||
if (!ok) return;
|
||||
@@ -1570,8 +1570,8 @@
|
||||
function blockGroup(groupId) {
|
||||
modalStore
|
||||
.confirm({
|
||||
description: 'Are you sure you want to block this group?',
|
||||
title: 'Confirm'
|
||||
description: t('confirm.block_group'),
|
||||
title: t('confirm.title')
|
||||
})
|
||||
.then(({ ok }) => {
|
||||
if (!ok) return;
|
||||
@@ -1591,8 +1591,8 @@
|
||||
function unblockGroup(groupId) {
|
||||
modalStore
|
||||
.confirm({
|
||||
description: 'Are you sure you want to unblock this group?',
|
||||
title: 'Confirm'
|
||||
description: t('confirm.unblock_group'),
|
||||
title: t('confirm.title')
|
||||
})
|
||||
.then(({ ok }) => {
|
||||
if (!ok) return;
|
||||
@@ -1628,9 +1628,9 @@
|
||||
getGroupDialogGroup(id);
|
||||
}
|
||||
if (args.json.membershipStatus === 'member') {
|
||||
toast.success('Group joined');
|
||||
toast.success(t('message.group.joined'));
|
||||
} else if (args.json.membershipStatus === 'requested') {
|
||||
toast.success('Group join request sent');
|
||||
toast.success(t('message.group.join_request_sent'));
|
||||
}
|
||||
return args;
|
||||
});
|
||||
|
||||
@@ -123,9 +123,11 @@
|
||||
{{ t('dialog.user.tags.discord') }}
|
||||
</Badge>
|
||||
</TooltipWrapper>
|
||||
<Badge v-if="userDialog.ref.$isTroll" variant="outline" class="x-tag-troll"> Nuisance </Badge>
|
||||
<Badge v-if="userDialog.ref.$isTroll" variant="outline" class="x-tag-troll">
|
||||
{{ t('view.settings.appearance.user_colors.trust_levels.nuisance') }}
|
||||
</Badge>
|
||||
<Badge v-if="userDialog.ref.$isProbableTroll" variant="outline" class="x-tag-troll">
|
||||
Almost Nuisance
|
||||
{{ t('view.favorite.avatars.almost_nuisance') }}
|
||||
</Badge>
|
||||
<Badge v-if="userDialog.ref.$isModerator" variant="outline" class="x-tag-vip">
|
||||
{{ t('dialog.user.tags.vrchat_team') }}
|
||||
|
||||
@@ -1062,7 +1062,7 @@
|
||||
homeLocation: D.id
|
||||
})
|
||||
.then((args) => {
|
||||
toast.success('Home world updated');
|
||||
toast.success(t('message.world.home_updated'));
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -1072,7 +1072,7 @@
|
||||
homeLocation: ''
|
||||
})
|
||||
.then((args) => {
|
||||
toast.success('Home world has been reset');
|
||||
toast.success(t('message.world.home_reset'));
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -1082,7 +1082,7 @@
|
||||
worldId: D.id
|
||||
})
|
||||
.then((args) => {
|
||||
toast.success('World has been published');
|
||||
toast.success(t('message.world.published'));
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -1092,7 +1092,7 @@
|
||||
worldId: D.id
|
||||
})
|
||||
.then((args) => {
|
||||
toast.success('World has been unpublished');
|
||||
toast.success(t('message.world.unpublished'));
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -1105,7 +1105,7 @@
|
||||
if (args.params.worldId === worldDialog.value.id && worldDialog.value.visible) {
|
||||
worldDialog.value.hasPersistData = false;
|
||||
}
|
||||
toast.success('Persistent data has been deleted');
|
||||
toast.success(t('message.world.persistent_data_deleted'));
|
||||
return args;
|
||||
});
|
||||
break;
|
||||
@@ -1127,7 +1127,7 @@
|
||||
const array = Array.from(map.values());
|
||||
userDialog.value.worlds = array;
|
||||
}
|
||||
toast.success('World has been deleted');
|
||||
toast.success(t('message.world.deleted'));
|
||||
D.visible = false;
|
||||
return args;
|
||||
});
|
||||
@@ -1365,33 +1365,33 @@
|
||||
navigator.clipboard
|
||||
.writeText(worldDialog.value.id)
|
||||
.then(() => {
|
||||
toast.success('World ID copied to clipboard');
|
||||
toast.success(t('message.world.id_copied'));
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('copy failed:', err);
|
||||
toast.error('Copy failed');
|
||||
toast.error(t('message.copy_failed'));
|
||||
});
|
||||
}
|
||||
function copyWorldUrl() {
|
||||
navigator.clipboard
|
||||
.writeText(`https://vrchat.com/home/world/${worldDialog.value.id}`)
|
||||
.then(() => {
|
||||
toast.success('World URL copied to clipboard');
|
||||
toast.success(t('message.world.url_copied'));
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('copy failed:', err);
|
||||
toast.error('Copy failed');
|
||||
toast.error(t('message.copy_failed'));
|
||||
});
|
||||
}
|
||||
function copyWorldName() {
|
||||
navigator.clipboard
|
||||
.writeText(worldDialog.value.ref.name)
|
||||
.then(() => {
|
||||
toast.success('World name copied to clipboard');
|
||||
toast.success(t('message.world.name_copied'));
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('copy failed:', err);
|
||||
toast.error('Copy failed');
|
||||
toast.error(t('message.copy_failed'));
|
||||
});
|
||||
}
|
||||
function showWorldAllowedDomainsDialog() {
|
||||
|
||||
Reference in New Issue
Block a user