Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
added translations for streams [WIP] (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
nshayanfar committed Nov 19, 2022
1 parent 603f061 commit 5166f4c
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 22 deletions.
2 changes: 1 addition & 1 deletion web/html/xui/form/stream/stream_http.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{define "form/streamHTTP"}}
<a-form layout="inline">
<a-form-item label="路径">
<a-form-item label='{{ i18n "path" }}'>
<a-input v-model.trim="inbound.stream.http.path"></a-input>
</a-form-item>
<a-form-item label="host">
Expand Down
4 changes: 2 additions & 2 deletions web/html/xui/form/stream/stream_kcp.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{define "form/streamKCP"}}
<a-form layout="inline">
<a-form-item label="伪装">
<a-form-item label='{{ i18n "camouflage" }}'>
<a-select v-model="inbound.stream.kcp.type" style="width: 280px;">
<a-select-option value="none">none(not camouflage)</a-select-option>
<a-select-option value="srtp">srtp(camouflage video call)</a-select-option>
Expand All @@ -10,7 +10,7 @@
<a-select-option value="wireguard">wireguard(camouflage wireguard packages)</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="密码">
<a-form-item label='{{ i18n "password" }}'>
<a-input v-model.number="inbound.stream.kcp.seed"></a-input>
</a-form-item>
<a-form-item label="mtu">
Expand Down
6 changes: 3 additions & 3 deletions web/html/xui/form/stream/stream_quic.html
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{{define "form/streamQUIC"}}
<a-form layout="inline">
<a-form-item label="加密">
<a-form-item label='{{ i18n "pages.inbounds.stream.quic.encryption" }}'>
<a-select v-model="inbound.stream.quic.security" style="width: 165px;">
<a-select-option value="none">none</a-select-option>
<a-select-option value="aes-128-gcm">aes-128-gcm</a-select-option>
<a-select-option value="chacha20-poly1305">chacha20-poly1305</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="密码">
<a-form-item label='{{ i18n "password" }}'>
<a-input v-model.trim="inbound.stream.quic.key"></a-input>
</a-form-item>
<a-form-item label="伪装">
<a-form-item label='{{ i18n "camouflage" }}'>
<a-select v-model="inbound.stream.quic.type" style="width: 280px;">
<a-select-option value="none">none(not camouflage)</a-select-option>
<a-select-option value="srtp">srtp(camouflage video call)</a-select-option>
Expand Down
24 changes: 12 additions & 12 deletions web/html/xui/form/stream/stream_tcp.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
<!-- tcp request -->
<a-form v-if="inbound.stream.tcp.type === 'http'"
layout="inline">
<a-form-item label="请求版本">
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestVersion" }}'>
<a-input v-model.trim="inbound.stream.tcp.request.version"></a-input>
</a-form-item>
<a-form-item label="请求方法">
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestMethod" }}'>
<a-input v-model.trim="inbound.stream.tcp.request.method"></a-input>
</a-form-item>
<a-form-item label="请求路径">
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.requestPath" }}'>
<a-row v-for="(path, index) in inbound.stream.tcp.request.path">
<a-input v-model.trim="inbound.stream.tcp.request.path[index]"></a-input>
</a-row>
</a-form-item>
<a-form-item label="请求头">
<a-form-item label='{{ i18n "pages.inbounds.stream.general.requestHeader" }}'>
<a-row>
<a-button size="small"
@click="inbound.stream.tcp.request.addHeader('Host', 'xxx.com')">
Expand All @@ -35,9 +35,9 @@
</a-row>
<a-input-group v-for="(header, index) in inbound.stream.tcp.request.headers">
<a-input style="width: 50%" v-model.trim="header.name"
addon-before="名称"></a-input>
addon-before='{{ i18n "pages.inbounds.stream.general.name" }}'></a-input>
<a-input style="width: 50%" v-model.trim="header.value"
addon-before="">
addon-before='{{ i18n "pages.inbounds.stream.general.value" }}'>
<template slot="addonAfter">
<a-button size="small"
@click="inbound.stream.tcp.request.removeHeader(index)">
Expand All @@ -52,16 +52,16 @@
<!-- tcp response -->
<a-form v-if="inbound.stream.tcp.type === 'http'"
layout="inline">
<a-form-item label="响应版本">
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseVersion" }}'>
<a-input v-model.trim="inbound.stream.tcp.response.version"></a-input>
</a-form-item>
<a-form-item label="响应状态">
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseStatus" }}'>
<a-input v-model.trim="inbound.stream.tcp.response.status"></a-input>
</a-form-item>
<a-form-item label="响应状态说明">
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseStatusDescription" }}'>
<a-input v-model.trim="inbound.stream.tcp.response.reason"></a-input>
</a-form-item>
<a-form-item label="响应头">
<a-form-item label='{{ i18n "pages.inbounds.stream.tcp.responseHeader" }}'>
<a-row>
<a-button size="small"
@click="inbound.stream.tcp.response.addHeader('Content-Type', 'application/octet-stream')">
Expand All @@ -70,9 +70,9 @@
</a-row>
<a-input-group v-for="(header, index) in inbound.stream.tcp.response.headers">
<a-input style="width: 50%" v-model.trim="header.name"
addon-before="名称"></a-input>
addon-before='{{ i18n "pages.inbounds.stream.general.name" }}'></a-input>
<a-input style="width: 50%" v-model.trim="header.value"
addon-before="">
addon-before='{{ i18n "pages.inbounds.stream.general.value" }}'>
<template slot="addonAfter">
<a-button size="small"
@click="inbound.stream.tcp.response.removeHeader(index)">
Expand Down
8 changes: 4 additions & 4 deletions web/html/xui/form/stream/stream_ws.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
</a-form-item>
</a-form>
<a-form layout="inline">
<a-form-item label="路径">
<a-form-item label='{{ i18n "path" }}'>
<a-input v-model.trim="inbound.stream.ws.path"></a-input>
</a-form-item>
<a-form-item label="请求头">
<a-form-item label='{{ i18n "pages.inbounds.stream.general.requestHeader" }}'>
<a-row>
<a-button size="small"
@click="inbound.stream.ws.addHeader('Host', '')">
Expand All @@ -17,9 +17,9 @@
</a-row>
<a-input-group v-for="(header, index) in inbound.stream.ws.headers">
<a-input style="width: 50%" v-model.trim="header.name"
addon-before="名称"></a-input>
addon-before='{{ i18n "pages.inbounds.stream.general.name"}}'></a-input>
<a-input style="width: 50%" v-model.trim="header.value"
addon-before="">
addon-before='{{ i18n "pages.inbounds.stream.general.value" }}'>
<template slot="addonAfter">
<a-button size="small"
@click="inbound.stream.ws.removeHeader(index)">
Expand Down
17 changes: 17 additions & 0 deletions web/translation/translate.en_US.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,23 @@
[pages.inbounds.toasts]
"obtain" = "Obtain"

