wormclaude 1.0.58 → 1.0.59
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/dist/i18n.js +13 -7
- package/dist/theme.js +1 -1
- package/package.json +1 -1
package/dist/i18n.js
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
// Çoklu dil (TR/EN) — arayüz metinleri. İlk açılışta dil seçilir, .wormclaude/settings.json'a yazılır.
|
|
2
2
|
import * as fs from 'node:fs';
|
|
3
3
|
import * as path from 'node:path';
|
|
4
|
+
import * as os from 'node:os';
|
|
4
5
|
let current = 'en'; // varsayılan: İngilizce (ilk kurulum). loadLang() kayıtlıysa onu uygular.
|
|
5
6
|
export function setLang(l) { current = l; }
|
|
6
7
|
export function getLang() { return current; }
|
|
7
|
-
//
|
|
8
|
-
|
|
8
|
+
// GLOBAL ayar: bir kez seçilince TÜM klasörlerde geçerli (~/.wormclaude/settings.json).
|
|
9
|
+
// (Önceden process.cwd()'ye yazılıyordu → her klasörde sıfırlanıyordu. Artık ev dizini.)
|
|
10
|
+
const SETTINGS = path.join(os.homedir(), '.wormclaude', 'settings.json');
|
|
11
|
+
// Geriye-uyum: eski proje-yerel ayar varsa onu da oku (yalnız global yoksa).
|
|
12
|
+
const LEGACY_SETTINGS = path.join(process.cwd(), '.wormclaude', 'settings.json');
|
|
9
13
|
export function loadLang() {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
for (const p of [SETTINGS, LEGACY_SETTINGS]) {
|
|
15
|
+
try {
|
|
16
|
+
const j = JSON.parse(fs.readFileSync(p, 'utf8'));
|
|
17
|
+
if (j.lang === 'tr' || j.lang === 'en')
|
|
18
|
+
return j.lang;
|
|
19
|
+
}
|
|
20
|
+
catch { }
|
|
14
21
|
}
|
|
15
|
-
catch { }
|
|
16
22
|
return null;
|
|
17
23
|
}
|
|
18
24
|
export function saveLang(l) {
|
package/dist/theme.js
CHANGED