Skip to content

Commit 1431465

Browse files
committed
Add internationalization support with translations for English, German, and Russian
- Implemented i18n.js for managing translations and language settings. - Updated popup.js to utilize translations for various UI elements and messages. - Added translation keys for dynamic strings, error messages, and UI components. - Ensured translations are applied during initialization and for user interactions.
1 parent 0fc5b13 commit 1431465

9 files changed

Lines changed: 1188 additions & 243 deletions

File tree

README.md

Lines changed: 60 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,79 @@
1-
# AI Chat Pro Browser Extension
1+
# AI Chat Pro Client
22

3-
Moderne Browser-Extension fur KI-Chat mit mehreren Providern in einer einheitlichen Oberflache.
3+
A modern browser extension that brings multiple AI providers together under a single, unified chat interface.
44

5-
## Vorschau
5+
## Preview
66

7-
![Aufzeichnung der Extension](./Aufzeichnung%202026-04-09%20195453.gif)
7+
![Extension preview](./Aufzeichnung%202026-04-09%20195453.gif)
88

9-
## Features
10-
11-
- Mehrere Provider: Perplexity, OpenAI, Anthropic, Gemini, LM Studio
12-
- Lokale Speicherung von Einstellungen und Chats
13-
- Einstellungsseite mit Provider-spezifischen Feldern
14-
- Chat-Export (z. B. JSON/Markdown)
15-
- LM Studio Support fur lokale Modelle
9+
## What's New in v1.0.0
1610

17-
## Projektstruktur
11+
This release marks the first stable version of **AI Chat Pro Client** and introduces a complete internationalization layer, persistent model verification, and full data backup support.
1812

19-
- [manifest.json](manifest.json): Extension-Konfiguration
20-
- [popup/popup.html](popup/popup.html): Chat-Oberflache
21-
- [popup/popup.js](popup/popup.js): Chat-Logik im Popup
22-
- [options/options.html](options/options.html): Einstellungsseite
23-
- [options/options.js](options/options.js): Provider- und API-Tests
24-
- [background/background.js](background/background.js): API-Aufrufe pro Provider
13+
- **Multilingual interface (EN / DE / RU)** — The entire UI of both the popup and the options page is now translatable. The active language follows the browser locale by default and can be switched manually under *Appearance → Language*. A reusable i18n module (`shared/i18n.js`) powers the translation pipeline through `data-i18n` attributes.
14+
- **Localized backend errors** — Errors raised by the background service worker (missing API key, connection failures, provider responses, LM Studio errors) are returned as structured error codes and translated in the popup, so users always see error messages in their selected language.
15+
- **Persistent model verification** — Results from *Check models* are now cached per provider and per model in extension storage. Each provider view displays a *Last check: …* timestamp so you can see at a glance which models are reachable without re-running the test.
16+
- **Full backup export & import***Export backup* now produces a single JSON file (`type: "ai-chat-pro-client-backup"`, version `2.0`) containing all conversations, the active conversation, and all settings (providers, models, custom models, base URLs, appearance, behavior). The corresponding *Import backup* action restores everything in one step and remains backwards-compatible with the legacy conversation-only export format.
17+
- **Custom model management** — Models added manually through the options page are stored per provider, can be removed individually, and their cached check results are cleaned up automatically.
18+
- **Rebrand to *AI Chat Pro Client*** — Application name, manifest, popup title, and all user-facing strings have been unified.
2519

26-
## Installation (Chrome/Edge)
20+
## Features
2721

