refactor: i18n

This commit is contained in:
liyasthomas
2021-08-16 23:15:06 +05:30
parent c04435108b
commit 6c3607d7e7
21 changed files with 16882 additions and 14611 deletions

View File

@@ -45,7 +45,7 @@
<code>{{ request.bearerToken || $t("none") }}</code> <code>{{ request.bearerToken || $t("none") }}</code>
</span> </span>
</p> </p>
<h4 v-if="request.headers" class="heading">{{ $t("headers") }}</h4> <h4 v-if="request.headers" class="heading">{{ $t("tab.headers") }}</h4>
<span v-if="request.headers"> <span v-if="request.headers">
<p <p
v-for="(header, index) in request.headers" v-for="(header, index) in request.headers"

View File

@@ -111,7 +111,7 @@
</AppSection> </AppSection>
</SmartTab> </SmartTab>
<SmartTab :id="'headers'" :label="$t('headers')"> <SmartTab :id="'headers'" :label="$t('tab.headers')">
<AppSection label="headers"> <AppSection label="headers">
<div <div
class=" class="
@@ -127,7 +127,7 @@
" "
> >
<label class="font-semibold text-secondaryLight"> <label class="font-semibold text-secondaryLight">
{{ $t("headers") }} {{ $t("tab.headers") }}
</label> </label>
<div class="flex"> <div class="flex">
<ButtonSecondary <ButtonSecondary

View File

@@ -15,7 +15,7 @@
" "
> >
<label class="font-semibold text-secondaryLight"> <label class="font-semibold text-secondaryLight">
{{ $t("response") }} {{ $t("response.title") }}
</label> </label>
<div class="flex"> <div class="flex">
<ButtonSecondary <ButtonSecondary
@@ -62,7 +62,7 @@
<div class="flex space-x-2 pb-4"> <div class="flex space-x-2 pb-4">
<div class="flex flex-col space-y-4 items-end"> <div class="flex flex-col space-y-4 items-end">
<span class="flex flex-1 items-center"> <span class="flex flex-1 items-center">
{{ $t("shortcut.send_request") }} {{ $t("shortcut.request.send_request") }}
</span> </span>
<span class="flex flex-1 items-center"> <span class="flex flex-1 items-center">
{{ $t("shortcut.general.show_all") }} {{ $t("shortcut.general.show_all") }}

View File

@@ -12,7 +12,7 @@
<div class="flex space-x-2 pb-4"> <div class="flex space-x-2 pb-4">
<div class="flex flex-col space-y-4 items-end"> <div class="flex flex-col space-y-4 items-end">
<span class="flex flex-1 items-center"> <span class="flex flex-1 items-center">
{{ $t("shortcut.send_request") }} {{ $t("shortcut.request.send_request") }}
</span> </span>
<span class="flex flex-1 items-center"> <span class="flex flex-1 items-center">
{{ $t("shortcut.general.show_all") }} {{ $t("shortcut.general.show_all") }}
@@ -86,15 +86,15 @@
class="font-semibold space-x-4" class="font-semibold space-x-4"
> >
<span v-if="response.statusCode"> <span v-if="response.statusCode">
<span class="text-secondary"> Status: </span> <span class="text-secondary"> {{ $t("response.status") }}: </span>
{{ response.statusCode || $t("waiting_send_req") }} {{ response.statusCode || $t("waiting_send_req") }}
</span> </span>
<span v-if="response.meta && response.meta.responseDuration"> <span v-if="response.meta && response.meta.responseDuration">
<span class="text-secondary"> Time: </span> <span class="text-secondary"> {{ $t("response.time") }}: </span>
{{ `${response.meta.responseDuration} ms` }} {{ `${response.meta.responseDuration} ms` }}
</span> </span>
<span v-if="response.meta && response.meta.responseSize"> <span v-if="response.meta && response.meta.responseSize">
<span class="text-secondary"> Size: </span> <span class="text-secondary"> {{ $t("response.size") }}: </span>
{{ `${response.meta.responseSize} B` }} {{ `${response.meta.responseSize} B` }}
</span> </span>
</div> </div>

View File

@@ -1,5 +1,5 @@
<template> <template>
<AppSection :label="$t('test.result')"> <AppSection :label="$t('test.results')">
<div <div
v-if=" v-if="
testResults && testResults &&

