vite-plugin-localization-ai 1.0.8 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ export async function translate(sourceJson, targetLang, apiKey, extraPromt, temp
7
7
  const generateParams = {
8
8
  model: "gemini-2.5-flash",
9
9
  contents: `You are a professional application interface translator.
10
- Translate the JSON to language ${targetLang}.
10
+ Translate the JSON to culture (locale) "${targetLang}".
11
11
  JSON:
12
12
  ${text}
13
13
 
@@ -16,11 +16,9 @@ ${extraPromt || ""}
16
16
  config: {
17
17
  systemInstruction: "Translate JSON values exactly, keep keys and structure. The response must be plain text — no Markdown",
18
18
  temperature: temperature,
19
- seed: 42,
20
19
  responseMimeType: "application/json",
21
20
  },
22
21
  };
23
- console.log("generateParams", generateParams);
24
22
  const response = await client.models.generateContent(generateParams);
25
23
  const translatedText = response.text?.trim() || "{}";
26
24
  return JSON.parse(translatedText || "{}");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-localization-ai",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Vite plugin to generate localization jsons using AI",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -15,7 +15,7 @@ export async function translate(
15
15
  const generateParams: GenerateContentParameters = {
16
16
  model: "gemini-2.5-flash",
17
17
  contents: `You are a professional application interface translator.
18
- Translate the JSON to language ${targetLang}.
18
+ Translate the JSON to culture (locale) "${targetLang}".
19
19
  JSON:
20
20
  ${text}
21
21
 
@@ -25,13 +25,10 @@ ${extraPromt || ""}
25
25
  systemInstruction:
26
26
  "Translate JSON values exactly, keep keys and structure. The response must be plain text — no Markdown",
27
27
  temperature: temperature,
28
- seed: 42,
29
28
  responseMimeType: "application/json",
30
29
  },
31
30
  };
32
31
 
33
- console.log("generateParams", generateParams);
34
-
35
32
  const response = await client.models.generateContent(generateParams);
36
33
 
37
34
  const translatedText = response.text?.trim() || "{}";