@powernukkitx/cli 0.0.1

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.
Files changed (41) hide show
  1. package/dist/bundle.js +18871 -0
  2. package/dist/commands/backup.d.ts +1 -0
  3. package/dist/commands/backup.js +74 -0
  4. package/dist/commands/config.d.ts +1 -0
  5. package/dist/commands/config.js +114 -0
  6. package/dist/commands/doctor.d.ts +1 -0
  7. package/dist/commands/doctor.js +119 -0
  8. package/dist/commands/info.d.ts +1 -0
  9. package/dist/commands/info.js +36 -0
  10. package/dist/commands/init.d.ts +4 -0
  11. package/dist/commands/init.js +73 -0
  12. package/dist/commands/plugin.d.ts +12 -0
  13. package/dist/commands/plugin.js +385 -0
  14. package/dist/commands/start.d.ts +7 -0
  15. package/dist/commands/start.js +108 -0
  16. package/dist/commands/update.d.ts +5 -0
  17. package/dist/commands/update.js +55 -0
  18. package/dist/index.d.ts +2 -0
  19. package/dist/index.js +260 -0
  20. package/dist/lang/en.json +178 -0
  21. package/dist/lang/fr.json +178 -0
  22. package/dist/lang/index.d.ts +7 -0
  23. package/dist/lang/index.js +83 -0
  24. package/dist/plugins.json +66 -0
  25. package/dist/types.d.ts +61 -0
  26. package/dist/types.js +1 -0
  27. package/dist/utils/api.d.ts +18 -0
  28. package/dist/utils/api.js +74 -0
  29. package/dist/utils/github.d.ts +27 -0
  30. package/dist/utils/github.js +187 -0
  31. package/dist/utils/logger.d.ts +15 -0
  32. package/dist/utils/logger.js +72 -0
  33. package/dist/utils/pause.d.ts +1 -0
  34. package/dist/utils/pause.js +6 -0
  35. package/dist/utils/plugins.d.ts +4 -0
  36. package/dist/utils/plugins.js +34 -0
  37. package/dist/utils/server.d.ts +3 -0
  38. package/dist/utils/server.js +39 -0
  39. package/dist/utils/updater.d.ts +1 -0
  40. package/dist/utils/updater.js +86 -0
  41. package/package.json +63 -0
