fix(ui): [WIP] remove translation mechanism

TODO: Replace with
This commit is contained in:
upsiflu 2024-12-09 14:33:24 +01:00
parent ebc85d2a19
commit 10683f327c
1 changed files with 47 additions and 30 deletions

View File

@ -5,7 +5,7 @@ import { uniq } from 'lodash-es'
import { useVModel } from '@vueuse/core' import { useVModel } from '@vueuse/core'
import { ref, computed, watch, nextTick } from 'vue' import { ref, computed, watch, nextTick } from 'vue'
import { useStore } from '~/store' import { useStore } from '~/store'
import { useGettext } from 'vue3-gettext' // import { useGettext } from 'vue3-gettext'
interface Props { interface Props {
show: boolean show: boolean
@ -32,7 +32,10 @@ const suggestedInstances = computed(() => {
watch(() => store.state.instance.instanceUrl, () => store.dispatch('instance/fetchSettings')) watch(() => store.state.instance.instanceUrl, () => store.dispatch('instance/fetchSettings'))
const { $pgettext } = useGettext()
// TODO: replace translation mechanism { $pgettext } with { t }
// const { $pgettext } = useGettext()
const isError = ref(false) const isError = ref(false)
const isLoading = ref(false) const isLoading = ref(false)
const checkAndSwitch = async (url: string) => { const checkAndSwitch = async (url: string) => {
@ -45,7 +48,8 @@ const checkAndSwitch = async (url: string) => {
show.value = false show.value = false
store.commit('ui/addMessage', { store.commit('ui/addMessage', {
content: $pgettext('*/Instance/Message', 'You are now using the Funkwhale instance at %{ url }', { url: instanceUrl }), content: 'You are now using the Funkwhale instance at %{ url }',
// $pgettext('*/Instance/Message', 'You are now using the Funkwhale instance at %{ url }', { url: instanceUrl }),
date: new Date() date: new Date()
}) })
@ -65,9 +69,10 @@ const checkAndSwitch = async (url: string) => {
@update:show="isError = false" @update:show="isError = false"
> >
<h3 class="header"> <h3 class="header">
<translate translate-context="Popup/Instance/Title"> <!-- TODO: translate -->
Choose your instance Choose your instance
</translate> <!-- <translate translate-context="Popup/Instance/Title">
</translate> -->
</h3> </h3>
<div class="scrolling content"> <div class="scrolling content">
<div <div
@ -76,20 +81,23 @@ const checkAndSwitch = async (url: string) => {
class="ui negative message" class="ui negative message"
> >
<h4 class="header"> <h4 class="header">
<translate translate-context="Popup/Instance/Error message.Title"> <!-- TODO: translate -->
It is not possible to connect to the given URL It is not possible to connect to the given URL
</translate> <!-- <translate translate-context="Popup/Instance/Error message.Title">
</translate> -->
</h4> </h4>
<ul class="list"> <ul class="list">
<li> <li>
<translate translate-context="Popup/Instance/Error message.List item"> <!-- TODO: translate -->
The server might be down The server might be down
</translate> <!-- <translate translate-context="Popup/Instance/Error message.List item">
</translate> -->
</li> </li>
<li> <li>
<translate translate-context="Popup/Instance/Error message.List item"> <!-- TODO: translate -->
The given address is not a Funkwhale server The given address is not a Funkwhale server
</translate> <!-- <translate translate-context="Popup/Instance/Error message.List item">
</translate> -->
</li> </li>
</ul> </ul>
</div> </div>
@ -98,8 +106,8 @@ const checkAndSwitch = async (url: string) => {
@submit.prevent="checkAndSwitch(instanceUrl)" @submit.prevent="checkAndSwitch(instanceUrl)"
> >
<p <p
v-if="$store.state.instance.instanceUrl" v-if="store.state.instance.instanceUrl"
v-translate="{url: $store.state.instance.instanceUrl, hostname: $store.getters['instance/domain'] }" v-translate="{url: store.state.instance.instanceUrl, hostname: store.getters['instance/domain'] }"
class="description" class="description"
translate-context="Popup/Login/Paragraph" translate-context="Popup/Login/Paragraph"
> >
@ -109,12 +117,17 @@ const checkAndSwitch = async (url: string) => {
>%{ hostname }&nbsp;<i class="external icon" /></a>. If you continue, you will be disconnected from your current instance and all your local data will be deleted. >%{ hostname }&nbsp;<i class="external icon" /></a>. If you continue, you will be disconnected from your current instance and all your local data will be deleted.
</p> </p>
<p v-else> <p v-else>
<translate translate-context="Popup/Instance/Paragraph"> <!-- TODO: translate -->
To continue, please select the Funkwhale instance you want to connect to. Enter the address directly, or select one of the suggested choices. To continue, please select the Funkwhale instance you want to connect to. Enter the address directly, or select one of the suggested choices.
</translate> <!-- <translate translate-context="Popup/Instance/Paragraph">
</translate> -->
</p> </p>
<div class="field"> <div class="field">
<label for="instance-picker"><translate translate-context="Popup/Instance/Input.Label/Noun">Instance URL</translate></label> <label for="instance-picker">
<!-- TODO: translate -->
<!-- <translate translate-context="Popup/Instance/Input.Label/Noun">Instance URL</translate>
-->
</label>
<div class="ui action input"> <div class="ui action input">
<input <input
id="instance-picker" id="instance-picker"
@ -126,9 +139,10 @@ const checkAndSwitch = async (url: string) => {
type="submit" type="submit"
:class="['ui', 'icon', {loading: isLoading}, 'button']" :class="['ui', 'icon', {loading: isLoading}, 'button']"
> >
<translate translate-context="*/*/Button.Label/Verb"> <!-- TODO: translate -->
Submit Submit
</translate> <!-- <translate translate-context="*/*/Button.Label/Verb">
</translate> -->
</button> </button>
</div> </div>
</div> </div>
@ -140,9 +154,10 @@ const checkAndSwitch = async (url: string) => {
> >
<div class="field"> <div class="field">
<h4> <h4>
<translate translate-context="Popup/Instance/List.Label"> <!-- TODO: translate -->
Suggested choices Suggested choices
</translate> <!-- <translate translate-context="Popup/Instance/List.Label">
</translate> -->
</h4> </h4>
<button <button
v-for="(url, key) in suggestedInstances" v-for="(url, key) in suggestedInstances"
@ -157,9 +172,11 @@ const checkAndSwitch = async (url: string) => {
</div> </div>
<div class="actions"> <div class="actions">
<button class="ui basic cancel button"> <button class="ui basic cancel button">
<translate translate-context="*/*/Button.Label/Verb">
Cancel <!-- TODO: translate -->
</translate> Cancel
<!-- <translate translate-context="*/*/Button.Label/Verb">
</translate> -->
</button> </button>
</div> </div>
</semantic-modal> </semantic-modal>