smoonb 0.0.80 → 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 +1 -1
- package/src/interactive/envMapper.js +14 -4
package/package.json
CHANGED
|
@@ -84,7 +84,12 @@ async function mapEnvVariablesInteractively(env, expectedKeys) {
|
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
|
|
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,8 +244,8 @@ 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
|
-
//
|
|
243
|
-
|
|
247
|
+
// getT agora funciona dinamicamente, sempre acessando global.smoonbI18n?.t
|
|
248
|
+
// Então não precisamos atualizar nada, apenas usar getT normalmente
|
|
244
249
|
console.log(chalk.green(`✅ ${getT('env.language.saved', { lang: selectedLang })}`));
|
|
245
250
|
console.log(chalk.cyan(`🌐 ${getT('env.language.applied')}`));
|
|
246
251
|
}
|
|
@@ -249,7 +254,12 @@ async function mapEnvVariablesInteractively(env, expectedKeys) {
|
|
|
249
254
|
}
|
|
250
255
|
|
|
251
256
|
async function askComponentsFlags() {
|
|
252
|
-
|
|
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
|
+
};
|
|
253
263
|
|
|
254
264
|
// Explicação sobre Edge Functions
|
|
255
265
|
console.log(chalk.cyan(`\n⚡ ${getT('backup.components.edgeFunctions.title')}`));
|