package/dist/index.js ADDED
@@ -0,0 +1,260 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from 'commander';
3
+ import { select } from '@inquirer/prompts';
4
+ import chalk from 'chalk';
5
+ import { logo, highlight, dim, success } from './utils/logger.js';
6
+ import { t, initLanguage, setLanguage, saveLanguage } from './lang/index.js';
7
+ import { initCmd } from './commands/init.js';
8
+ import { startCmd } from './commands/start.js';
9
+ import { pluginInstallCmd, pluginListCmd, pluginInstalledCmd, pluginRemoveCmd, pluginSearchCmd, pluginInfoCmd, pluginUpdateCmd } from './commands/plugin.js';
10
+ import { updateCmd } from './commands/update.js';
11
+ import { infoCmd } from './commands/info.js';
12
+ import { doctorCmd } from './commands/doctor.js';
13
+ import { backupCmd } from './commands/backup.js';
14
+ import { configCmd } from './commands/config.js';
15
+ import { detectServer } from './utils/server.js';
16
+ import { checkForUpdates } from './utils/updater.js';
17
+ const program = new Command();
18
+ // -- detect --lang from argv before Commander parses
19
+ const langIdx = process.argv.indexOf('--lang');
20
+ const cliLang = langIdx >= 0 && process.argv.length > langIdx + 1
21
+ ? process.argv[langIdx + 1]
22
+ : undefined;
23
+ initLanguage(cliLang);
24
+ program
25
+ .name('pnx')
26
+ .description(highlight('PowerNukkitX CLI — Manage your Minecraft Bedrock servers'))
27
+ .version('0.2.0')
28
+ .option('--lang <code>', 'Set language (en, fr)')
29
+ .addHelpText('before', logo)
30
+ .addHelpText('after', `\n ${dim('📖')} ${highlight('Documentation')}: https://docs.powernukkitx.org\n`);
31
+ program
32
+ .command('init')
33
+ .description('Create a new PowerNukkitX server')
34
+ .option('-d, --dir <path>', 'Target directory')
35
+ .option('--dev', 'Install development version')
36
+ .action(async (opts) => { await initCmd(opts); });
37
+ program
38
+ .command('start')
39
+ .description('Start the PowerNukkitX server')
40
+ .option('-g, --generate-only', 'Generate the start command without running')
41
+ .option('-r, --restart', 'Auto-restart on crash')
42
+ .option('-m, --memory <size>', 'Memory allocation (e.g. 2G, 4G)', '2G')
43
+ .option('-i, --interactive', 'Interactive mode with prompts')
44
+ .action(async (opts) => {
45
+ await checkForUpdates();
46
+ await startCmd(opts);
47
+ });
48
+ const pluginCmd = program
49
+ .command('plugin')
50
+ .description('Plugin management')
51
+ .alias('plugins');
52
+ pluginCmd
53
+ .command('install [names...]')
54
+ .description('Install plugins (slug from marketplace or direct .jar URL)')
55
+ .action(async (names) => { await pluginInstallCmd(names); });
56
+ pluginCmd
57
+ .command('list')
58
+ .description('List available plugins from the marketplace')
59
+ .option('-s, --sort <type>', 'Sort by: newest, updated, stars')
60
+ .option('-l, --limit <n>', 'Results per page (max 100)')
61
+ .option('-p, --page <n>', 'Page number')
62
+ .option('-q, --query <term>', 'Search query')
63
+ .action(async (opts) => {
64
+ await pluginListCmd(opts);
65
+ });
66
+ pluginCmd
67
+ .command('search [term]')
68
+ .description('Search plugins by name, description, or author')
69
+ .action(async (term) => { await pluginSearchCmd(term); });
70
+ pluginCmd
71
+ .command('info [slug]')
72
+ .description('Show detailed plugin information')
73
+ .action(async (slug) => { await pluginInfoCmd(slug); });
74
+ pluginCmd
75
+ .command('installed')
76
+ .description('List locally installed plugins')
77
+ .action(async () => { await pluginInstalledCmd(); });
78
+ pluginCmd
79
+ .command('update [names...]')
80
+ .description('Update installed plugins to latest version')
81
+ .action(async (names) => { await pluginUpdateCmd(names); });
82
+ pluginCmd
83
+ .command('remove [names...]')
84
+ .description('Remove installed plugins')
85
+ .alias('rm')
86
+ .action(async (names) => { await pluginRemoveCmd(names); });
87
+ program
88
+ .command('update')
89
+ .description('Update powernukkitx.jar to the latest version')
90
+ .option('--dev', 'Install development version')
91
+ .option('-f, --force', 'Force update even if versions match')
92
+ .action(async (opts) => { await updateCmd(opts); });
93
+ program
94
+ .command('doctor')
95
+ .description('Diagnose server health')
96
+ .action(async () => { await doctorCmd(); });
97
+ program
98
+ .command('backup')
99
+ .description('Create a server backup')
100
+ .action(async () => { await backupCmd(); });
101
+ program
102
+ .command('config')
103
+ .description('View server configuration (pnx.yml or server.properties)')
104
+ .action(async () => { await configCmd(); });
105
+ program
106
+ .command('info')
107
+ .description('Show server information')
108
+ .alias('status')
109
+ .action(async () => { await infoCmd(); });
110
+ program
111
+ .command('lang')
112
+ .description('Change language / Changer la langue')
113
+ .option('-s, --set <code>', 'Set language (en, fr)')
114
+ .action(async (opts) => {
115
+ if (opts.set) {
116
+ setLanguage(opts.set);
117
+ saveLanguage(opts.set);
118
+ success(t('lang.detected', opts.set));
119
+ return;
120
+ }
121
+ const lang = await select({
122
+ message: t('lang.prompt'),
123
+ choices: [
124
+ { name: 'English', value: 'en' },
125
+ { name: 'Français', value: 'fr' },
126
+ ],
127
+ });
128
+ setLanguage(lang);
129
+ saveLanguage(lang);
130
+ success(t('lang.detected', lang));
131
+ });
132
+ // ─── interactive menu ────────────────────────────────────────
133
+ async function pickLanguage() {
134
+ const lang = await select({
135
+ message: '🌐 Select your language / Choisissez votre langue',
136
+ default: 'en',
137
+ choices: [
138
+ { name: '🇬🇧 English', value: 'en' },
139
+ { name: '🇫🇷 Français', value: 'fr' },
140
+ ],
141
+ });
142
+ setLanguage(lang);
143
+ saveLanguage(lang);
144
+ }
145
+ async function showMainMenu() {
146
+ await pickLanguage();
147
+ while (true) {
148
+ const serverPath = detectServer();
149
+ const hasServer = serverPath !== null;
150
+ const statusTag = hasServer
151
+ ? chalk.green(`● ${t('info.installed')}`)
152
+ : chalk.red(`○ ${t('info.notInstalled')}`);
153
+ const choice = await select({
154
+ message: `${highlight.bold(t('lang.menu'))} ${dim('·')} ${statusTag}`,
155
+ pageSize: 10,
156
+ choices: [
157
+ { name: `🚀 ${t('init.title')}`, value: 'init' },
158
+ { name: `▶️ ${t('start.title')}`, value: 'start' },
159
+ { name: `📦 ${t('plugin.titleList')}`, value: 'plugin' },
160
+ { name: `🔄 ${t('update.title')}`, value: 'update' },
161
+ { name: `🩺 ${t('doctor.title')}`, value: 'doctor' },
162
+ { name: `💾 ${t('backup.title')}`, value: 'backup' },
163
+ { name: `⚙️ ${t('config.title')}`, value: 'config' },
164
+ { name: `📊 ${t('info.title')}`, value: 'info' },
165
+ { name: `🌐 ${t('lang.prompt')}`, value: 'lang' },
166
+ { name: `❌ ${t('lang.exit')}`, value: 'exit' },
167
+ ],
168
+ });
169
+ console.log();
170
+ switch (choice) {
171
+ case 'init':
172
+ await initCmd({});
173
+ break;
174
+ case 'start':
175
+ await checkForUpdates();
176
+ await startCmd({});
177
+ break;
178
+ case 'plugin':
179
+ await pluginListCmd({});
180
+ await showPluginSubmenu();
181
+ break;
182
+ case 'update':
183
+ await updateCmd({});
184
+ break;
185
+ case 'doctor':
186
+ await doctorCmd();
187
+ break;
188
+ case 'backup':
189
+ await backupCmd();
190
+ break;
191
+ case 'config':
192
+ await configCmd();
193
+ break;
194
+ case 'info':
195
+ await infoCmd();
196
+ break;
197
+ case 'lang':
198
+ await pickLanguage();
199
+ break;
200
+ case 'exit':
201
+ process.exit(0);
202
+ }
203
+ }
204
+ }
205
+ async function showPluginSubmenu() {
206
+ while (true) {
207
+ const action = await select({
208
+ message: highlight.bold(t('lang.pluginMenu')),
209
+ pageSize: 6,
210
+ choices: [
211
+ { name: `📥 ${t('plugin.titleInstall')}`, value: 'install' },
212
+ { name: `📋 ${t('plugin.titleList')}`, value: 'list' },
213
+ { name: `📖 ${t('plugin.titleInfo')}`, value: 'info' },
214
+ { name: `🔄 ${t('plugin.titleUpdate')}`, value: 'update' },
215
+ { name: `🗑️ ${t('plugin.titleRemove')}`, value: 'remove' },
216
+ { name: `🔙 ${t('lang.back')}`, value: 'back' },
217
+ ],
218
+ });
219
+ if (action === 'back')
220
+ return;
221
+ console.log();
222
+ switch (action) {
223
+ case 'install':
224
+ await pluginInstallCmd([]);
225
+ break;
226
+ case 'list':
227
+ await pluginListCmd({});
228
+ break;
229
+ case 'info':
230
+ await pluginInfoCmd();
231
+ break;
232
+ case 'update':
233
+ await pluginUpdateCmd([]);
234
+ break;
235
+ case 'remove':
236
+ await pluginRemoveCmd([]);
237
+ break;
238
+ }
239
+ }
240
+ }
241
+ // ─── decide: menu or direct command ───────────────────────────
242
+ async function main() {
243
+ const rawArgs = process.argv.slice(2);
244
+ const helpFlags = ['--help', '-h', '--version', '-V'];
245
+ const hasSubcommand = rawArgs.length > 0 && !rawArgs.every(a => a.startsWith('-'));
246
+ if (rawArgs.some(a => helpFlags.includes(a))) {
247
+ await program.parseAsync(process.argv);
248
+ }
249
+ else if (!hasSubcommand) {
250
+ console.log(logo);
251
+ await showMainMenu();
252
+ }
253
+ else {
254
+ await program.parseAsync(process.argv).catch((err) => {
255
+ console.error(err);
256
+ process.exit(1);
257
+ });
258
+ }
259
+ }
260
+ main();
@@ -0,0 +1,178 @@
1
+ {
2
+ "cli": {
3
+ "description": "PowerNukkitX CLI — Manage your Minecraft Bedrock servers with style",
4
+ "version": "0.2.0",
5
+ "docLink": "Documentation"
6
+ },
7
+ "init": {
8
+ "title": "Create a new PowerNukkitX server",
9
+ "alreadyExists": "A PNX server already exists in this directory.",
10
+ "fetchingInfo": "Fetching latest release information...",
11
+ "latestVersion": "Latest version",
12
+ "downloading": "Downloading powernukkitx.jar",
13
+ "downloaded": "powernukkitx.jar downloaded ({0} MB)",
14
+ "creatingConfig": "Creating server configuration...",
15
+ "configCreated": "Configuration created successfully",
16
+ "success": "PNX Server is ready!",
17
+ "nextSteps": "Next steps",
18
+ "serverDir": "Directory",
19
+ "serverId": "Server ID",
20
+ "nextStepCd": "Navigate to the server directory",
21
+ "nextStepStart": "Start the server",
22
+ "nextStepPlugins": "Browse available plugins",
23
+ "nextStepInstall": "Install a plugin",
24
+ "promptDir": "Where should the server be created?",
25
+ "downloadingScripts": "Downloading start scripts...",
26
+ "scriptsDownloaded": "Start scripts downloaded",
27
+ "launchPrompt": "Start the server now?",
28
+ "creating": "Creating server...",
29
+ "done": "Server created successfully"
30
+ },
31
+ "start": {
32
+ "title": "Starting PowerNukkitX server",
33
+ "jarNotFound": "No PowerNukkitX server found here.",
34
+ "createPrompt": "Create a new server now?",
35
+ "checkingJava": "Checking Java installation...",
36
+ "javaNotFound": "Java 21 or higher is required. Download from https://adoptium.net/",
37
+ "javaVersion": "Java {0} detected",
38
+ "generatedCommand": "Generated start command:",
39
+ "starting": "Starting server...",
40
+ "stopped": "Server stopped with code {0}",
41
+ "restarting": "Restarting server..."
42
+ },
43
+ "plugin": {
44
+ "titleList": "Available plugin catalog",
45
+ "titleInstall": "Installing plugins",
46
+ "titleInstalled": "Installed plugins",
47
+ "titleRemove": "Removing plugins",
48
+ "titleInfo": "Plugin information",
49
+ "titleSearch": "Search plugins",
50
+ "titleUpdate": "Update plugins",
51
+ "selectPrompt": "Select plugins to install:",
52
+ "removePrompt": "Select plugins to remove:",
53
+ "installSuccess": "{0} installed successfully",
54
+ "notFound": "Plugin \"{0}\" not found",
55
+ "installedCount": "{0} plugin(s) installed",
56
+ "restartHint": "Restart the server to load the plugins",
57
+ "noPlugins": "No plugins installed",
58
+ "noPluginsDir": "No plugins/ directory found",
59
+ "removeConfirm": "Remove {0}?",
60
+ "removeCancelled": "Removal cancelled for {0}",
61
+ "removed": "{0} removed",
62
+ "installing": "Searching for {0} by {1}...",
63
+ "urlInstall": "Installing from URL: {0}",
64
+ "urlInvalid": "URL must point to a .jar file",
65
+ "catalogEmpty": "No plugins in catalog",
66
+ "catalogHint": "Use 'pnx plugin list' to browse the catalog",
67
+ "searching": "Searching for releases...",
68
+ "searchPrompt": "Search plugins:",
69
+ "searchCancelled": "Search cancelled.",
70
+ "searchEmpty": "No plugins matching \"{0}\"",
71
+ "searchResults": "{0} plugin(s) matching \"{1}\"",
72
+ "fetching": "Fetching plugins from marketplace...",
73
+ "fetchingInfo": "Getting info for {0}...",
74
+ "fetchError": "Failed to fetch plugins: {0}",
75
+ "showingCount": "Showing {0} of {1} plugins",
76
+ "infoPrompt": "Enter plugin slug:",
77
+ "infoCancelled": "Info cancelled.",
78
+ "selectVersion": "Select a version:",
79
+ "releases": "Releases",
80
+ "moreReleases": "... and {0} more releases",
81
+ "noRelease": "No release found for {0}",
82
+ "noFile": "No file found for {0} v{1}",
83
+ "installError": "Failed to install {0}",
84
+ "noSelection": "No plugins selected.",
85
+ "updateSelect": "Select plugins to update:",
86
+ "checkingUpdates": "Checking updates for",
87
+ "alreadyLatest": "{0} is already up-to-date (v{1})",
88
+ "updateDone": "{0} updated to v{1}",
89
+ "updateError": "Failed to update {0}"
90
+ },
91
+ "update": {
92
+ "title": "Updating PowerNukkitX server",
93
+ "checking": "Checking for updates...",
94
+ "notFound": "No PowerNukkitX server found here.",
95
+ "available": "New version available: {0}",
96
+ "currentLatest": "You already have the latest version ({0})",
97
+ "saving": "Backing up old version...",
98
+ "saved": "Old version backed up as powernukkitx.jar.old",
99
+ "downloading": "Downloading new version...",
100
+ "done": "Update completed!",
101
+ "restartHint": "Restart your server to apply changes",
102
+ "deleteOldHint": "You can delete powernukkitx.jar.old once everything works"
103
+ },
104
+ "info": {
105
+ "title": "Server information",
106
+ "installed": "Installed",
107
+ "notInstalled": "Not installed",
108
+ "plugins": "plugin(s) installed",
109
+ "worlds": "world(s) found",
110
+ "ready": "Server ready to start with 'pnx start'",
111
+ "notInitialized": "Server not initialized. Run 'pnx init'",
112
+ "status": "Server PNX",
113
+ "serverDir": "Server path",
114
+ "javaVersion": "Java version"
115
+ },
116
+ "doctor": {
117
+ "title": "Server diagnostic",
118
+ "checkingJava": "Checking Java...",
119
+ "javaOk": "Java {0}",
120
+ "checkingServer": "Detecting server...",
121
+ "serverFound": "Server found",
122
+ "serverNotFound": "No server detected. Run 'pnx init' first.",
123
+ "checkingJar": "Checking JAR file...",
124
+ "jarOk": "powernukkitx.jar ({0} MB)",
125
+ "jarMissing": "powernukkitx.jar is missing",
126
+ "checkingConfig": "Checking config file...",
127
+ "configFound": "pnx.yml found",
128
+ "configLegacy": "Using server.properties (consider migrating to pnx.yml)",
129
+ "configMissing": "No config file found — run the server once to generate it",
130
+ "checkingPlugins": "Checking plugins...",
131
+ "pluginsOk": "{0} plugin(s) found",
132
+ "pluginsMissing": "No plugins/ directory",
133
+ "pluginCheckHint": "Use '{0}' to check for updates",
134
+ "checkingWorlds": "Checking worlds...",
135
+ "worldsFound": "{0} world(s) found",
136
+ "worldsMissing": "No worlds/ directory",
137
+ "checkingPort": "Checking port 19132...",
138
+ "portFree": "Port 19132 is available",
139
+ "portInUse": "Port {0} is already in use",
140
+ "done": "Diagnostic complete"
141
+ },
142
+ "backup": {
143
+ "title": "Create backup",
144
+ "selectServer": "Which server to backup?",
145
+ "noServer": "No server detected. Run 'pnx init' first.",
146
+ "backupCurrent": "Backup current directory? {0}",
147
+ "cancelled": "Backup cancelled.",
148
+ "collecting": "Collecting files...",
149
+ "estimatedSize": "Estimated size: {0}",
150
+ "copying": "Copying files...",
151
+ "done": "Backup created: {0} ({1})"
152
+ },
153
+ "config": {
154
+ "title": "Server configuration",
155
+ "noServer": "No server detected.",
156
+ "hintInit": "Run 'pnx init' first to create a server.",
157
+ "notFound": "No config file found (pnx.yml or server.properties).",
158
+ "hintGenerate": "Run the server once to generate the config file.",
159
+ "editHint": "Edit {0} to change these values."
160
+ },
161
+ "updater": {
162
+ "coreUpdate": "A new PowerNukkitX version is available:",
163
+ "pluginUpdate": "Update available for {0}: {1} {2}"
164
+ },
165
+ "errors": {
166
+ "timeout": "Request timed out",
167
+ "network": "Network error: {0}",
168
+ "unknown": "An unknown error occurred"
169
+ },
170
+ "lang": {
171
+ "prompt": "Select your language / Choisissez votre langue",
172
+ "detected": "Language set to {0}",
173
+ "menu": "What would you like to do?",
174
+ "pluginMenu": "Plugin management",
175
+ "exit": "Exit",
176
+ "back": "Back to main menu"
177
+ }
178
+ }
@@ -0,0 +1,178 @@
1
+ {
2
+ "cli": {
3
+ "description": "PowerNukkitX CLI — Gérez vos serveurs Minecraft Bedrock avec style",
4
+ "version": "0.2.0",
5
+ "docLink": "Documentation"
6
+ },
7
+ "init": {
8
+ "title": "Création d'un nouveau serveur PowerNukkitX",
9
+ "alreadyExists": "Un serveur PNX existe déjà dans ce répertoire.",
10
+ "fetchingInfo": "Récupération des informations de la dernière version...",
11
+ "latestVersion": "Dernière version",
12
+ "downloading": "Téléchargement de powernukkitx.jar",
13
+ "downloaded": "powernukkitx.jar téléchargé ({0} Mo)",
14
+ "creatingConfig": "Création de la configuration du serveur...",
15
+ "configCreated": "Configuration créée avec succès",
16
+ "success": "Serveur PNX prêt !",
17
+ "nextSteps": "Prochaines étapes",
18
+ "serverDir": "Répertoire",
19
+ "serverId": "ID du serveur",
20
+ "nextStepCd": "Aller dans le répertoire du serveur",
21
+ "nextStepStart": "Démarrer le serveur",
22
+ "nextStepPlugins": "Voir les plugins disponibles",
23
+ "nextStepInstall": "Installer un plugin",
24
+ "promptDir": "Où créer le serveur ?",
25
+ "downloadingScripts": "Téléchargement des scripts de démarrage...",
26
+ "scriptsDownloaded": "Scripts de démarrage téléchargés",
27
+ "launchPrompt": "Lancer le serveur maintenant ?",
28
+ "creating": "Création du serveur...",
29
+ "done": "Serveur créé avec succès"
30
+ },
31
+ "start": {
32
+ "title": "Démarrage du serveur PowerNukkitX",
33
+ "jarNotFound": "Aucun serveur PowerNukkitX trouvé ici.",
34
+ "createPrompt": "Créer un nouveau serveur maintenant ?",
35
+ "checkingJava": "Vérification de Java...",
36
+ "javaNotFound": "Java 21 ou supérieur est requis. Téléchargez depuis https://adoptium.net/",
37
+ "javaVersion": "Java {0} détecté",
38
+ "generatedCommand": "Commande de démarrage générée :",
39
+ "starting": "Démarrage du serveur...",
40
+ "stopped": "Serveur arrêté avec le code {0}",
41
+ "restarting": "Redémarrage du serveur..."
42
+ },
43
+ "plugin": {
44
+ "titleList": "Catalogue de plugins disponibles",
45
+ "titleInstall": "Installation de plugins",
46
+ "titleInstalled": "Plugins installés",
47
+ "titleRemove": "Suppression de plugins",
48
+ "titleInfo": "Informations du plugin",
49
+ "titleSearch": "Rechercher des plugins",
50
+ "titleUpdate": "Mettre à jour les plugins",
51
+ "selectPrompt": "Sélectionnez les plugins à installer :",
52
+ "removePrompt": "Sélectionnez les plugins à supprimer :",
53
+ "installSuccess": "{0} installé avec succès",
54
+ "notFound": "Plugin \"{0}\" introuvable",
55
+ "installedCount": "{0} plugin(s) installé(s)",
56
+ "restartHint": "Redémarrez le serveur pour charger les plugins",
57
+ "noPlugins": "Aucun plugin installé",
58
+ "noPluginsDir": "Aucun répertoire plugins/ trouvé",
59
+ "removeConfirm": "Supprimer {0} ?",
60
+ "removeCancelled": "Suppression annulée pour {0}",
61
+ "removed": "{0} supprimé",
62
+ "installing": "Recherche de {0} par {1}...",
63
+ "urlInstall": "Installation depuis l'URL : {0}",
64
+ "urlInvalid": "L'URL doit pointer vers un fichier .jar",
65
+ "catalogEmpty": "Aucun plugin dans le catalogue",
66
+ "catalogHint": "Utilisez 'pnx plugin list' pour voir le catalogue",
67
+ "searching": "Recherche des releases...",
68
+ "searchPrompt": "Rechercher des plugins :",
69
+ "searchCancelled": "Recherche annulée.",
70
+ "searchEmpty": "Aucun plugin correspondant à \"{0}\"",
71
+ "searchResults": "{0} plugin(s) correspondant à \"{1}\"",
72
+ "fetching": "Récupération des plugins depuis la marketplace...",
73
+ "fetchingInfo": "Récupération des infos pour {0}...",
74
+ "fetchError": "Échec de récupération des plugins : {0}",
75
+ "showingCount": "Affichage de {0} sur {1} plugins",
76
+ "infoPrompt": "Entrez le slug du plugin :",
77
+ "infoCancelled": "Infos annulées.",
78
+ "selectVersion": "Sélectionnez une version :",
79
+ "releases": "Versions",
80
+ "moreReleases": "... et {0} versions supplémentaires",
81
+ "noRelease": "Aucune version trouvée pour {0}",
82
+ "noFile": "Aucun fichier trouvé pour {0} v{1}",
83
+ "installError": "Échec de l'installation de {0}",
84
+ "noSelection": "Aucun plugin sélectionné.",
85
+ "updateSelect": "Sélectionnez les plugins à mettre à jour :",
86
+ "checkingUpdates": "Vérification des mises à jour pour",
87
+ "alreadyLatest": "{0} est déjà à jour (v{1})",
88
+ "updateDone": "{0} mis à jour vers v{1}",
89
+ "updateError": "Échec de la mise à jour de {0}"
90
+ },
91
+ "update": {
92
+ "title": "Mise à jour du serveur PowerNukkitX",
93
+ "checking": "Vérification des mises à jour...",
94
+ "notFound": "Aucun serveur PowerNukkitX trouvé ici.",
95
+ "available": "Nouvelle version disponible : {0}",
96
+ "currentLatest": "Vous avez déjà la dernière version ({0})",
97
+ "saving": "Sauvegarde de l'ancienne version...",
98
+ "saved": "Ancienne version sauvegardée (powernukkitx.jar.old)",
99
+ "downloading": "Téléchargement de la nouvelle version...",
100
+ "done": "Mise à jour terminée !",
101
+ "restartHint": "Redémarrez votre serveur pour appliquer les changements",
102
+ "deleteOldHint": "Vous pouvez supprimer powernukkitx.jar.old une fois que tout fonctionne"
103
+ },
104
+ "info": {
105
+ "title": "Informations du serveur",
106
+ "installed": "Installé",
107
+ "notInstalled": "Non installé",
108
+ "plugins": "plugin(s) installé(s)",
109
+ "worlds": "monde(s) trouvé(s)",
110
+ "ready": "Serveur prêt à démarrer avec 'pnx start'",
111
+ "notInitialized": "Serveur non initialisé. Exécutez 'pnx init'",
112
+ "status": "Serveur PNX",
113
+ "serverDir": "Chemin du serveur",
114
+ "javaVersion": "Version Java"
115
+ },
116
+ "doctor": {
117
+ "title": "Diagnostic du serveur",
118
+ "checkingJava": "Vérification de Java...",
119
+ "javaOk": "Java {0}",
120
+ "checkingServer": "Détection du serveur...",
121
+ "serverFound": "Serveur trouvé",
122
+ "serverNotFound": "Aucun serveur détecté. Exécutez 'pnx init' d'abord.",
123
+ "checkingJar": "Vérification du JAR...",
124
+ "jarOk": "powernukkitx.jar ({0} Mo)",
125
+ "jarMissing": "powernukkitx.jar est manquant",
126
+ "checkingConfig": "Vérification du fichier de config...",
127
+ "configFound": "pnx.yml trouvé",
128
+ "configLegacy": "Utilise server.properties (envisagez de migrer vers pnx.yml)",
129
+ "configMissing": "Aucun fichier de config trouvé — lancez le serveur pour le générer",
130
+ "checkingPlugins": "Vérification des plugins...",
131
+ "pluginsOk": "{0} plugin(s) trouvé(s)",
132
+ "pluginsMissing": "Aucun répertoire plugins/",
133
+ "pluginCheckHint": "Utilisez '{0}' pour vérifier les mises à jour",
134
+ "checkingWorlds": "Vérification des mondes...",
135
+ "worldsFound": "{0} monde(s) trouvé(s)",
136
+ "worldsMissing": "Aucun répertoire worlds/",
137
+ "checkingPort": "Vérification du port 19132...",
138
+ "portFree": "Le port 19132 est disponible",
139
+ "portInUse": "Le port {0} est déjà utilisé",
140
+ "done": "Diagnostic terminé"
141
+ },
142
+ "backup": {
143
+ "title": "Créer une sauvegarde",
144
+ "selectServer": "Quel serveur sauvegarder ?",
145
+ "noServer": "Aucun serveur détecté. Exécutez 'pnx init' d'abord.",
146
+ "backupCurrent": "Sauvegarder le répertoire actuel ? {0}",
147
+ "cancelled": "Sauvegarde annulée.",
148
+ "collecting": "Collecte des fichiers...",
149
+ "estimatedSize": "Taille estimée : {0}",
150
+ "copying": "Copie des fichiers...",
151
+ "done": "Sauvegarde créée : {0} ({1})"
152
+ },
153
+ "config": {
154
+ "title": "Configuration du serveur",
155
+ "noServer": "Aucun serveur détecté.",
156
+ "hintInit": "Exécutez 'pnx init' d'abord pour créer un serveur.",
157
+ "notFound": "Aucun fichier de config trouvé (pnx.yml ou server.properties).",
158
+ "hintGenerate": "Lancez le serveur une fois pour générer le fichier de config.",
159
+ "editHint": "Modifiez {0} pour changer ces valeurs."
160
+ },
161
+ "updater": {
162
+ "coreUpdate": "Une nouvelle version de PowerNukkitX est disponible :",
163
+ "pluginUpdate": "Mise à jour disponible pour {0} : {1} {2}"
164
+ },
165
+ "errors": {
166
+ "timeout": "La requête a expiré",
167
+ "network": "Erreur réseau : {0}",
168
+ "unknown": "Une erreur inconnue est survenue"
169
+ },
170
+ "lang": {
171
+ "prompt": "Select your language / Choisissez votre langue",
172
+ "detected": "Langue définie sur {0}",
173
+ "menu": "Que voulez-vous faire ?",
174
+ "pluginMenu": "Gestion des plugins",
175
+ "exit": "Quitter",
176
+ "back": "Retour au menu principal"
177
+ }
178
+ }
@@ -0,0 +1,7 @@
1
+ export type LanguageCode = 'en' | 'fr';
2
+ export declare function saveLanguage(code: LanguageCode): void;
3
+ export declare function hasSavedLanguage(): boolean;
4
+ export declare function setLanguage(code: LanguageCode): void;
5
+ export declare function initLanguage(cliLang?: string): LanguageCode;
6
+ export declare function getLanguage(): LanguageCode;
7
+ export declare function t(key: string, ...args: any[]): string;