[pages.inbounds.stream.general]
"requestHeader" = "request header"
"name" = "name"
"value" = "value"

[pages.inbounds.stream.tcp]
"requestVersion" = "request version"
"requestMethod" = "request method"
"requestPath" = "request path"
"responseVersion" = "response version"
"responseStatus" = "response status"
"responseStatusDescription" = "response status description"
"responseHeader" = "response header"

[pages.inbounds.stream.quic]
"encryption" = "encryption"


[pages.setting]
"title" = "Setting"
Expand Down
16 changes: 16 additions & 0 deletions web/translation/translate.zh_Hans.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,22 @@
[pages.inbounds.toasts]
"obtain" = "获取"

[pages.inbounds.stream.general]
"requestHeader" = "请求头"
"name" = "名称"
"value" = ""

[pages.inbounds.stream.tcp]
"requestVersion" = "请求版本"
"requestMethod" = "请求方法"
"requestPath" = "请求路径"
"responseVersion" = "响应版本"
"responseStatus" = "响应状态"
"responseStatusDescription" = "响应状态说明"
"responseHeader" = "响应头"

[pages.inbounds.stream.quic]
"encryption" = "加密"


[pages.setting]
Expand Down
17 changes: 17 additions & 0 deletions web/translation/translate.zh_Hant.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,22 @@
[pages.inbounds]
"title" = "入站列表"

[pages.inbounds.stream.general]
"requestHeader" = "request header"
"name" = "name"
"value" = "value"

[pages.inbounds.stream.tcp]
"requestVersion" = "request version"
"requestMethod" = "request method"
"requestPath" = "request path"
"responseVersion" = "response version"
"responseStatus" = "response status"
"responseStatusDescription" = "response status description"
"responseHeader" = "response header"

[pages.inbounds.stream.quic]
"encryption" = "encryption"

[pages.setting]
"title" = "设置"

0 comments on commit 5166f4c

Please sign in to comment.