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

@@ -107,7 +107,7 @@
name="http_basic_user"
/>
<label for="http_basic_user">
{{ $t("username") }}
{{ $t("authorization.username") }}
</label>
</div>
<div class="flex relative">
@@ -120,7 +120,7 @@
:type="passwordFieldType"
/>
<label for="http_basic_passwd">
{{ $t("password") }}
{{ $t("authorization.password") }}
</label>
<ButtonSecondary
:icon="passwordFieldType === 'text' ? 'visibility' : 'visibility_off'"
@@ -164,22 +164,6 @@
/>
</div>
</div>
<!-- <button
v-if="authType === 'OAuth 2.0'"
v-tooltip.bottom="$t('use_token')"
class="icon button"
@click="showTokenListModal = !showTokenListModal"
>
<i class="material-icons">open_in_new</i>
</button> -->
<!-- <button
v-if="authType === 'OAuth 2.0'"
v-tooltip.bottom="$t('get_token')"
class="icon button"
@click="showTokenRequest = !showTokenRequest"
>
<i class="material-icons">vpn_key</i>
</button> -->
<!-- <SmartToggle
:on="!URL_EXCLUDES.auth"
@change="setExclude('auth', !$event)"

View File

@@ -139,7 +139,7 @@ export default defineComponent({
copyRequestCode() {
copyToClipboard(this.requestCode)
this.copyIcon = "done"
this.$toast.success(this.$t("copied_to_clipboard").toString(), {
this.$toast.success(this.$t("state.copied_to_clipboard").toString(), {
icon: "done",
})
setTimeout(() => (this.copyIcon = "content_copy"), 1000)

View File

@@ -21,7 +21,10 @@
:label="$t('import.title')"
@click.native="handleImport"
/>
<ButtonSecondary :label="$t('cancel')" @click.native="hideModal" />
<ButtonSecondary
:label="$t('action.cancel')"
@click.native="hideModal"
/>
</span>
</template>
</SmartModal>
@@ -124,7 +127,7 @@ export default defineComponent({
)
} catch (e) {
console.error(e)
this.$toast.error(this.$t("curl_invalid_format").toString(), {
this.$toast.error(this.$t("error.curl_invalid_format").toString(), {
icon: "error",
})
}

View File

@@ -34,7 +34,7 @@
v-if="contentType.endsWith('json')"
ref="prettifyRequest"
v-tippy="{ theme: 'tooltip' }"
:title="$t('prettify_body')"
:title="$t('action.prettify')"
:icon="prettifyIcon"
@click.native="prettifyRequestBody"
/>
@@ -108,11 +108,11 @@ export default defineComponent({
this.rawParamsBody = target.result
}
reader.readAsText(file)
this.$toast.info(this.$t("file_imported"), {
this.$toast.info(this.$t("state.file_imported"), {
icon: "attach_file",
})
} else {
this.$toast.error(this.$t("choose_file"), {
this.$toast.error(this.$t("action.choose_file"), {
icon: "attach_file",
})
}
@@ -126,7 +126,7 @@ export default defineComponent({
setTimeout(() => (this.prettifyIcon = "photo_filter"), 1000)
} catch (e) {
console.error(e)
this.$toast.error(`${this.$t("json_prettify_invalid_body")}`, {
this.$toast.error(`${this.$t("error.json_prettify_invalid_body")}`, {
icon: "error",
})
}

View File

@@ -345,7 +345,7 @@ export default defineComponent({
.catch(() => {})
} else {
copyToClipboard(window.location.href)
$toast.info(t("copied_to_clipboard").toString(), {
$toast.info(t("state.copied_to_clipboard").toString(), {
icon: "done",
})
}

View File

@@ -42,7 +42,7 @@
</div>
</div>
<ButtonSecondary
:label="$t('documentation')"
:label="$t('app.documentation')"
to="https://docs.hoppscotch.io"
icon="open_in_new"
blank
@@ -87,7 +87,7 @@
>
<span v-if="response.statusCode">
<span class="text-secondary"> {{ $t("response.status") }}: </span>
{{ response.statusCode || $t("waiting_send_req") }}
{{ response.statusCode || $t("state.waiting_send_request") }}
</span>
<span v-if="response.meta && response.meta.responseDuration">
<span class="text-secondary"> {{ $t("response.time") }}: </span>

View File

@@ -1,80 +0,0 @@
<template>
<SmartModal v-if="show" :title="$t('manage_token')" @close="hideModal">
<template #body>
<div class="flex flex-1">
<label>{{ $t("token_list") }}</label>
<div v-if="tokens.length != 0">
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
:title="$t('action.clear_all')"
icon="clear_all"
@click.native="clearContent('tokens', $event)"
/>
</div>
</div>
<ul v-for="(token, index) in tokens" :key="`token-${index}`">
<li>
<input
class="input"
:placeholder="`name ${index + 1}`"
:value="token.name"
@change="
$store.commit('setOAuthTokenName', {
index,
value: $event.target.value,
})
"
/>
</li>
<li>
<input class="input" :value="token.value" readonly />
</li>
<div class="flex flex-1">
<li>
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
:title="$t('use_token')"
icon="input"
@click.native="useOAuthToken(token.value)"
/>
</li>
<li>
<ButtonSecondary
v-tippy="{ theme: 'tooltip' }"
:title="$t('action.remove')"
icon="remove_circle_outline"
color="red"
@click.native="removeOAuthToken(index)"
/>
</li>
</div>
</ul>
<p v-if="tokens.length === 0">
{{ $t("empty.protocols") }}
</p>
</template>
</SmartModal>
</template>
<script>
export default {
props: {
show: Boolean,
tokens: { type: Array, default: () => [] },
},
methods: {
clearContent(tokens, $event) {
this.$emit("clear-content", tokens, $event)
},
useOAuthToken(token) {
this.$emit("use-oauth-token", token)
},
removeOAuthToken(index) {
this.$emit("remove-oauth-token", index)
},
hideModal() {
this.$emit("hide-modal")
},
},
}
</script>