feat: init i18n with gitlocalize
This commit is contained in:
@@ -1,17 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<header
|
<header
|
||||||
class="
|
class="flex space-x-2 flex-1 py-2 px-2 items-center justify-between"
|
||||||
flex
|
|
||||||
space-x-2
|
|
||||||
flex-1
|
|
||||||
py-2
|
|
||||||
px-2
|
|
||||||
hide-scrollbar
|
|
||||||
items-center
|
|
||||||
justify-between
|
|
||||||
"
|
|
||||||
:class="{ 'overflow-x-auto': !currentUser }"
|
|
||||||
>
|
>
|
||||||
<div class="space-x-2 group inline-flex items-center">
|
<div class="space-x-2 group inline-flex items-center">
|
||||||
<ButtonSecondary
|
<ButtonSecondary
|
||||||
@@ -28,7 +18,7 @@
|
|||||||
id="installPWA"
|
id="installPWA"
|
||||||
v-tippy="{ theme: 'tooltip' }"
|
v-tippy="{ theme: 'tooltip' }"
|
||||||
:title="$t('header.install_pwa')"
|
:title="$t('header.install_pwa')"
|
||||||
icon="offline_bolt"
|
icon="download_for_offline"
|
||||||
class="rounded"
|
class="rounded"
|
||||||
@click.native="showInstallPrompt()"
|
@click.native="showInstallPrompt()"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -113,12 +113,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Vue, { PropType } from "vue"
|
|
||||||
import clone from "lodash/clone"
|
import clone from "lodash/clone"
|
||||||
|
import { defineComponent, PropType } from "@nuxtjs/composition-api"
|
||||||
import type { Environment } from "~/newstore/environments"
|
import type { Environment } from "~/newstore/environments"
|
||||||
import { updateEnvironment } from "~/newstore/environments"
|
import { updateEnvironment } from "~/newstore/environments"
|
||||||
|
|
||||||
export default Vue.extend({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
editingEnvironment: {
|
editingEnvironment: {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<AppSection label="preRequest">
|
<AppSection id="script" :label="$t('preRequest.script')">
|
||||||
<div
|
<div
|
||||||
class="
|
class="
|
||||||
bg-primary
|
bg-primary
|
||||||
@@ -59,6 +59,17 @@
|
|||||||
to="https://github.com/hoppscotch/hoppscotch/wiki/Pre-Request-Scripts"
|
to="https://github.com/hoppscotch/hoppscotch/wiki/Pre-Request-Scripts"
|
||||||
blank
|
blank
|
||||||
/>
|
/>
|
||||||
|
<h4 class="font-bold text-secondaryLight pt-6">
|
||||||
|
{{ $t("preRequest.snippets") }}
|
||||||
|
</h4>
|
||||||
|
<div class="flex flex-col pt-4">
|
||||||
|
<SmartItem
|
||||||
|
v-for="(snippet, index) in snippets"
|
||||||
|
:key="`snippet-${index}`"
|
||||||
|
:label="snippet.name"
|
||||||
|
@click.native="useSnippet(snippet.script)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</AppSection>
|
</AppSection>
|
||||||
@@ -67,6 +78,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from "@nuxtjs/composition-api"
|
import { defineComponent } from "@nuxtjs/composition-api"
|
||||||
import { usePreRequestScript } from "~/newstore/RESTSession"
|
import { usePreRequestScript } from "~/newstore/RESTSession"
|
||||||
|
import preRequestScriptSnippets from "~/helpers/preRequestScriptSnippets"
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
setup() {
|
setup() {
|
||||||
@@ -74,5 +86,15 @@ export default defineComponent({
|
|||||||
preRequestScript: usePreRequestScript(),
|
preRequestScript: usePreRequestScript(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
snippets: preRequestScriptSnippets,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
useSnippet(script: string) {
|
||||||
|
this.preRequestScript += script
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<AppSection label="response">
|
<AppSection label="response">
|
||||||
<HttpResponseMeta :response="response" />
|
<HttpResponseMeta :response="response" />
|
||||||
<LensesResponseBodyRenderer v-if="!loading" :response="response" />
|
<LensesResponseBodyRenderer
|
||||||
|
v-if="!loading && hasResponse"
|
||||||
|
:response="response"
|
||||||
|
/>
|
||||||
</AppSection>
|
</AppSection>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -14,11 +17,17 @@ export default defineComponent({
|
|||||||
setup() {
|
setup() {
|
||||||
const response = useReadonlyStream(restResponse$, null)
|
const response = useReadonlyStream(restResponse$, null)
|
||||||
|
|
||||||
|
const hasResponse = computed(
|
||||||
|
() =>
|
||||||
|
response.value?.type === "success" || response.value?.type === "fail"
|
||||||
|
)
|
||||||
|
|
||||||
const loading = computed(
|
const loading = computed(
|
||||||
() => response.value === null || response.value.type === "loading"
|
() => response.value === null || response.value.type === "loading"
|
||||||
)
|
)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
hasResponse,
|
||||||
response,
|
response,
|
||||||
loading,
|
loading,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,17 @@
|
|||||||
to="https://github.com/hoppscotch/hoppscotch/wiki/Post-Request-Tests"
|
to="https://github.com/hoppscotch/hoppscotch/wiki/Post-Request-Tests"
|
||||||
blank
|
blank
|
||||||
/>
|
/>
|
||||||
|
<h4 class="font-bold text-secondaryLight pt-6">
|
||||||
|
{{ $t("test.snippets") }}
|
||||||
|
</h4>
|
||||||
|
<div class="flex flex-col pt-4">
|
||||||
|
<SmartItem
|
||||||
|
v-for="(snippet, index) in snippets"
|
||||||
|
:key="`snippet-${index}`"
|
||||||
|
:label="snippet.name"
|
||||||
|
@click.native="useSnippet(snippet.script)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</AppSection>
|
</AppSection>
|
||||||
@@ -67,6 +78,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from "@nuxtjs/composition-api"
|
import { defineComponent } from "@nuxtjs/composition-api"
|
||||||
import { useTestScript } from "~/newstore/RESTSession"
|
import { useTestScript } from "~/newstore/RESTSession"
|
||||||
|
import testSnippets from "~/helpers/testSnippets"
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
setup() {
|
setup() {
|
||||||
@@ -74,5 +86,15 @@ export default defineComponent({
|
|||||||
testScript: useTestScript(),
|
testScript: useTestScript(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
snippets: testSnippets,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
useSnippet(script: string) {
|
||||||
|
this.testScript += script
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
14
helpers/preRequestScriptSnippets.js
Normal file
14
helpers/preRequestScriptSnippets.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
export default [
|
||||||
|
{
|
||||||
|
name: "Status code: Status code is 200",
|
||||||
|
script: `\n\npw.test("Status code is 200", ()=> {
|
||||||
|
pw.expect(pw.response.statusCode).toBe(200);
|
||||||
|
});`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Response body: Contains string",
|
||||||
|
script: `\n\npw.test("Status code is 200", ()=> {
|
||||||
|
pw.expect(pw.response.statusCode).toBe(200);
|
||||||
|
});`,
|
||||||
|
},
|
||||||
|
]
|
||||||
14
helpers/testSnippets.js
Normal file
14
helpers/testSnippets.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
export default [
|
||||||
|
{
|
||||||
|
name: "Status code: Status code is 200",
|
||||||
|
script: `\n\npw.test("Status code is 200", ()=> {
|
||||||
|
pw.expect(pw.response.statusCode).toBe(200);
|
||||||
|
});`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Response body: Contains string",
|
||||||
|
script: `\n\npw.test("Status code is 200", ()=> {
|
||||||
|
pw.expect(pw.response.statusCode).toBe(200);
|
||||||
|
});`,
|
||||||
|
},
|
||||||
|
]
|
||||||
118
languages.json
118
languages.json
@@ -1,135 +1,51 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"code": "de",
|
||||||
|
"name": "Deutsch",
|
||||||
|
"iso": "de-DE",
|
||||||
|
"file": "de.json",
|
||||||
|
"country": "DE"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"code": "en",
|
"code": "en",
|
||||||
"name": "English",
|
"name": "English",
|
||||||
"iso": "en-US",
|
"iso": "en-US",
|
||||||
"file": "en-US.json",
|
"file": "en.json",
|
||||||
"country": "US"
|
"country": "US"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"code": "es",
|
"code": "es",
|
||||||
"name": "Español",
|
"name": "Español",
|
||||||
"iso": "es-ES",
|
"iso": "es-ES",
|
||||||
"file": "es-ES.json",
|
"file": "es.json",
|
||||||
"country": "ES"
|
"country": "ES"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"code": "fr",
|
"code": "fr",
|
||||||
"name": "Français",
|
"name": "Français",
|
||||||
"iso": "fr-FR",
|
"iso": "fr-FR",
|
||||||
"file": "fr-FR.json",
|
"file": "fr.json",
|
||||||
"country": "FR"
|
"country": "FR"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"code": "fa",
|
|
||||||
"name": "Farsi",
|
|
||||||
"iso": "fa-IR",
|
|
||||||
"file": "fa-IR.json",
|
|
||||||
"country": "IR"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"code": "pt",
|
"code": "pt",
|
||||||
"name": "Português",
|
"name": "Português",
|
||||||
"iso": "pt-PT",
|
"iso": "pt-PT",
|
||||||
"file": "pt-PT.json",
|
"file": "pt.json",
|
||||||
"country": "PT"
|
"country": "PT"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"code": "pt-br",
|
"code": "ru",
|
||||||
"name": "Português Brasileiro",
|
"name": "Russian",
|
||||||
"iso": "pt-BR",
|
"iso": "ru-RU",
|
||||||
"file": "pt-BR.json",
|
"file": "ru.json",
|
||||||
"country": "BR"
|
"country": "RU"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"code": "cn",
|
"code": "cn",
|
||||||
"name": "简体中文",
|
"name": "简体中文",
|
||||||
"iso": "zh-CN",
|
"iso": "zh-CN",
|
||||||
"file": "zh-CN.json",
|
"file": "zh.json",
|
||||||
"country": "CN"
|
"country": "CN"
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": "tw",
|
|
||||||
"name": "繁體中文",
|
|
||||||
"iso": "zh-TW",
|
|
||||||
"file": "zh-TW.json",
|
|
||||||
"country": "TW"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": "id",
|
|
||||||
"name": "Bahasa Indonesia",
|
|
||||||
"iso": "id-ID",
|
|
||||||
"file": "id-ID.json",
|
|
||||||
"country": "ID"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": "tr",
|
|
||||||
"name": "Türkçe",
|
|
||||||
"iso": "tr-TR",
|
|
||||||
"file": "tr-TR.json",
|
|
||||||
"country": "TR"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": "de",
|
|
||||||
"name": "Deutsch",
|
|
||||||
"iso": "de-DE",
|
|
||||||
"file": "de-DE.json",
|
|
||||||
"country": "DE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": "ja",
|
|
||||||
"name": "日本語",
|
|
||||||
"iso": "ja-JP",
|
|
||||||
"file": "ja-JP.json",
|
|
||||||
"country": "JP"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": "ko",
|
|
||||||
"name": "한국어",
|
|
||||||
"iso": "ko-KR",
|
|
||||||
"file": "ko-KR.json",
|
|
||||||
"country": "KR"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": "in",
|
|
||||||
"name": "हिंदी",
|
|
||||||
"iso": "in-IN",
|
|
||||||
"file": "in-IN.json",
|
|
||||||
"country": "IN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": "bn",
|
|
||||||
"name": "Bengali",
|
|
||||||
"iso": "bn-BD",
|
|
||||||
"file": "bn-BD.json",
|
|
||||||
"country": "BD"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": "ml",
|
|
||||||
"name": "മലയാളം",
|
|
||||||
"iso": "ml-ML",
|
|
||||||
"file": "ml-ML.json",
|
|
||||||
"country": "ML"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": "vi",
|
|
||||||
"name": "Vietnamese",
|
|
||||||
"iso": "vi-VN",
|
|
||||||
"file": "vi-VN.json",
|
|
||||||
"country": "VN"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": "nl",
|
|
||||||
"name": "Dutch",
|
|
||||||
"iso": "nl-BE",
|
|
||||||
"file": "nl-BE.json",
|
|
||||||
"country": "BE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"code": "nb",
|
|
||||||
"name": "Norwegian (Bokmål)",
|
|
||||||
"iso": "nb-NO",
|
|
||||||
"file": "nb-NO.json",
|
|
||||||
"country": "NO"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
</SmartTab>
|
</SmartTab>
|
||||||
|
|
||||||
<SmartTab
|
<SmartTab
|
||||||
:id="'pre_request_script'"
|
:id="'preRequestScript'"
|
||||||
:label="$t('pre_request_script')"
|
:label="$t('pre_request_script')"
|
||||||
>
|
>
|
||||||
<HttpPreRequestScript />
|
<HttpPreRequestScript />
|
||||||
|
|||||||
Reference in New Issue
Block a user