28-
1. Repository lokal klonen oder als ZIP entpacken.
29-
2. Browser offnen und Erweiterungsseite aufrufen:
22+
- **Multiple providers** — Perplexity, OpenAI, Anthropic, Google Gemini, and LM Studio (local).
23+
- **Unified chat UI** — Conversation list, search, rename, delete, and Markdown rendering with code-block copy buttons.
24+
- **Local-first storage** — Conversations, settings, API keys, and custom models are stored locally via `chrome.storage.local` and never leave the browser.
25+
- **Per-provider configuration** — API key, base URL, model selection, temperature, max tokens, and system prompt are configured independently for each provider.
26+
- **Connection & model testing** — One-click *Test API* and *Check models* actions per provider, with cached results.
27+
- **Custom models** — Add provider-specific model IDs by hand when the official model list lags behind.
28+
- **LM Studio support** — Talk to local OpenAI-compatible servers; auto-discovery of loaded models, optional bearer token.
29+
- **Backup & restore** — Export and import the full extension state as a single JSON file.
30+
- **Appearance & behavior** — Dark / light theme, font size, send-with-Enter toggle, source link toggle, and language selector.
31+
- **Chat export** — Export an individual conversation as Markdown or JSON.
32+
33+
## Project Structure
34+
35+
- [`manifest.json`](manifest.json) — Extension manifest (MV3)
36+
- [`popup/popup.html`](popup/popup.html) — Chat UI markup
37+
- [`popup/popup.js`](popup/popup.js) — Chat logic, rendering, state management
38+
- [`options/options.html`](options/options.html) — Settings page markup
39+
- [`options/options.js`](options/options.js) — Provider configuration, model checks, backup I/O
40+
- [`background/background.js`](background/background.js) — Provider API routing in the service worker
41+
- [`shared/i18n.js`](shared/i18n.js) — Translation dictionary and helpers (EN / DE / RU)
42+
43+
## Installation (Chrome / Edge)
44+
45+
1. Clone this repository or download it as a ZIP and extract it.
46+
2. Open the extensions page in your browser:
3047
- Chrome: `chrome://extensions`
3148
- Edge: `edge://extensions`
32-
3. Entwicklermodus aktivieren.
33-
4. `Entpackte Erweiterung laden` auswahlen.
34-
5. Projektordner `Browser_Extension` auswahlen.
49+
3. Enable **Developer mode**.
50+
4. Click **Load unpacked**.
51+
5. Select the project root directory.
3552

36-
## Verwendung
53+
## Usage
3754

38-
1. Extension offnen.
39-
2. Auf Einstellungen gehen und Provider auswahlen.
40-
3. API-Key hinterlegen. Bei LM Studio ist er optional.
41-
4. Optional Modell und Base-URL anpassen.
42-
5. Im Chat eine Nachricht senden.
55+
1. Open the extension from the toolbar.
56+
2. Click the settings icon and choose your preferred provider.
57+
3. Enter the API key (optional for LM Studio).
58+
4. Optionally adjust the model, base URL, temperature, and system prompt.
59+
5. Return to the popup and start chatting.
4360

44-
## Hinweise zu Providern
61+
## Provider Notes
4562

46-
- LM Studio:
47-
- Standard-URL ist `http://localhost:1234`
48-
- Ein API-Key kann optional gesetzt werden, falls dein lokaler Server Authentifizierung verlangt
49-
- Stelle sicher, dass LM Studio lauft und ein Modell geladen ist
63+
- **LM Studio**
64+
- Default server URL: `http://localhost:1234`
65+
- An API key can be set if your local server enforces authentication.
66+
- Make sure LM Studio is running and a model is loaded before sending a message.
67+
- **OpenAI / Anthropic / Gemini / Perplexity**
68+
- Each provider has its own API key field. Keys are stored locally and never shared.
69+
- The *Base URL (advanced)* field lets you point to OpenAI-compatible proxies or self-hosted gateways.
5070

51-
## Entwicklung
71+
## Development
5272

53-
- Keine Build-Pipeline erforderlich (reines Browser-Extension-Projekt)
54-
- Nach Codeanderungen Extension auf der Browser-Erweiterungsseite neu laden
73+
- No build pipeline — this is a plain browser extension project.
74+
- After editing files, reload the extension on the browser's extensions page.
75+
- The i18n dictionary lives in `shared/i18n.js`. To add a new language, add a new key under `TRANSLATIONS` and extend the language selector in `options/options.html`.
5576

56-
## Lizenz
77+
## License
5778

5879
MIT

background/background.js

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ async function handleChat(request, sendResponse) {
109109

110110
if (provider !== "lmstudio" && !apiKey) {
111111
sendResponse({
112-
error:
113-
"API Key nicht konfiguriert. Bitte in den Einstellungen hinterlegen.",
112+
error: "API key not configured. Please set it in the settings.",
113+
errorCode: "apiKeyMissing",
114114
});
115115
return;
116116
}
@@ -132,7 +132,11 @@ async function handleChat(request, sendResponse) {
132132
await callPerplexity(s, apiKey, model, request, sendResponse);
133133
}
134134
} catch (err) {
135-
sendResponse({ error: `Verbindungsfehler: ${err.message}` });
135+
sendResponse({
136+
error: `Connection error: ${err.message}`,
137+
errorCode: "connection",
138+
errorParams: [err.message],
139+
});
136140
}
137141
}
138142