View File

@@ -2,9 +2,9 @@
<SmartTabs styles="sticky z-10 top-lowerPrimaryStickyFold"> <SmartTabs styles="sticky z-10 top-lowerPrimaryStickyFold">
<SmartTab <SmartTab
v-for="(lens, index) in validLenses" v-for="(lens, index) in validLenses"
:id="lens.lensName" :id="lens.renderer"
:key="`lens-${index}`" :key="`lens-${index}`"
:label="lens.lensName" :label="$t(lens.lensName)"
:selected="index === 0" :selected="index === 0"
> >
<component :is="lens.renderer" :response="response" /> <component :is="lens.renderer" :response="response" />
@@ -12,7 +12,7 @@
<SmartTab <SmartTab
v-if="headerLength" v-if="headerLength"
id="headers" id="headers"
:label="$t('Headers')" :label="$t('response.headers')"
:info="headerLength.toString()" :info="headerLength.toString()"
> >
<LensesHeadersRenderer :headers="response.headers" /> <LensesHeadersRenderer :headers="response.headers" />

View File

@@ -14,7 +14,7 @@
" "
> >
<label class="font-semibold text-secondaryLight"> <label class="font-semibold text-secondaryLight">
{{ $t("response_body") }} {{ $t("response.body") }}
</label> </label>
<div class="flex"> <div class="flex">
<ButtonSecondary <ButtonSecondary

View File

@@ -14,7 +14,7 @@
" "
> >
<label class="font-semibold text-secondaryLight"> <label class="font-semibold text-secondaryLight">
{{ $t("response_body") }} {{ $t("response.body") }}
</label> </label>
<div class="flex"> <div class="flex">
<ButtonSecondary <ButtonSecondary

View File

@@ -14,7 +14,7 @@
" "
> >
<label class="font-semibold text-secondaryLight"> <label class="font-semibold text-secondaryLight">
{{ $t("response_body") }} {{ $t("response.body") }}
</label> </label>
<div class="flex"> <div class="flex">
<ButtonSecondary <ButtonSecondary

View File

@@ -14,7 +14,7 @@
" "
> >
<label class="font-semibold text-secondaryLight"> <label class="font-semibold text-secondaryLight">
{{ $t("response_body") }} {{ $t("response.body") }}
</label> </label>
<div class="flex"> <div class="flex">
<ButtonSecondary <ButtonSecondary

View File

@@ -14,7 +14,7 @@
" "
> >
<label class="font-semibold text-secondaryLight"> <label class="font-semibold text-secondaryLight">
{{ $t("response_body") }} {{ $t("response.body") }}
</label> </label>
<div class="flex"> <div class="flex">
<ButtonSecondary <ButtonSecondary

View File

