Compare commits

...

3 Commits

Author SHA1 Message Date
Gabe
2a5e9db079 v1.9.1 2025-07-23 21:03:02 +08:00
Gabe
650d6e8b41 fix: workflows 2025-07-23 20:58:50 +08:00
Gabe
1daf134b31 fix: gemini api 2025-07-23 20:03:54 +08:00
9 changed files with 14 additions and 43 deletions

2
.env
View File

@@ -2,7 +2,7 @@ GENERATE_SOURCEMAP=false
REACT_APP_NAME=KISS Translator
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

View File

@@ -18,7 +18,7 @@ jobs:
node-version: latest
cache: "pnpm"
- run: pnpm install
- run: pnpm build
- run: pnpm build+zip
- uses: actions/upload-artifact@v4
with:
name: build-artifacts
@@ -55,7 +55,7 @@ jobs:
needs: [build, create-release]
strategy:
matrix:
client: ["chrome", "edge", "firefox", "userscript"]
client: ["chrome", "edge", "firefox", "userscript", "thunderbird"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -63,10 +63,6 @@ jobs:
with:
name: build-artifacts
path: build
- name: Zip Release
run: |
cd build
zip -r ${{ matrix.client }}.zip ${{ matrix.client }}
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,7 +1,7 @@
{
"name": "kiss-translator",
"description": "A minimalist bilingual translation Extension & Greasemonkey Script",
"version": "1.9.0",
"version": "1.9.1",
"author": "Gabe<yugang2002@gmail.com>",
"private": true,
"dependencies": {
@@ -33,7 +33,8 @@
"build:userscript": "rm -rf build/userscript && mkdir build/userscript && cp build/web/*.user.js build/userscript/",
"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",
"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}\"",
"test": "react-app-rewired test",
"eject": "react-scripts eject"

View File

@@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "__MSG_app_name__",
"description": "__MSG_app_description__",
"version": "1.9.0",
"version": "1.9.1",
"default_locale": "en",
"author": "Gabe<yugang2002@gmail.com>",
"homepage_url": "https://github.com/fishjar/kiss-translator",

View File

@@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "__MSG_app_name__",
"description": "__MSG_app_description__",
"version": "1.9.0",
"version": "1.9.1",
"default_locale": "en",
"author": "Gabe<yugang2002@gmail.com>",
"homepage_url": "https://github.com/fishjar/kiss-translator",

View File

@@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "__MSG_app_name__",
"description": "__MSG_app_description__",
"version": "1.9.0",
"version": "1.9.1",
"default_locale": "en",
"author": "Gabe<yugang2002@gmail.com>",
"homepage_url": "https://github.com/fishjar/kiss-translator",

View File

@@ -348,7 +348,7 @@ const genGemini2 = ({
userPrompt,
model,
temperature,
reasoningEffort,
maxTokens,
}) => {
systemPrompt = systemPrompt
.replaceAll(INPUT_PLACE_FROM, from)
@@ -361,7 +361,6 @@ const genGemini2 = ({
const data = {
model,
reasoning_effort: reasoningEffort,
messages: [
{
role: "system",
@@ -373,6 +372,7 @@ const genGemini2 = ({
},
],
temperature,
max_tokens: maxTokens,
};
const init = {

View File

@@ -692,7 +692,7 @@ export const DEFAULT_TRANS_APIS = {
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:`,
temperature: 0,
reasoningEffort: "low",
maxTokens: 2048,
fetchLimit: 1,
fetchInterval: 500,
apiName: OPT_TRANS_GEMINI_2,

View File

@@ -140,7 +140,6 @@ function ApiFields({ translator }) {
maxTokens = 256,
apiName = "",
isDisabled = false,
reasoningEffort = "low",
} = api;
const handleChange = (e) => {
@@ -305,7 +304,8 @@ function ApiFields({ translator }) {
{(translator.startsWith(OPT_TRANS_OPENAI) ||
translator === OPT_TRANS_CLAUDE ||
translator === OPT_TRANS_GEMINI) && (
translator === OPT_TRANS_GEMINI ||
translator === OPT_TRANS_GEMINI_2) && (
<>
<TextField
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 && (
<>
<TextField