@@ -166,8 +170,11 @@ async function callPerplexity(s, apiKey, model, request, sendResponse) {
166170
});
167171
if (!response.ok) {
168172
const err = await response.json().catch(() => ({}));
173+
const detail = err.error?.message || response.statusText;
169174
sendResponse({
170-
error: `API Fehler (${response.status}): ${err.error?.message || response.statusText}`,
175+
error: `API error (${response.status}): ${detail}`,
176+
errorCode: "api",
177+
errorParams: [response.status, detail],
171178
});
172179
return;
173180
}
@@ -200,8 +207,11 @@ async function callOpenAI(s, apiKey, model, request, sendResponse) {
200207
});
201208
if (!response.ok) {
202209
const err = await response.json().catch(() => ({}));
210+
const detail = err.error?.message || response.statusText;
203211
sendResponse({
204-
error: `API Fehler (${response.status}): ${err.error?.message || response.statusText}`,
212+
error: `API error (${response.status}): ${detail}`,
213+
errorCode: "api",
214+
errorParams: [response.status, detail],
205215
});
206216
return;
207217
}
@@ -230,8 +240,11 @@ async function callAnthropic(s, apiKey, model, request, sendResponse) {
230240
});
231241
if (!response.ok) {
232242
const err = await response.json().catch(() => ({}));
243+
const detail = err.error?.message || response.statusText;
233244
sendResponse({
234-
error: `API Fehler (${response.status}): ${err.error?.message || response.statusText}`,
245+
error: `API error (${response.status}): ${detail}`,
246+
errorCode: "api",
247+
errorParams: [response.status, detail],
235248
});
236249
return;
237250
}
@@ -269,8 +282,11 @@ async function callGemini(s, apiKey, model, request, sendResponse) {
269282
);
270283
if (!response.ok) {
271284
const err = await response.json().catch(() => ({}));
285+
const detail = err.error?.message || response.statusText;
272286
sendResponse({
273-
error: `API Fehler (${response.status}): ${err.error?.message || response.statusText}`,
287+
error: `API error (${response.status}): ${detail}`,
288+
errorCode: "api",
289+
errorParams: [response.status, detail],
274290
});
275291
return;
276292
}
@@ -304,8 +320,11 @@ async function callLMStudio(s, apiKey, model, request, sendResponse) {
304320
});
305321
if (!response.ok) {
306322
const err = await response.json().catch(() => ({}));
323+
const detail = err.error?.message || response.statusText;
307324
sendResponse({
308-
error: `LM Studio Fehler (${response.status}): ${err.error?.message || response.statusText}`,
325+
error: `LM Studio error (${response.status}): ${detail}`,
326+
errorCode: "lmstudio",
327+
errorParams: [response.status, detail],
309328
});
310329
return;
311330
}

manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"manifest_version": 3,
3-
"name": "AI Chat Pro",
3+
"name": "AI Chat Pro Client",
44
"version": "1.0.0",
5-
"description": "Professional AI Chat powered by Perplexity API with customizable settings and modern UI",
5+
"description": "Professional AI Chat Client supporting multiple AI providers with customizable settings and modern UI",
66
"permissions": ["storage"],
77
"host_permissions": ["<all_urls>"],
88
"action": {
99
"default_popup": "popup/popup.html",
10-
"default_title": "AI Chat Pro"
10+
"default_title": "AI Chat Pro Client"
1111
},
1212
"options_page": "options/options.html",
1313
"background": {

options/options.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,13 @@ details.setting-group .advanced-content {
815815
color: var(--color-text-tertiary);
816816
}
817817

818+
.check-timestamp {
819+
font-size: 11px;
820+
color: var(--color-text-tertiary);
821+
font-style: italic;
822+
margin-bottom: 4px;
823+
}
824+
818825
/* ---- Custom Model Tags ---- */
819826
.custom-model-list {
820827
display: flex;

0 commit comments

Comments
 (0)