smoonb 0.0.81 → 0.0.82

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smoonb",
3
- "version": "0.0.81",
3
+ "version": "0.0.82",
4
4
  "description": "Complete Supabase backup and migration tool - EXPERIMENTAL VERSION - USE AT YOUR OWN RISK",
5
5
  "preferGlobal": false,
6
6
  "preventGlobalInstall": true,
@@ -84,7 +84,12 @@ async function mapEnvVariablesInteractively(env, expectedKeys) {
84
84
  };
85
85
  }
86
86
 
87
- const getT = global.smoonbI18n?.t || t;
87
+ // Função getT que sempre acessa global.smoonbI18n dinamicamente
88
+ // Isso permite que a mudança de idioma seja aplicada em tempo real
89
+ const getT = (id, vars) => {
90
+ const currentT = global.smoonbI18n?.t || t;
91
+ return currentT(id, vars);
92
+ };
88
93
 
89
94
  for (const expected of expectedKeys) {
90
95
  console.log(chalk.blue(`\n🔧 ${getT('env.mapping.title', { variable: expected })}`));
@@ -239,19 +244,22 @@ async function mapEnvVariablesInteractively(env, expectedKeys) {
239
244
  const newI18n = initI18n(process.argv, { ...process.env, SMOONB_LANG: selectedLang });
240
245
  Object.assign(global.smoonbI18n, newI18n);
241
246
 
242
- // Atualizar getT para usar o novo idioma (não redeclarar, apenas atualizar a referência)
243
- // getT foi declarado no escopo da função, então apenas atualizamos o global.smoonbI18n
244
- // e getT continuará funcionando através do global.smoonbI18n?.t
245
- const updatedGetT = global.smoonbI18n?.t || t;
246
- console.log(chalk.green(`✅ ${updatedGetT('env.language.saved', { lang: selectedLang })}`));
247
- console.log(chalk.cyan(`🌐 ${updatedGetT('env.language.applied')}`));
247
+ // getT agora funciona dinamicamente, sempre acessando global.smoonbI18n?.t
248
+ // Então não precisamos atualizar nada, apenas usar getT normalmente
249
+ console.log(chalk.green(`✅ ${getT('env.language.saved', { lang: selectedLang })}`));
250
+ console.log(chalk.cyan(`🌐 ${getT('env.language.applied')}`));
248
251
  }
249
252
 
250
253
  return { finalEnv, dePara };
251
254
  }
252
255
 
253
256
  async function askComponentsFlags() {
254
- const getT = global.smoonbI18n?.t || t;
257
+ // Função getT que sempre acessa global.smoonbI18n dinamicamente
258
+ // Isso permite que a mudança de idioma seja aplicada em tempo real
259
+ const getT = (id, vars) => {
260
+ const currentT = global.smoonbI18n?.t || t;
261
+ return currentT(id, vars);
262
+ };
255
263
 
256
264
  // Explicação sobre Edge Functions
257
265
  console.log(chalk.cyan(`\n⚡ ${getT('backup.components.edgeFunctions.title')}`));