Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a5e9db079 | ||
|
|
650d6e8b41 | ||
|
|
1daf134b31 |
2
.env
2
.env
@@ -2,7 +2,7 @@ GENERATE_SOURCEMAP=false
|
|||||||
|
|
||||||
REACT_APP_NAME=KISS Translator
|
REACT_APP_NAME=KISS Translator
|
||||||
REACT_APP_NAME_CN=简约翻译
|
REACT_APP_NAME_CN=简约翻译
|
||||||
REACT_APP_VERSION=1.9.0
|
REACT_APP_VERSION=1.9.1
|
||||||
|
|
||||||
REACT_APP_HOMEPAGE=https://github.com/fishjar/kiss-translator
|
REACT_APP_HOMEPAGE=https://github.com/fishjar/kiss-translator
|
||||||
|
|
||||||
|
|||||||
8
.github/workflows/release.yml
vendored
8
.github/workflows/release.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
node-version: latest
|
node-version: latest
|
||||||
cache: "pnpm"
|
cache: "pnpm"
|
||||||
- run: pnpm install
|
- run: pnpm install
|
||||||
- run: pnpm build
|
- run: pnpm build+zip
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: build-artifacts
|
name: build-artifacts
|
||||||
@@ -55,7 +55,7 @@ jobs:
|
|||||||
needs: [build, create-release]
|
needs: [build, create-release]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
client: ["chrome", "edge", "firefox", "userscript"]
|
client: ["chrome", "edge", "firefox", "userscript", "thunderbird"]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -63,10 +63,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: build-artifacts
|
name: build-artifacts
|
||||||
path: build
|
path: build
|
||||||
- name: Zip Release
|
|
||||||
run: |
|
|
||||||
cd build
|
|
||||||
zip -r ${{ matrix.client }}.zip ${{ matrix.client }}
|
|
||||||
- uses: actions/upload-release-asset@v1
|
- uses: actions/upload-release-asset@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "kiss-translator",
|
"name": "kiss-translator",
|
||||||
"description": "A minimalist bilingual translation Extension & Greasemonkey Script",
|
"description": "A minimalist bilingual translation Extension & Greasemonkey Script",
|
||||||
"version": "1.9.0",
|
"version": "1.9.1",
|
||||||
"author": "Gabe<yugang2002@gmail.com>",
|
"author": "Gabe<yugang2002@gmail.com>",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -33,7 +33,8 @@
|
|||||||
"build:userscript": "rm -rf build/userscript && mkdir build/userscript && cp build/web/*.user.js build/userscript/",
|
"build:userscript": "rm -rf build/userscript && mkdir build/userscript && cp build/web/*.user.js build/userscript/",
|
||||||
"build:rules": "babel-node src/rules.js",
|
"build:rules": "babel-node src/rules.js",
|
||||||
"build": "pnpm format && pnpm build:chrome && pnpm build:edge && pnpm build:thunderbird && pnpm build:firefox && pnpm build:web && pnpm build:userscript-ios && pnpm build:userscript && pnpm build:rules",
|
"build": "pnpm format && pnpm build:chrome && pnpm build:edge && pnpm build:thunderbird && pnpm build:firefox && pnpm build:web && pnpm build:userscript-ios && pnpm build:userscript && pnpm build:rules",
|
||||||
"zip": "cd build && zip -r chrome.zip chrome && zip -r edge.zip edge && (cd firefox && zip -r ../firefox.zip .) && (cd thunderbird && zip -r ../thunderbird.zip .)",
|
"zip": "cd build && rm -f *.zip && zip -r chrome.zip chrome && zip -r edge.zip edge && (cd firefox && zip -r ../firefox.zip .) && (cd thunderbird && zip -r ../thunderbird.zip .)",
|
||||||
|
"build+zip": "pnpm build && pnpm zip",
|
||||||
"format": "prettier --write \"**/*.{js,json,html}\"",
|
"format": "prettier --write \"**/*.{js,json,html}\"",
|
||||||
"test": "react-app-rewired test",
|
"test": "react-app-rewired test",
|
||||||
"eject": "react-scripts eject"
|
"eject": "react-scripts eject"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "__MSG_app_name__",
|
"name": "__MSG_app_name__",
|
||||||
"description": "__MSG_app_description__",
|
"description": "__MSG_app_description__",
|
||||||
"version": "1.9.0",
|
"version": "1.9.1",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"author": "Gabe<yugang2002@gmail.com>",
|
"author": "Gabe<yugang2002@gmail.com>",
|
||||||
"homepage_url": "https://github.com/fishjar/kiss-translator",
|
"homepage_url": "https://github.com/fishjar/kiss-translator",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "__MSG_app_name__",
|
"name": "__MSG_app_name__",
|
||||||
"description": "__MSG_app_description__",
|
"description": "__MSG_app_description__",
|
||||||
"version": "1.9.0",
|
"version": "1.9.1",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"author": "Gabe<yugang2002@gmail.com>",
|
"author": "Gabe<yugang2002@gmail.com>",
|
||||||
"homepage_url": "https://github.com/fishjar/kiss-translator",
|
"homepage_url": "https://github.com/fishjar/kiss-translator",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "__MSG_app_name__",
|
"name": "__MSG_app_name__",
|
||||||
"description": "__MSG_app_description__",
|
"description": "__MSG_app_description__",
|
||||||
"version": "1.9.0",
|
"version": "1.9.1",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"author": "Gabe<yugang2002@gmail.com>",
|
"author": "Gabe<yugang2002@gmail.com>",
|
||||||
"homepage_url": "https://github.com/fishjar/kiss-translator",
|
"homepage_url": "https://github.com/fishjar/kiss-translator",
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ const genGemini2 = ({
|
|||||||
userPrompt,
|
userPrompt,
|
||||||
model,
|
model,
|
||||||
temperature,
|
temperature,
|
||||||
reasoningEffort,
|
maxTokens,
|
||||||
}) => {
|
}) => {
|
||||||
systemPrompt = systemPrompt
|
systemPrompt = systemPrompt
|
||||||
.replaceAll(INPUT_PLACE_FROM, from)
|
.replaceAll(INPUT_PLACE_FROM, from)
|
||||||
@@ -361,7 +361,6 @@ const genGemini2 = ({
|
|||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
model,
|
model,
|
||||||
reasoning_effort: reasoningEffort,
|
|
||||||
messages: [
|
messages: [
|
||||||
{
|
{
|
||||||
role: "system",
|
role: "system",
|
||||||
@@ -373,6 +372,7 @@ const genGemini2 = ({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
temperature,
|
temperature,
|
||||||
|
max_tokens: maxTokens,
|
||||||
};
|
};
|
||||||
|
|
||||||
const init = {
|
const init = {
|
||||||
|
|||||||
@@ -692,7 +692,7 @@ export const DEFAULT_TRANS_APIS = {
|
|||||||
systemPrompt: `You are a professional, authentic machine translation engine.`,
|
systemPrompt: `You are a professional, authentic machine translation engine.`,
|
||||||
userPrompt: `Translate the following source text from ${INPUT_PLACE_FROM} to ${INPUT_PLACE_TO}. Output translation directly without any additional text.\n\nSource Text: ${INPUT_PLACE_TEXT}\n\nTranslated Text:`,
|
userPrompt: `Translate the following source text from ${INPUT_PLACE_FROM} to ${INPUT_PLACE_TO}. Output translation directly without any additional text.\n\nSource Text: ${INPUT_PLACE_TEXT}\n\nTranslated Text:`,
|
||||||
temperature: 0,
|
temperature: 0,
|
||||||
reasoningEffort: "low",
|
maxTokens: 2048,
|
||||||
fetchLimit: 1,
|
fetchLimit: 1,
|
||||||
fetchInterval: 500,
|
fetchInterval: 500,
|
||||||
apiName: OPT_TRANS_GEMINI_2,
|
apiName: OPT_TRANS_GEMINI_2,
|
||||||
|
|||||||
@@ -140,7 +140,6 @@ function ApiFields({ translator }) {
|
|||||||
maxTokens = 256,
|
maxTokens = 256,
|
||||||
apiName = "",
|
apiName = "",
|
||||||
isDisabled = false,
|
isDisabled = false,
|
||||||
reasoningEffort = "low",
|
|
||||||
} = api;
|
} = api;
|
||||||
|
|
||||||
const handleChange = (e) => {
|
const handleChange = (e) => {
|
||||||
@@ -305,7 +304,8 @@ function ApiFields({ translator }) {
|
|||||||
|
|
||||||
{(translator.startsWith(OPT_TRANS_OPENAI) ||
|
{(translator.startsWith(OPT_TRANS_OPENAI) ||
|
||||||
translator === OPT_TRANS_CLAUDE ||
|
translator === OPT_TRANS_CLAUDE ||
|
||||||
translator === OPT_TRANS_GEMINI) && (
|
translator === OPT_TRANS_GEMINI ||
|
||||||
|
translator === OPT_TRANS_GEMINI_2) && (
|
||||||
<>
|
<>
|
||||||
<TextField
|
<TextField
|
||||||
size="small"
|
size="small"
|
||||||
@@ -326,32 +326,6 @@ function ApiFields({ translator }) {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{translator === OPT_TRANS_GEMINI_2 && (
|
|
||||||
<>
|
|
||||||
<TextField
|
|
||||||
size="small"
|
|
||||||
label="Temperature"
|
|
||||||
type="number"
|
|
||||||
name="temperature"
|
|
||||||
value={temperature}
|
|
||||||
onChange={handleChange}
|
|
||||||
/>
|
|
||||||
<TextField
|
|
||||||
select
|
|
||||||
size="small"
|
|
||||||
name="reasoningEffort"
|
|
||||||
value={reasoningEffort}
|
|
||||||
label="Reasoning Effort"
|
|
||||||
onChange={handleChange}
|
|
||||||
>
|
|
||||||
<MenuItem value={"none"}>none</MenuItem>
|
|
||||||
<MenuItem value={"low"}>low</MenuItem>
|
|
||||||
<MenuItem value={"medium"}>medium</MenuItem>
|
|
||||||
<MenuItem value={"high"}>high</MenuItem>
|
|
||||||
</TextField>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{translator === OPT_TRANS_NIUTRANS && (
|
{translator === OPT_TRANS_NIUTRANS && (
|
||||||
<>
|
<>
|
||||||
<TextField
|
<TextField
|
||||||
|
|||||||
Reference in New Issue
Block a user