natureco-cli 5.55.0 → 5.57.0

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.
@@ -1,4 +1,6 @@
1
1
  const chalk = require('chalk');
2
+ const { getLang: _gl } = require('../utils/i18n');
3
+ const L = (tr, en) => (_gl() === 'en' ? en : tr);
2
4
  const inquirer = require('../utils/inquirer-wrapper');
3
5
  const { getConfig, saveConfig } = require('../utils/config');
4
6
  const fs = require('fs');
@@ -30,12 +32,12 @@ async function imessage(action, recipient, message) {
30
32
  async function allowNumber(number) {
31
33
  const config = getConfig();
32
34
  if (!config.imessageCliPath) {
33
- console.log(chalk.red('\n❌ iMessage bağlı değil.\n'));
35
+ console.log(chalk.red(L('\n❌ iMessage bağlı değil.\n', '\n❌ iMessage not connected.\n')));
34
36
  process.exit(1);
35
37
  }
36
38
  if (!number) {
37
- console.log(chalk.red('\n❌ Numara belirtilmedi\n'));
38
- console.log(chalk.gray('Kullanım: natureco imessage allow <numara|email>\n'));
39
+ console.log(chalk.red(L('\n❌ Numara belirtilmedi\n', '\n❌ Number not specified\n')));
40
+ console.log(chalk.gray(L('Kullanım: natureco imessage allow <numara|email>\n', 'Usage: natureco imessage allow <number|email>\n')));
39
41
  process.exit(1);
40
42
  }
41
43
 
@@ -49,14 +51,14 @@ async function allowNumber(number) {
49
51
  config.imessageAllowedNumbers = allowList;
50
52
  saveConfig(config);
51
53
 
52
- console.log(chalk.green(`\n✅ İzin verildi: ${number}`));
53
- console.log(chalk.gray(`Toplam izinli: ${allowList.length}`));
54
+ console.log(chalk.green(`\n✅ ${L('İzin verildi', 'Allowed')}: ${number}`));
55
+ console.log(chalk.gray(`${L('Toplam izinli', 'Total allowed')}: ${allowList.length}`));
54
56
  }
55
57
 
56
58
  async function disallowNumber(number) {
57
59
  const config = getConfig();
58
60
  if (!number) {
59
- console.log(chalk.red('\n❌ Numara belirtilmedi\n'));
61
+ console.log(chalk.red(L('\n❌ Numara belirtilmedi\n', '\n❌ Number not specified\n')));
60
62
  process.exit(1);
61
63
  }
62
64
 
@@ -65,48 +67,48 @@ async function disallowNumber(number) {
65
67
  config.imessageAllowedNumbers = newList;
66
68
  saveConfig(config);
67
69
 
68
- console.log(chalk.green(`\n✅ İzin kaldırıldı: ${number}`));
70
+ console.log(chalk.green(`\n✅ ${L('İzin kaldırıldı', 'Permission removed')}: ${number}`));
69
71
  }
70
72
 
71
73
  async function sendMessage(recipient, message) {
72
74
  const config = getConfig();
73
75
 
74
76
  if (!config.imessageCliPath) {
75
- console.log(chalk.red('\n❌ iMessage bağlı değil. Önce "natureco imessage connect" çalıştırın.\n'));
77
+ console.log(chalk.red(L('\n❌ iMessage bağlı değil. Önce "natureco imessage connect" çalıştırın.\n', '\n❌ iMessage not connected. Run "natureco imessage connect" first.\n')));
76
78
  process.exit(1);
77
79
  }
78
80
 
79
81
  if (!recipient) {
80
- console.log(chalk.red('\n❌ Alıcı belirtilmedi\n'));
81
- console.log(chalk.gray('Kullanım: natureco imessage send <numara|email> <mesaj>\n'));
82
- console.log(chalk.gray('Örnek: natureco imessage send +905551234567 Merhaba!\n'));
82
+ console.log(chalk.red(L('\n❌ Alıcı belirtilmedi\n', '\n❌ Recipient not specified\n')));
83
+ console.log(chalk.gray(L('Kullanım: natureco imessage send <numara|email> <mesaj>\n', 'Usage: natureco imessage send <number|email> <message>\n')));
84
+ console.log(chalk.gray(L('Örnek: natureco imessage send +905551234567 Merhaba!\n', 'Example: natureco imessage send +905551234567 Hello!\n')));
83
85
  process.exit(1);
84
86
  }
85
87
 
86
88
  if (!message) {
87
- console.log(chalk.red('\n❌ Mesaj belirtilmedi\n'));
89
+ console.log(chalk.red(L('\n❌ Mesaj belirtilmedi\n', '\n❌ Message not specified\n')));
88
90
  process.exit(1);
89
91
  }
90
92
 
91
93
  // Birden fazla kelimeyi birleştir
92
94
  const fullMessage = process.argv.slice(process.argv.indexOf(recipient) + 1).join(' ') || message;
93
95
 
94
- console.log(chalk.cyan(`\n📤 iMessage gönderiliyor...`));
95
- console.log(chalk.gray(` Alıcı: ${recipient}`));
96
- console.log(chalk.gray(` Mesaj: ${fullMessage.slice(0, 60)}${fullMessage.length > 60 ? '...' : ''}\n`));
96
+ console.log(chalk.cyan(`\n📤 iMessage ${L('gönderiliyor...', 'sending...')}`));
97
+ console.log(chalk.gray(` ${L('Alıcı', 'Recipient')}: ${recipient}`));
98
+ console.log(chalk.gray(` ${L('Mesaj', 'Message')}: ${fullMessage.slice(0, 60)}${fullMessage.length > 60 ? '...' : ''}\n`));
97
99
 
98
100
  try {
99
101
  // imsg send komutu (v5.6.26: --to kullan, --recipient değil)
100
102
  const cmd = `${config.imessageCliPath} send --to "${recipient}" --text "${fullMessage.replace(/"/g, '\\"')}"`;
101
103
  const output = execSync(cmd, { encoding: 'utf8', timeout: 30000 });
102
104
 
103
- console.log(chalk.green('✅ Mesaj gönderildi!'));
105
+ console.log(chalk.green(L('✅ Mesaj gönderildi!', '✅ Message sent!')));
104
106
  if (output && output.trim()) {
105
107
  console.log(chalk.gray(output.trim()));
106
108
  }
107
109
  return { success: true, recipient, message: fullMessage };
108
110
  } catch (e) {
109
- console.log(chalk.red('❌ Mesaj gönderilemedi'));
111
+ console.log(chalk.red(L('❌ Mesaj gönderilemedi', '❌ Message could not be sent')));
110
112
  if (e.stderr) console.log(chalk.gray(e.stderr.toString()));
111
113
  else if (e.message) console.log(chalk.gray(e.message));
112
114
  return { success: false, error: e.message };
@@ -116,19 +118,19 @@ async function sendMessage(recipient, message) {
116
118
  async function connectImessage() {
117
119
  const config = getConfig();
118
120
  if (!config.providerUrl) {
119
- console.log(chalk.red('\n❌ Setup yapılmamış. Önce "natureco setup" çalıştırın.\n'));
121
+ console.log(chalk.red(L('\n❌ Setup yapılmamış. Önce "natureco setup" çalıştırın.\n', '\n❌ Setup not done. Run "natureco setup" first.\n')));
120
122
  process.exit(1);
121
123
  }
122
124
 
123
125
  if (process.platform !== 'darwin') {
124
- console.log(chalk.red('\n❌ iMessage sadece macOS\'te çalışır.\n'));
125
- console.log(chalk.gray('Mevcut platform:'), chalk.white(process.platform));
126
- console.log(chalk.gray('Diğer platformlar için SMS (Twilio) kullanılabilir.\n'));
126
+ console.log(chalk.red(L('\n❌ iMessage sadece macOS\'te çalışır.\n', '\n❌ iMessage only works on macOS.\n')));
127
+ console.log(chalk.gray(L('Mevcut platform:', 'Current platform:')), chalk.white(process.platform));
128
+ console.log(chalk.gray(L('Diğer platformlar için SMS (Twilio) kullanılabilir.\n', 'For other platforms, SMS (Twilio) can be used.\n')));
127
129
  process.exit(1);
128
130
  }
129
131
 
130
- console.log(chalk.yellow('\n⏳ iMessage bağlantısı hazırlanıyor...\n'));
131
- console.log(chalk.gray('Gereken: imsg bridge — https://github.com/mbilker/imsg\n'));
132
+ console.log(chalk.yellow(L('\n⏳ iMessage bağlantısı hazırlanıyor...\n', '\n⏳ Preparing iMessage connection...\n')));
133
+ console.log(chalk.gray(L('Gereken: imsg bridge — https://github.com/mbilker/imsg\n', 'Required: imsg bridge — https://github.com/mbilker/imsg\n')));
132
134
 
133
135
  const defaults = {
134
136
  cliPath: config.imessageCliPath || '',
@@ -138,15 +140,15 @@ async function connectImessage() {
138
140
  };
139
141
 
140
142
  const answers = await inquirer.prompt([
141
- { type: 'input', name: 'cliPath', message: 'imsg CLI yolu (boş = PATH):', default: defaults.cliPath },
142
- { type: 'input', name: 'dbPath', message: 'iMessage veritabanı yolu:', default: defaults.dbPath },
143
- { type: 'list', name: 'service', message: 'Servis:', default: defaults.service, choices: [
144
- { name: 'Auto-detect (önerilen)', value: 'auto' },
143
+ { type: 'input', name: 'cliPath', message: L('imsg CLI yolu (boş = PATH):', 'imsg CLI path (empty = PATH):'), default: defaults.cliPath },
144
+ { type: 'input', name: 'dbPath', message: L('iMessage veritabanı yolu:', 'iMessage database path:'), default: defaults.dbPath },
145
+ { type: 'list', name: 'service', message: L('Servis:', 'Service:'), default: defaults.service, choices: [
146
+ { name: L('Auto-detect (önerilen)', 'Auto-detect (recommended)'), value: 'auto' },
145
147
  { name: 'iMessage', value: 'imessage' },
146
148
  { name: 'SMS', value: 'sms' },
147
149
  ]},
148
- { type: 'list', name: 'dmPolicy', message: 'DM politikası:', default: defaults.dmPolicy, choices: [
149
- { name: 'Pairing (önerilen)', value: 'pairing' },
150
+ { type: 'list', name: 'dmPolicy', message: L('DM politikası:', 'DM policy:'), default: defaults.dmPolicy, choices: [
151
+ { name: L('Pairing (önerilen)', 'Pairing (recommended)'), value: 'pairing' },
150
152
  { name: 'Allowlist', value: 'allowlist' },
151
153
  { name: 'Open', value: 'open' },
152
154
  { name: 'Disabled', value: 'disabled' },
@@ -161,11 +163,11 @@ async function connectImessage() {
161
163
  config.imessageBotId = botId;
162
164
  saveConfig(config);
163
165
 
164
- console.log(chalk.green('\n✅ iMessage bağlantısı kaydedildi!\n'));
166
+ console.log(chalk.green(L('\n✅ iMessage bağlantısı kaydedildi!\n', '\n✅ iMessage connection saved!\n')));
165
167
  console.log(chalk.cyan('Bot ID:'), chalk.white(botId));
166
- if (config.imessageCliPath) console.log(chalk.cyan('CLI Yolu:'), chalk.white(config.imessageCliPath));
167
- console.log(chalk.cyan('Servis:'), chalk.white(answers.service));
168
- console.log(chalk.gray('\nGateway ile başlatmak için: natureco gateway start\n'));
168
+ if (config.imessageCliPath) console.log(chalk.cyan(L('CLI Yolu:', 'CLI Path:')), chalk.white(config.imessageCliPath));
169
+ console.log(chalk.cyan(L('Servis:', 'Service:')), chalk.white(answers.service));
170
+ console.log(chalk.gray(L('\nGateway ile başlatmak için: natureco gateway start\n', '\nTo start with the gateway: natureco gateway start\n')));
169
171
  }
170
172
 
171
173
  async function disconnectImessage() {
@@ -175,7 +177,7 @@ async function disconnectImessage() {
175
177
  return;
176
178
  }
177
179
  const { confirm } = await inquirer.prompt([
178
- { type: 'confirm', name: 'confirm', message: 'iMessage bağlantısını kaldırmak istediğinize emin misiniz?', default: false }
180
+ { type: 'confirm', name: 'confirm', message: L('iMessage bağlantısını kaldırmak istediğinize emin misiniz?', 'Are you sure you want to remove the iMessage connection?'), default: false }
179
181
  ]);
180
182
  if (!confirm) {
181
183
  console.log(chalk.gray('\nCancelled\n'));
@@ -196,15 +198,15 @@ async function statusImessage() {
196
198
  }
197
199
  console.log(chalk.green('\n✅ iMessage connected\n'));
198
200
  console.log(chalk.cyan('Bot ID:'), chalk.white(config.imessageBotId));
199
- if (config.imessageCliPath) console.log(chalk.cyan('CLI Yolu:'), chalk.white(config.imessageCliPath));
200
- console.log(chalk.cyan('Servis:'), chalk.white(config.imessageService || 'auto'));
201
+ if (config.imessageCliPath) console.log(chalk.cyan(L('CLI Yolu:', 'CLI Path:')), chalk.white(config.imessageCliPath));
202
+ console.log(chalk.cyan(L('Servis:', 'Service:')), chalk.white(config.imessageService || 'auto'));
201
203
 
202
204
  if (process.platform === 'darwin') {
203
205
  const imsgPath = findImsgBinary(config);
204
- console.log(chalk.cyan('imsg binary:'), chalk.white(imsgPath || 'Bulunamadı'));
205
- if (config.imessageDbPath) console.log(chalk.cyan('DB Yolu:'), chalk.white(config.imessageDbPath));
206
+ console.log(chalk.cyan('imsg binary:'), chalk.white(imsgPath || L('Bulunamadı', 'Not found')));
207
+ if (config.imessageDbPath) console.log(chalk.cyan(L('DB Yolu:', 'DB Path:')), chalk.white(config.imessageDbPath));
206
208
  } else {
207
- console.log(chalk.yellow('\n⚠️ iMessage sadece macOS\'te çalışır'));
209
+ console.log(chalk.yellow(L('\n⚠️ iMessage sadece macOS\'te çalışır', '\n⚠️ iMessage only works on macOS')));
208
210
  }
209
211
 
210
212
  console.log(chalk.gray('\nDisconnect with: natureco imessage disconnect\n'));
@@ -213,23 +215,23 @@ async function statusImessage() {
213
215
  async function probeImessage() {
214
216
  const config = getConfig();
215
217
  if (!config.imessageBotId) {
216
- console.log(chalk.red('\n❌ iMessage bağlantısı yapılmamış\n'));
217
- console.log(chalk.gray('Önce: natureco imessage connect\n'));
218
+ console.log(chalk.red(L('\n❌ iMessage bağlantısı yapılmamış\n', '\n❌ iMessage connection not set up\n')));
219
+ console.log(chalk.gray(L('Önce: natureco imessage connect\n', 'First: natureco imessage connect\n')));
218
220
  process.exit(1);
219
221
  }
220
222
 
221
223
  if (process.platform !== 'darwin') {
222
- console.log(chalk.red('\n❌ iMessage sadece macOS\'te kullanılabilir.\n'));
224
+ console.log(chalk.red(L('\n❌ iMessage sadece macOS\'te kullanılabilir.\n', '\n❌ iMessage can only be used on macOS.\n')));
223
225
  process.exit(1);
224
226
  }
225
227
 
226
- console.log(chalk.yellow('\n⏳ iMessage problanıyor...\n'));
228
+ console.log(chalk.yellow(L('\n⏳ iMessage problanıyor...\n', '\n⏳ Probing iMessage...\n')));
227
229
 
228
230
  const imsgPath = findImsgBinary(config);
229
231
  if (!imsgPath) {
230
- console.log(chalk.red('✗ imsg binary bulunamadı\n'));
231
- console.log(chalk.gray('Kurulum: brew install mbilker/imsg/imsg'));
232
- console.log(chalk.gray('Veya: https://github.com/mbilker/imsg\n'));
232
+ console.log(chalk.red(L('✗ imsg binary bulunamadı\n', '✗ imsg binary not found\n')));
233
+ console.log(chalk.gray(L('Kurulum: brew install mbilker/imsg/imsg', 'Installation: brew install mbilker/imsg/imsg')));
234
+ console.log(chalk.gray(L('Veya: https://github.com/mbilker/imsg\n', 'Or: https://github.com/mbilker/imsg\n')));
233
235
  process.exit(1);
234
236
  }
235
237
  console.log(chalk.green(`✓ imsg found: ${imsgPath}`));
@@ -239,7 +241,7 @@ async function probeImessage() {
239
241
  if (fs.existsSync(dbPath)) {
240
242
  console.log(chalk.green(`✓ iMessage DB: ${dbPath}`));
241
243
  } else {
242
- console.log(chalk.yellow(`⚠️ iMessage DB bulunamadı: ${dbPath}`));
244
+ console.log(chalk.yellow(`⚠️ iMessage DB ${L('bulunamadı', 'not found')}: ${dbPath}`));
243
245
  }
244
246
 
245
247
  // Try to send a test message (dry run)
@@ -247,7 +249,7 @@ async function probeImessage() {
247
249
  const result = execSync(`"${imsgPath}" --help 2>&1`, { encoding: 'utf-8', timeout: 5000 });
248
250
  console.log(chalk.gray(`\nimsg version: ${result.split('\n')[0]}`));
249
251
  } catch {
250
- console.log(chalk.yellow('⚠️ imsg çalıştırılamadı'));
252
+ console.log(chalk.yellow(L('⚠️ imsg çalıştırılamadı', '⚠️ imsg could not be run')));
251
253
  }
252
254
 
253
255
  console.log('');
@@ -1,4 +1,6 @@
1
1
  const chalk = require('chalk');
2
+ const { getLang: _gl } = require('../utils/i18n');
3
+ const L = (tr, en) => (_gl() === 'en' ? en : tr);
2
4
  const inquirer = require('../utils/inquirer-wrapper');
3
5
  const { getConfig, saveConfig } = require('../utils/config');
4
6
 
@@ -14,10 +16,10 @@ async function irc(action) {
14
16
  async function connectIrc() {
15
17
  const config = getConfig();
16
18
  if (!config.providerUrl) {
17
- console.log(chalk.red('\n❌ Setup yapılmamış. Önce "natureco setup" çalıştırın.\n'));
19
+ console.log(chalk.red(L('\n❌ Setup yapılmamış. Önce "natureco setup" çalıştırın.\n', '\n❌ Setup not done. Run "natureco setup" first.\n')));
18
20
  process.exit(1);
19
21
  }
20
- console.log(chalk.yellow('\n⏳ IRC bağlantısı hazırlanıyor...\n'));
22
+ console.log(chalk.yellow(L('\n⏳ IRC bağlantısı hazırlanıyor...\n', '\n⏳ Preparing IRC connection...\n')));
21
23
 
22
24
  const defaults = {
23
25
  host: config.ircHost || '',
@@ -34,18 +36,18 @@ async function connectIrc() {
34
36
  };
35
37
 
36
38
  const answers = await inquirer.prompt([
37
- { type: 'input', name: 'host', message: 'IRC sunucusu:', default: defaults.host, validate: v => v.trim() ? true : 'Gerekli' },
38
- { type: 'input', name: 'port', message: 'Port:', default: String(defaults.port), validate: v => { const n = parseInt(v); return n > 0 && n < 65536 ? true : '1-65535 arası' } },
39
- { type: 'confirm', name: 'tls', message: 'TLS kullanılsın mı?', default: defaults.tls },
40
- { type: 'input', name: 'nick', message: 'Nick:', default: defaults.nick, validate: v => v.trim() ? true : 'Gerekli' },
41
- { type: 'input', name: 'username', message: 'Kullanıcı adı (opsiyonel):', default: defaults.username || defaults.nick },
42
- { type: 'input', name: 'realname', message: 'Gerçek ad (opsiyonel):', default: defaults.realname || 'NatureCo' },
43
- { type: 'password', name: 'password', message: 'Sunucu parolası (opsiyonel):' },
44
- { type: 'input', name: 'channels', message: 'Kanallar (virgülle ayırın):', default: defaults.channels.join(',') },
45
- { type: 'confirm', name: 'nickservEnabled', message: 'NickServ kullanılsın mı?', default: defaults.nickservEnabled },
46
- { type: 'password', name: 'nickservPassword', message: 'NickServ parolası (opsiyonel):' },
47
- { type: 'list', name: 'dmPolicy', message: 'DM politikası:', default: defaults.dmPolicy, choices: [
48
- { name: 'Pairing (önerilen)', value: 'pairing' },
39
+ { type: 'input', name: 'host', message: L('IRC sunucusu:', 'IRC server:'), default: defaults.host, validate: v => v.trim() ? true : L('Gerekli', 'Required') },
40
+ { type: 'input', name: 'port', message: 'Port:', default: String(defaults.port), validate: v => { const n = parseInt(v); return n > 0 && n < 65536 ? true : L('1-65535 arası', 'between 1-65535') } },
41
+ { type: 'confirm', name: 'tls', message: L('TLS kullanılsın mı?', 'Use TLS?'), default: defaults.tls },
42
+ { type: 'input', name: 'nick', message: 'Nick:', default: defaults.nick, validate: v => v.trim() ? true : L('Gerekli', 'Required') },
43
+ { type: 'input', name: 'username', message: L('Kullanıcı adı (opsiyonel):', 'Username (optional):'), default: defaults.username || defaults.nick },
44
+ { type: 'input', name: 'realname', message: L('Gerçek ad (opsiyonel):', 'Real name (optional):'), default: defaults.realname || 'NatureCo' },
45
+ { type: 'password', name: 'password', message: L('Sunucu parolası (opsiyonel):', 'Server password (optional):') },
46
+ { type: 'input', name: 'channels', message: L('Kanallar (virgülle ayırın):', 'Channels (comma-separated):'), default: defaults.channels.join(',') },
47
+ { type: 'confirm', name: 'nickservEnabled', message: L('NickServ kullanılsın mı?', 'Use NickServ?'), default: defaults.nickservEnabled },
48
+ { type: 'password', name: 'nickservPassword', message: L('NickServ parolası (opsiyonel):', 'NickServ password (optional):') },
49
+ { type: 'list', name: 'dmPolicy', message: L('DM politikası:', 'DM policy:'), default: defaults.dmPolicy, choices: [
50
+ { name: L('Pairing (önerilen)', 'Pairing (recommended)'), value: 'pairing' },
49
51
  { name: 'Allowlist', value: 'allowlist' },
50
52
  { name: 'Open', value: 'open' },
51
53
  { name: 'Disabled', value: 'disabled' },
@@ -67,12 +69,12 @@ async function connectIrc() {
67
69
  config.ircBotId = botId;
68
70
  saveConfig(config);
69
71
 
70
- console.log(chalk.green('\n✅ IRC bağlantısı kaydedildi!\n'));
72
+ console.log(chalk.green(L('\n✅ IRC bağlantısı kaydedildi!\n', '\n✅ IRC connection saved!\n')));
71
73
  console.log(chalk.cyan('Bot ID:'), chalk.white(botId));
72
- console.log(chalk.cyan('Sunucu:'), chalk.white(`${answers.host.trim()}:${answers.port}`));
74
+ console.log(chalk.cyan(L('Sunucu:', 'Server:')), chalk.white(`${answers.host.trim()}:${answers.port}`));
73
75
  console.log(chalk.cyan('Nick:'), chalk.white(answers.nick.trim()));
74
- if (config.ircChannels.length) console.log(chalk.cyan('Kanallar:'), chalk.white(config.ircChannels.join(', ')));
75
- console.log(chalk.gray('\nGateway ile başlatmak için: natureco gateway start\n'));
76
+ if (config.ircChannels.length) console.log(chalk.cyan(L('Kanallar:', 'Channels:')), chalk.white(config.ircChannels.join(', ')));
77
+ console.log(chalk.gray(L('\nGateway ile başlatmak için: natureco gateway start\n', '\nTo start with the gateway: natureco gateway start\n')));
76
78
  }
77
79
 
78
80
  async function disconnectIrc() {
@@ -82,7 +84,7 @@ async function disconnectIrc() {
82
84
  return;
83
85
  }
84
86
  const { confirm } = await inquirer.prompt([
85
- { type: 'confirm', name: 'confirm', message: 'IRC bağlantısını kaldırmak istediğinize emin misiniz?', default: false }
87
+ { type: 'confirm', name: 'confirm', message: L('IRC bağlantısını kaldırmak istediğinize emin misiniz?', 'Are you sure you want to remove the IRC connection?'), default: false }
86
88
  ]);
87
89
  if (!confirm) {
88
90
  console.log(chalk.gray('\nCancelled\n'));
@@ -105,14 +107,14 @@ function statusIrc() {
105
107
  }
106
108
  console.log(chalk.green('\n✅ IRC connected\n'));
107
109
  console.log(chalk.cyan('Bot ID:'), chalk.white(config.ircBotId));
108
- console.log(chalk.cyan('Sunucu:'), chalk.white(`${config.ircHost}:${config.ircPort}`));
109
- console.log(chalk.cyan('TLS:'), chalk.white(config.ircTls ? 'Evet' : 'Hayır'));
110
+ console.log(chalk.cyan(L('Sunucu:', 'Server:')), chalk.white(`${config.ircHost}:${config.ircPort}`));
111
+ console.log(chalk.cyan('TLS:'), chalk.white(config.ircTls ? L('Evet', 'Yes') : L('Hayır', 'No')));
110
112
  console.log(chalk.cyan('Nick:'), chalk.white(config.ircNick));
111
- console.log(chalk.cyan('Kullanıcı:'), chalk.white(config.ircUsername));
113
+ console.log(chalk.cyan(L('Kullanıcı:', 'User:')), chalk.white(config.ircUsername));
112
114
  if (config.ircRealname) console.log(chalk.cyan('Realname:'), chalk.white(config.ircRealname));
113
- if (config.ircChannels?.length) console.log(chalk.cyan('Kanallar:'), chalk.white(config.ircChannels.join(', ')));
114
- console.log(chalk.cyan('NickServ:'), chalk.white(config.ircNickservEnabled ? 'Evet' : 'Hayır'));
115
- console.log(chalk.cyan('DM Politikası:'), chalk.white(config.ircDmPolicy || 'pairing'));
115
+ if (config.ircChannels?.length) console.log(chalk.cyan(L('Kanallar:', 'Channels:')), chalk.white(config.ircChannels.join(', ')));
116
+ console.log(chalk.cyan('NickServ:'), chalk.white(config.ircNickservEnabled ? L('Evet', 'Yes') : L('Hayır', 'No')));
117
+ console.log(chalk.cyan(L('DM Politikası:', 'DM Policy:')), chalk.white(config.ircDmPolicy || 'pairing'));
116
118
  console.log(chalk.gray('\nDisconnect with: natureco irc disconnect\n'));
117
119
  }
118
120
 
@@ -1,4 +1,6 @@
1
1
  const chalk = require('chalk');
2
+ const { getLang: _gl } = require('../utils/i18n');
3
+ const L = (tr, en) => (_gl() === 'en' ? en : tr);
2
4
  const inquirer = require('../utils/inquirer-wrapper');
3
5
  const { getConfig, saveConfig } = require('../utils/config');
4
6
 
@@ -15,14 +17,14 @@ async function mattermost(action) {
15
17
  async function connectMattermost() {
16
18
  const config = getConfig();
17
19
  if (!config.providerUrl) {
18
- console.log(chalk.red('\n❌ Setup yapılmamış. Önce "natureco setup" çalıştırın.\n'));
20
+ console.log(chalk.red(L('\n❌ Setup yapılmamış. Önce "natureco setup" çalıştırın.\n', '\n❌ Setup not done. Run "natureco setup" first.\n')));
19
21
  process.exit(1);
20
22
  }
21
- console.log(chalk.yellow('\n⏳ Mattermost bağlantısı hazırlanıyor...\n'));
22
- console.log(chalk.gray('Mattermost bot token almak için:'));
23
+ console.log(chalk.yellow(L('\n⏳ Mattermost bağlantısı hazırlanıyor...\n', '\n⏳ Preparing Mattermost connection...\n')));
24
+ console.log(chalk.gray(L('Mattermost bot token almak için:', 'To get a Mattermost bot token:')));
23
25
  console.log(chalk.gray('1. Mattermost > System Console > Bot Accounts'));
24
- console.log(chalk.gray('2. Bot oluşturun veya mevcut botu kullanın'));
25
- console.log(chalk.gray('3. Access Token oluşturun\n'));
26
+ console.log(chalk.gray(L('2. Bot oluşturun veya mevcut botu kullanın', '2. Create a bot or use an existing one')));
27
+ console.log(chalk.gray(L('3. Access Token oluşturun\n', '3. Create an Access Token\n')));
26
28
 
27
29
  const defaults = {
28
30
  baseUrl: config.mattermostBaseUrl || '',
@@ -31,11 +33,11 @@ async function connectMattermost() {
31
33
  };
32
34
 
33
35
  const answers = await inquirer.prompt([
34
- { type: 'input', name: 'baseUrl', message: 'Mattermost sunucu URL:', default: defaults.baseUrl, validate: v => v.trim() ? true : 'Gerekli' },
35
- { type: 'input', name: 'token', message: 'Bot token:', default: defaults.token ? defaults.token.slice(0, 10) + '...' : '', validate: v => v.trim() ? true : 'Gerekli' },
36
- { type: 'confirm', name: 'enableSlash', message: 'Slash komutları kaydedilsin mi?', default: config.mattermostSlashEnabled !== false },
37
- { type: 'list', name: 'dmPolicy', message: 'DM politikası:', default: defaults.dmPolicy, choices: [
38
- { name: 'Pairing (önerilen)', value: 'pairing' },
36
+ { type: 'input', name: 'baseUrl', message: L('Mattermost sunucu URL:', 'Mattermost server URL:'), default: defaults.baseUrl, validate: v => v.trim() ? true : L('Gerekli', 'Required') },
37
+ { type: 'input', name: 'token', message: 'Bot token:', default: defaults.token ? defaults.token.slice(0, 10) + '...' : '', validate: v => v.trim() ? true : L('Gerekli', 'Required') },
38
+ { type: 'confirm', name: 'enableSlash', message: L('Slash komutları kaydedilsin mi?', 'Register slash commands?'), default: config.mattermostSlashEnabled !== false },
39
+ { type: 'list', name: 'dmPolicy', message: L('DM politikası:', 'DM policy:'), default: defaults.dmPolicy, choices: [
40
+ { name: L('Pairing (önerilen)', 'Pairing (recommended)'), value: 'pairing' },
39
41
  { name: 'Allowlist', value: 'allowlist' },
40
42
  { name: 'Open', value: 'open' },
41
43
  { name: 'Disabled', value: 'disabled' },
@@ -50,11 +52,11 @@ async function connectMattermost() {
50
52
  config.mattermostBotId = botId;
51
53
  saveConfig(config);
52
54
 
53
- console.log(chalk.green('\n✅ Mattermost bağlantısı kaydedildi!\n'));
55
+ console.log(chalk.green(L('\n✅ Mattermost bağlantısı kaydedildi!\n', '\n✅ Mattermost connection saved!\n')));
54
56
  console.log(chalk.cyan('Bot ID:'), chalk.white(botId));
55
- console.log(chalk.cyan('Sunucu:'), chalk.white(config.mattermostBaseUrl));
57
+ console.log(chalk.cyan(L('Sunucu:', 'Server:')), chalk.white(config.mattermostBaseUrl));
56
58
  console.log(chalk.cyan('Token:'), chalk.white((answers.token || '').slice(0, 20) + '...'));
57
- console.log(chalk.gray('\nGateway ile başlatmak için: natureco gateway start\n'));
59
+ console.log(chalk.gray(L('\nGateway ile başlatmak için: natureco gateway start\n', '\nTo start with the gateway: natureco gateway start\n')));
58
60
  }
59
61
 
60
62
  async function disconnectMattermost() {
@@ -64,7 +66,7 @@ async function disconnectMattermost() {
64
66
  return;
65
67
  }
66
68
  const { confirm } = await inquirer.prompt([
67
- { type: 'confirm', name: 'confirm', message: 'Mattermost bağlantısını kaldırmak istediğinize emin misiniz?', default: false }
69
+ { type: 'confirm', name: 'confirm', message: L('Mattermost bağlantısını kaldırmak istediğinize emin misiniz?', 'Are you sure you want to remove the Mattermost connection?'), default: false }
68
70
  ]);
69
71
  if (!confirm) {
70
72
  console.log(chalk.gray('\nCancelled\n'));
@@ -86,14 +88,14 @@ function statusMattermost() {
86
88
  }
87
89
  console.log(chalk.green('\n✅ Mattermost connected\n'));
88
90
  console.log(chalk.cyan('Bot ID:'), chalk.white(config.mattermostBotId));
89
- console.log(chalk.cyan('Sunucu:'), chalk.white(config.mattermostBaseUrl));
91
+ console.log(chalk.cyan(L('Sunucu:', 'Server:')), chalk.white(config.mattermostBaseUrl));
90
92
  console.log(chalk.cyan('Token:'), chalk.white((config.mattermostToken || '').slice(0, 20) + '...'));
91
- console.log(chalk.cyan('Slash Komutları:'), chalk.white(config.mattermostSlashEnabled !== false ? 'Aktif' : 'Devre Dışı'));
92
- console.log(chalk.cyan('DM Politikası:'), chalk.white(config.mattermostDmPolicy || 'pairing'));
93
+ console.log(chalk.cyan(L('Slash Komutları:', 'Slash Commands:')), chalk.white(config.mattermostSlashEnabled !== false ? L('Aktif', 'Active') : L('Devre Dışı', 'Disabled')));
94
+ console.log(chalk.cyan(L('DM Politikası:', 'DM Policy:')), chalk.white(config.mattermostDmPolicy || 'pairing'));
93
95
 
94
96
  // Optionally probe
95
97
  if (config.mattermostBaseUrl && config.mattermostToken) {
96
- console.log(chalk.gray('\nProbe için: natureco mattermost probe\n'));
98
+ console.log(chalk.gray(L('\nProbe için: natureco mattermost probe\n', '\nFor probe: natureco mattermost probe\n')));
97
99
  }
98
100
  console.log(chalk.gray('\nDisconnect with: natureco mattermost disconnect\n'));
99
101
  }
@@ -101,15 +103,15 @@ function statusMattermost() {
101
103
  async function probeMattermost() {
102
104
  const config = getConfig();
103
105
  if (!config.mattermostBaseUrl || !config.mattermostToken) {
104
- console.log(chalk.red('\n❌ Mattermost bağlantısı yapılmamış\n'));
105
- console.log(chalk.gray('Önce: natureco mattermost connect\n'));
106
+ console.log(chalk.red(L('\n❌ Mattermost bağlantısı yapılmamış\n', '\n❌ Mattermost connection not set up\n')));
107
+ console.log(chalk.gray(L('Önce: natureco mattermost connect\n', 'First: natureco mattermost connect\n')));
106
108
  process.exit(1);
107
109
  }
108
110
 
109
111
  const baseUrl = config.mattermostBaseUrl.replace(/\/+$/, '');
110
112
  const token = config.mattermostToken;
111
113
 
112
- console.log(chalk.yellow(`\n⏳ Problanıyor: ${baseUrl}\n`));
114
+ console.log(chalk.yellow(`\n⏳ ${L('Problanıyor', 'Probing')}: ${baseUrl}\n`));
113
115
 
114
116
  try {
115
117
  const res = await fetch(`${baseUrl}/api/v4/users/me`, {
@@ -118,18 +120,18 @@ async function probeMattermost() {
118
120
  });
119
121
 
120
122
  if (!res.ok) {
121
- console.log(chalk.red(`✗ API Hatası: HTTP ${res.status}`));
122
- if (res.status === 401) console.log(chalk.gray(' Token geçersiz. Yeni bir bot token alın.'));
123
- if (res.status === 403) console.log(chalk.gray(' Botun yetkisi yetersiz.'));
123
+ console.log(chalk.red(`✗ ${L('API Hatası', 'API Error')}: HTTP ${res.status}`));
124
+ if (res.status === 401) console.log(chalk.gray(L(' Token geçersiz. Yeni bir bot token alın.', ' Token invalid. Get a new bot token.')));
125
+ if (res.status === 403) console.log(chalk.gray(L(' Botun yetkisi yetersiz.', ' Bot has insufficient permissions.')));
124
126
  process.exit(1);
125
127
  }
126
128
 
127
129
  const me = await res.json();
128
- console.log(chalk.green('✓ API Bağlantısı Başarılı\n'));
129
- console.log(chalk.cyan('Bot Kullanıcı ID:'), chalk.white(me.id));
130
- console.log(chalk.cyan('Kullanıcı Adı:'), chalk.white(me.username));
131
- console.log(chalk.cyan('E-posta:'), chalk.white(me.email));
132
- console.log(chalk.cyan('Rol:'), chalk.white(me.roles));
130
+ console.log(chalk.green(L('✓ API Bağlantısı Başarılı\n', '✓ API Connection Successful\n')));
131
+ console.log(chalk.cyan(L('Bot Kullanıcı ID:', 'Bot User ID:')), chalk.white(me.id));
132
+ console.log(chalk.cyan(L('Kullanıcı Adı:', 'Username:')), chalk.white(me.username));
133
+ console.log(chalk.cyan(L('E-posta:', 'Email:')), chalk.white(me.email));
134
+ console.log(chalk.cyan(L('Rol:', 'Role:')), chalk.white(me.roles));
133
135
 
134
136
  // Check WebSocket
135
137
  const wsUrl = baseUrl.replace(/^http/, 'ws') + '/api/v4/websocket';
@@ -143,7 +145,7 @@ async function probeMattermost() {
143
145
  });
144
146
  if (teamsRes.ok) {
145
147
  const teams = await teamsRes.json();
146
- console.log(chalk.gray(`\nTakımlar (${teams.length}):`));
148
+ console.log(chalk.gray(`\n${L('Takımlar', 'Teams')} (${teams.length}):`));
147
149
  for (const team of teams.slice(0, 5)) {
148
150
  console.log(chalk.gray(` - ${team.display_name} (${team.name})`));
149
151
  }
@@ -153,9 +155,9 @@ async function probeMattermost() {
153
155
  console.log('');
154
156
 
155
157
  } catch (err) {
156
- console.log(chalk.red(`\n✗ Probe hatası: ${err.message}\n`));
158
+ console.log(chalk.red(`\n✗ ${L('Probe hatası', 'Probe error')}: ${err.message}\n`));
157
159
  if (err.message.includes('ENOTFOUND') || err.message.includes('ECONNREFUSED')) {
158
- console.log(chalk.gray('Sunucuya erişilemiyor. URL\'yi kontrol edin.\n'));
160
+ console.log(chalk.gray(L('Sunucuya erişilemiyor. URL\'yi kontrol edin.\n', 'Cannot reach the server. Check the URL.\n')));
159
161
  }
160
162
  process.exit(1);
161
163
  }