claude-code-runner 0.1.0 → 0.1.2
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.
- package/README.zh-Hans.md +2 -2
- package/package.json +17 -17
- package/public/app.js +1134 -0
- package/public/i18n.js +247 -0
- package/public/index.html +660 -0
- package/public/locales/README.md +86 -0
- package/public/locales/en.json +60 -0
- package/public/locales/zh-CN.json +60 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Internationalization (i18n)
|
|
2
|
+
|
|
3
|
+
This folder contains the translation files for Claude Code Runner's Web UI.
|
|
4
|
+
|
|
5
|
+
## Supported Languages
|
|
6
|
+
|
|
7
|
+
- `en.json` - English (default)
|
|
8
|
+
- `zh-CN.json` - Simplified Chinese (简体中文)
|
|
9
|
+
|
|
10
|
+
## Adding a New Language
|
|
11
|
+
|
|
12
|
+
To add a new language:
|
|
13
|
+
|
|
14
|
+
1. **Create a new JSON file** in this folder with the language code as the filename (e.g., `fr.json` for French, `ja.json` for Japanese)
|
|
15
|
+
|
|
16
|
+
2. **Copy the structure from `en.json`** and translate all values:
|
|
17
|
+
```bash
|
|
18
|
+
cp en.json <language-code>.json
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
3. **Update the `SUPPORTED_LOCALES` array** in `/public/i18n.js`:
|
|
22
|
+
```javascript
|
|
23
|
+
const SUPPORTED_LOCALES = ['en', 'zh-CN', 'fr']; // Add your new locale
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
4. **Add the language option to the selector** in `/public/index.html`:
|
|
27
|
+
```html
|
|
28
|
+
<select id="language-selector" onchange="I18n.setLocale(this.value)">
|
|
29
|
+
<option value="en">English</option>
|
|
30
|
+
<option value="zh-CN">简体中文</option>
|
|
31
|
+
<option value="fr">Français</option> <!-- Add your new option -->
|
|
32
|
+
</select>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
5. **Add the language name** to each locale file under `language` key:
|
|
36
|
+
```json
|
|
37
|
+
"language": {
|
|
38
|
+
"label": "Language",
|
|
39
|
+
"en": "English",
|
|
40
|
+
"zh-CN": "简体中文",
|
|
41
|
+
"fr": "Français"
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Language File Structure
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"app": {
|
|
50
|
+
"title": "Page title",
|
|
51
|
+
"name": "App name"
|
|
52
|
+
},
|
|
53
|
+
"header": { ... },
|
|
54
|
+
"tabs": { ... },
|
|
55
|
+
"terminal": { ... },
|
|
56
|
+
"changes": { ... },
|
|
57
|
+
"status": { ... },
|
|
58
|
+
"messages": { ... },
|
|
59
|
+
"language": { ... }
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Using Translations in Code
|
|
64
|
+
|
|
65
|
+
### In HTML (static text)
|
|
66
|
+
Use the `data-i18n` attribute:
|
|
67
|
+
```html
|
|
68
|
+
<span data-i18n="tabs.terminal">Terminal</span>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### In JavaScript (dynamic text)
|
|
72
|
+
Use the `t()` helper function:
|
|
73
|
+
```javascript
|
|
74
|
+
const text = t('status.connected', 'Connected');
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The second parameter is the fallback text if i18n is not ready.
|
|
78
|
+
|
|
79
|
+
## Language Detection
|
|
80
|
+
|
|
81
|
+
The system automatically:
|
|
82
|
+
1. Checks for a saved language preference in cookies
|
|
83
|
+
2. Falls back to browser language preference
|
|
84
|
+
3. Defaults to English if no match is found
|
|
85
|
+
|
|
86
|
+
When users manually select a language, the preference is saved in a cookie for 365 days.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"app": {
|
|
3
|
+
"title": "Claude Code Runner - Terminal",
|
|
4
|
+
"name": "Claude Code Runner"
|
|
5
|
+
},
|
|
6
|
+
"header": {
|
|
7
|
+
"loading": "loading...",
|
|
8
|
+
"connecting": "Connecting..."
|
|
9
|
+
},
|
|
10
|
+
"tabs": {
|
|
11
|
+
"terminal": "Terminal",
|
|
12
|
+
"changes": "Changes"
|
|
13
|
+
},
|
|
14
|
+
"terminal": {
|
|
15
|
+
"connectingToContainer": "Connecting to container...",
|
|
16
|
+
"clear": "Clear",
|
|
17
|
+
"reconnect": "Reconnect",
|
|
18
|
+
"copySelection": "Copy Selection",
|
|
19
|
+
"soundNotifications": "Sound notifications",
|
|
20
|
+
"shortcuts": "Ctrl+C: Interrupt | Ctrl+D: Exit | Ctrl+L: Clear",
|
|
21
|
+
"welcome": "Welcome to Claude Code Runner Terminal"
|
|
22
|
+
},
|
|
23
|
+
"changes": {
|
|
24
|
+
"noChangesTitle": "No changes detected",
|
|
25
|
+
"noChangesDescription": "Claude hasn't made any changes yet. Changes will appear here automatically when Claude modifies files."
|
|
26
|
+
},
|
|
27
|
+
"status": {
|
|
28
|
+
"connected": "Connected",
|
|
29
|
+
"connecting": "Connecting...",
|
|
30
|
+
"attachingToContainer": "Attaching to container...",
|
|
31
|
+
"connectedTo": "Connected to {{containerId}}",
|
|
32
|
+
"disconnected": "Disconnected",
|
|
33
|
+
"disconnectedFromServer": "Disconnected from server",
|
|
34
|
+
"containerDisconnected": "Container disconnected",
|
|
35
|
+
"error": "Error",
|
|
36
|
+
"waitingForInput": "⚠️ Waiting for input",
|
|
37
|
+
"copiedToClipboard": "Copied to clipboard",
|
|
38
|
+
"noContainersFound": "No containers found",
|
|
39
|
+
"failedToFetchContainers": "Failed to fetch containers",
|
|
40
|
+
"syncFailed": "Sync failed: {{message}}",
|
|
41
|
+
"commitSuccess": "✓ Changes committed successfully",
|
|
42
|
+
"commitFailed": "Commit failed: {{message}}",
|
|
43
|
+
"pushSuccess": "✓ Changes pushed to remote {{branch}}"
|
|
44
|
+
},
|
|
45
|
+
"messages": {
|
|
46
|
+
"reconnecting": "Reconnecting...",
|
|
47
|
+
"noContainersFoundMessage": "No Claude Code Runner containers found.",
|
|
48
|
+
"startContainerFirst": "Please start a container first.",
|
|
49
|
+
"connectionClosed": "Connection closed",
|
|
50
|
+
"connectionError": "Connection error",
|
|
51
|
+
"serverConnectionLost": "Server connection lost. Click \"Reconnect\" to retry.",
|
|
52
|
+
"containerConnectionLost": "Container connection lost. Click \"Reconnect\" to retry.",
|
|
53
|
+
"inputNeeded": "Input needed"
|
|
54
|
+
},
|
|
55
|
+
"language": {
|
|
56
|
+
"label": "Language",
|
|
57
|
+
"en": "English",
|
|
58
|
+
"zh-CN": "简体中文"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"app": {
|
|
3
|
+
"title": "Claude Code Runner - 终端",
|
|
4
|
+
"name": "Claude Code Runner"
|
|
5
|
+
},
|
|
6
|
+
"header": {
|
|
7
|
+
"loading": "加载中...",
|
|
8
|
+
"connecting": "连接中..."
|
|
9
|
+
},
|
|
10
|
+
"tabs": {
|
|
11
|
+
"terminal": "终端",
|
|
12
|
+
"changes": "更改"
|
|
13
|
+
},
|
|
14
|
+
"terminal": {
|
|
15
|
+
"connectingToContainer": "正在连接到容器...",
|
|
16
|
+
"clear": "清屏",
|
|
17
|
+
"reconnect": "重新连接",
|
|
18
|
+
"copySelection": "复制选中",
|
|
19
|
+
"soundNotifications": "声音通知",
|
|
20
|
+
"shortcuts": "Ctrl+C: 中断 | Ctrl+D: 退出 | Ctrl+L: 清屏",
|
|
21
|
+
"welcome": "欢迎使用 Claude Code Runner 终端"
|
|
22
|
+
},
|
|
23
|
+
"changes": {
|
|
24
|
+
"noChangesTitle": "未检测到更改",
|
|
25
|
+
"noChangesDescription": "Claude 尚未进行任何更改。当 Claude 修改文件时,更改将自动显示在此处。"
|
|
26
|
+
},
|
|
27
|
+
"status": {
|
|
28
|
+
"connected": "已连接",
|
|
29
|
+
"connecting": "连接中...",
|
|
30
|
+
"attachingToContainer": "正在连接到容器...",
|
|
31
|
+
"connectedTo": "已连接到 {{containerId}}",
|
|
32
|
+
"disconnected": "已断开",
|
|
33
|
+
"disconnectedFromServer": "与服务器断开连接",
|
|
34
|
+
"containerDisconnected": "容器已断开连接",
|
|
35
|
+
"error": "错误",
|
|
36
|
+
"waitingForInput": "⚠️ 等待输入",
|
|
37
|
+
"copiedToClipboard": "已复制到剪贴板",
|
|
38
|
+
"noContainersFound": "未找到容器",
|
|
39
|
+
"failedToFetchContainers": "获取容器失败",
|
|
40
|
+
"syncFailed": "同步失败: {{message}}",
|
|
41
|
+
"commitSuccess": "✓ 更改已成功提交",
|
|
42
|
+
"commitFailed": "提交失败: {{message}}",
|
|
43
|
+
"pushSuccess": "✓ 更改已推送到远程分支 {{branch}}"
|
|
44
|
+
},
|
|
45
|
+
"messages": {
|
|
46
|
+
"reconnecting": "正在重新连接...",
|
|
47
|
+
"noContainersFoundMessage": "未找到 Claude Code Runner 容器。",
|
|
48
|
+
"startContainerFirst": "请先启动一个容器。",
|
|
49
|
+
"connectionClosed": "连接已关闭",
|
|
50
|
+
"connectionError": "连接错误",
|
|
51
|
+
"serverConnectionLost": "与服务器的连接已断开。点击「重新连接」重试。",
|
|
52
|
+
"containerConnectionLost": "与容器的连接已断开。点击「重新连接」重试。",
|
|
53
|
+
"inputNeeded": "需要输入"
|
|
54
|
+
},
|
|
55
|
+
"language": {
|
|
56
|
+
"label": "语言",
|
|
57
|
+
"en": "English",
|
|
58
|
+
"zh-CN": "简体中文"
|
|
59
|
+
}
|
|
60
|
+
}
|