feat: finish new i18n translation format

This commit is contained in:
liyasthomas
2021-08-19 00:10:57 +05:30
parent ceb8bdf0fd
commit c1ce90dad0
66 changed files with 755 additions and 802 deletions

View File

@@ -42,7 +42,7 @@
</Pane>
<Pane class="hide-scrollbar !overflow-auto">
<AppSection label="response">
<RealtimeLog :title="$t('log')" :log="log" />
<RealtimeLog :title="$t('mqtt.log')" :log="log" />
</AppSection>
</Pane>
</Splitpanes>
@@ -199,7 +199,7 @@ export default defineComponent({
this.connectingState = true
this.log = [
{
payload: this.$t("connecting_to", { name: this.url }),
payload: this.$t("state.connecting_to", { name: this.url }),
source: "info",
color: "var(--accent-color)",
ts: new Date().toLocaleTimeString(),
@@ -237,12 +237,12 @@ export default defineComponent({
this.connectingState = false
this.connectionState = true
this.log.push({
payload: this.$t("connected_to", { name: this.url }),
payload: this.$t("state.connected_to", { name: this.url }),
source: "info",
color: "var(--accent-color)",
ts: new Date().toLocaleTimeString(),
})
this.$toast.success(this.$t("connected"), {
this.$toast.success(this.$t("state.connected"), {
icon: "sync",
})
},
@@ -265,7 +265,7 @@ export default defineComponent({
this.manualDisconnect = true
this.client.disconnect()
this.log.push({
payload: this.$t("disconnected_from", { name: this.url }),
payload: this.$t("state.disconnected_from", { name: this.url }),
source: "info",
color: "#ff5555",
ts: new Date().toLocaleTimeString(),
@@ -275,7 +275,7 @@ export default defineComponent({
this.connectingState = false
this.connectionState = false
if (this.manualDisconnect) {
this.$toast.error(this.$t("disconnected"), {
this.$toast.error(this.$t("state.disconnected"), {
icon: "sync_disabled",
})
} else {

View File

@@ -61,7 +61,7 @@
</Pane>
<Pane class="hide-scrollbar !overflow-auto">
<AppSection label="response">
<RealtimeLog :title="$t('log')" :log="communication.log" />
<RealtimeLog :title="$t('socketio.log')" :log="communication.log" />
</AppSection>
</Pane>
</Splitpanes>
@@ -219,7 +219,7 @@ export default defineComponent({
this.connectingState = true
this.communication.log = [
{
payload: this.$t("connecting_to", { name: this.url }),
payload: this.$t("state.connecting_to", { name: this.url }),
source: "info",
color: "var(--accent-color)",
},
@@ -239,13 +239,13 @@ export default defineComponent({
this.connectionState = true
this.communication.log = [
{
payload: this.$t("connected_to", { name: this.url }),
payload: this.$t("state.connected_to", { name: this.url }),
source: "info",
color: "var(--accent-color)",
ts: new Date().toLocaleTimeString(),
},
]
this.$toast.success(this.$t("connected"), {
this.$toast.success(this.$t("state.connected"), {
icon: "sync",
})
})
@@ -270,12 +270,12 @@ export default defineComponent({
this.connectingState = false
this.connectionState = false
this.communication.log.push({
payload: this.$t("disconnected_from", { name: this.url }),
payload: this.$t("state.disconnected_from", { name: this.url }),
source: "info",
color: "#ff5555",
ts: new Date().toLocaleTimeString(),
})
this.$toast.error(this.$t("disconnected"), {
this.$toast.error(this.$t("state.disconnected"), {
icon: "sync_disabled",
})
})

View File

@@ -70,7 +70,7 @@
<AppSection label="response">
<ul>
<li>
<RealtimeLog :title="$t('log')" :log="events.log" />
<RealtimeLog :title="$t('sse.log')" :log="events.log" />
<div id="result"></div>
</li>
</ul>
@@ -137,7 +137,7 @@ export default {
this.connectingState = true
this.events.log = [
{
payload: this.$t("connecting_to", { name: this.server }),
payload: this.$t("state.connecting_to", { name: this.server }),
source: "info",
color: "var(--accent-color)",
},
@@ -150,13 +150,13 @@ export default {
this.connectionSSEState = true
this.events.log = [
{
payload: this.$t("connected_to", { name: this.server }),
payload: this.$t("state.connected_to", { name: this.server }),
source: "info",
color: "var(--accent-color)",
ts: new Date().toLocaleTimeString(),
},
]
this.$toast.success(this.$t("connected"), {
this.$toast.success(this.$t("state.connected"), {
icon: "sync",
})
}
@@ -166,12 +166,14 @@ export default {
this.sse.onclose = () => {
this.connectionSSEState = false
this.events.log.push({
payload: this.$t("disconnected_from", { name: this.server }),
payload: this.$t("state.disconnected_from", {
name: this.server,
}),
source: "info",
color: "#ff5555",
ts: new Date().toLocaleTimeString(),
})
this.$toast.error(this.$t("disconnected"), {
this.$toast.error(this.$t("state.disconnected"), {
icon: "sync_disabled",
})
}
@@ -191,7 +193,7 @@ export default {
} else {
this.events.log = [
{
payload: this.$t("browser_support_sse"),
payload: this.$t("error.browser_support_sse"),
source: "info",
color: "#ff5555",
ts: new Date().toLocaleTimeString(),

View File

@@ -142,7 +142,10 @@
</Pane>
<Pane class="hide-scrollbar !overflow-auto">
<AppSection label="response">
<RealtimeLog :title="$t('log')" :log="communication.log" />
<RealtimeLog
:title="$t('websocket.log')"
:log="communication.log"
/>
</AppSection>
</Pane>
</Splitpanes>
@@ -271,7 +274,7 @@ export default defineComponent({
connect() {
this.communication.log = [
{
payload: this.$t("connecting_to", { name: this.url }),
payload: this.$t("state.connecting_to", { name: this.url }),
source: "info",
color: "var(--accent-color)",
},
@@ -284,13 +287,13 @@ export default defineComponent({
this.connectionState = true
this.communication.log = [
{
payload: this.$t("connected_to", { name: this.url }),
payload: this.$t("state.connected_to", { name: this.url }),
source: "info",
color: "var(--accent-color)",
ts: new Date().toLocaleTimeString(),
},
]
this.$toast.success(this.$t("connected"), {
this.$toast.success(this.$t("state.connected"), {
icon: "sync",
})
}
@@ -300,12 +303,12 @@ export default defineComponent({
this.socket.onclose = () => {
this.connectionState = false
this.communication.log.push({
payload: this.$t("disconnected_from", { name: this.url }),
payload: this.$t("state.disconnected_from", { name: this.url }),
source: "info",
color: "#ff5555",
ts: new Date().toLocaleTimeString(),
})
this.$toast.error(this.$t("disconnected"), {
this.$toast.error(this.$t("state.disconnected"), {
icon: "sync_disabled",
})
}
@@ -403,10 +406,10 @@ export default defineComponent({
deleteProtocol({ index }) {
const oldProtocols = this.protocols.slice()
this.$delete(this.protocols, index)
this.$toast.error(this.$t("deleted"), {
this.$toast.error(this.$t("state.deleted"), {
icon: "delete",
action: {
text: this.$t("undo"),
text: this.$t("action.undo"),
duration: 4000,
onClick: (_, toastObject) => {
this.protocols = oldProtocols