@@ -1,5 +1,5 @@
const htmlLens = { const htmlLens = {
lensName: "HTML", lensName: "response.html",
isSupportedContentType: (contentType) => isSupportedContentType: (contentType) =>
/\btext\/html|application\/xhtml\+xml\b/i.test(contentType), /\btext\/html|application\/xhtml\+xml\b/i.test(contentType),
renderer: "htmlres", renderer: "htmlres",

View File

@@ -1,5 +1,5 @@
const imageLens = { const imageLens = {
lensName: "Image", lensName: "response.image",
isSupportedContentType: (contentType) => isSupportedContentType: (contentType) =>
/\bimage\/(?:gif|jpeg|png|bmp|svg\+xml|x-icon|vnd\.microsoft\.icon)\b/i.test( /\bimage\/(?:gif|jpeg|png|bmp|svg\+xml|x-icon|vnd\.microsoft\.icon)\b/i.test(
contentType contentType

View File

@@ -1,7 +1,7 @@
import { isJSONContentType } from "../utils/contenttypes" import { isJSONContentType } from "../utils/contenttypes"
const jsonLens = { const jsonLens = {
lensName: "JSON", lensName: "response.json",
isSupportedContentType: isJSONContentType, isSupportedContentType: isJSONContentType,
renderer: "json", renderer: "json",
rendererImport: () => rendererImport: () =>

View File

@@ -1,5 +1,5 @@
const rawLens = { const rawLens = {
lensName: "Raw", lensName: "response.raw",
isSupportedContentType: () => true, isSupportedContentType: () => true,
renderer: "raw", renderer: "raw",
rendererImport: () => import("~/components/lenses/renderers/RawLensRenderer"), rendererImport: () => import("~/components/lenses/renderers/RawLensRenderer"),

View File

@@ -1,5 +1,5 @@
const xmlLens = { const xmlLens = {
lensName: "XML", lensName: "response.xml",
isSupportedContentType: (contentType) => /\bxml\b/i.test(contentType), isSupportedContentType: (contentType) => /\bxml\b/i.test(contentType),
renderer: "xmlres", renderer: "xmlres",
rendererImport: () => import("~/components/lenses/renderers/XMLLensRenderer"), rendererImport: () => import("~/components/lenses/renderers/XMLLensRenderer"),

View File

@@ -181,7 +181,8 @@
}, },
"tab": { "tab": {
"websocket": "WebSocket", "websocket": "WebSocket",
"mqtt": "MQTT" "mqtt": "MQTT",
"headers": "Headers"
}, },
"websocket": { "websocket": {
"protocols": "Protocols" "protocols": "Protocols"
@@ -308,6 +309,19 @@
"variable_list": "Variable List", "variable_list": "Variable List",
"invalid_name": "Please provide a valid name for the environment" "invalid_name": "Please provide a valid name for the environment"
}, },
"response": {
"title": "Response",
"body": "Response Body",
"headers": "Headers",
"status": "Status",
"time": "Time",
"size": "Size",
"html": "HTML",
"xml": "XML",
"json": "JSON",
"raw": "Raw",
"image": "Image"
},
"options": "Options", "options": "Options",
"communication": "Communication", "communication": "Communication",
"endpoint": "Endpoint", "endpoint": "Endpoint",
@@ -324,19 +338,15 @@
"body": "Body", "body": "Body",
"request_body": "Request Body", "request_body": "Request Body",
"raw_request_body": "Raw Request Body", "raw_request_body": "Raw Request Body",
"response_body": "Response Body",
"authorization": "Authorization", "authorization": "Authorization",
"authorization_type": "Authorization Type", "authorization_type": "Authorization Type",
"include_in_url": "Include in URL", "include_in_url": "Include in URL",
"parameters": "Parameters", "parameters": "Parameters",
"expand_response": "Expand response",
"collapse_response": "Collapse response",
"preview_html": "Preview HTML", "preview_html": "Preview HTML",
"history": "History", "history": "History",
"collections": "Collections", "collections": "Collections",
"request_type": "Request type", "request_type": "Request type",
"status": "Status", "status": "Status",
"headers": "Headers",
"waiting_for_connection": "waiting for connection", "waiting_for_connection": "waiting for connection",
"message": "Message", "message": "Message",
"sse": "SSE", "sse": "SSE",
@@ -347,7 +357,6 @@
"variables": "Variables", "variables": "Variables",
"get_schema": "Get schema", "get_schema": "Get schema",
"header_list": "Header List", "header_list": "Header List",
"response": "Response",
"query": "Query", "query": "Query",
"queries": "Queries", "queries": "Queries",
"query_variables": "Variables", "query_variables": "Variables",

View File

@@ -210,7 +210,7 @@ export default {
families: { families: {
Inter: [400, 500, 600, 700, 800], Inter: [400, 500, 600, 700, 800],
"Material+Icons": true, "Material+Icons": true,
"Roboto+Mono": [400, 500, 600, 700, 800], "Roboto+Mono": true,
}, },
}, },

31420
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -37,7 +37,7 @@
"core-js": "^3.16.1", "core-js": "^3.16.1",
"esprima": "^4.0.1", "esprima": "^4.0.1",
"firebase": "^8.9.1", "firebase": "^8.9.1",
"graphql": "^15.5.1", "graphql": "^15.5.0",
"graphql-language-service-interface": "^2.8.4", "graphql-language-service-interface": "^2.8.4",
"json-loader": "^0.5.7", "json-loader": "^0.5.7",
"lodash": "^4.17.21", "lodash": "^4.17.21",

View File

@@ -20,7 +20,7 @@
<SmartTab <SmartTab
:id="'headers'" :id="'headers'"
:label="$t('headers')" :label="$t('tab.headers')"
:info="newActiveHeadersCount$" :info="newActiveHeadersCount$"
> >
<HttpHeaders /> <HttpHeaders />