smoonb 0.0.79 → 0.0.81
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
package/src/i18n/locales/en.json
CHANGED
|
@@ -266,6 +266,7 @@
|
|
|
266
266
|
"env.language.english": "English",
|
|
267
267
|
"env.language.portuguese": "Portuguese (pt-BR)",
|
|
268
268
|
"env.language.saved": "Default language saved: {lang}",
|
|
269
|
+
"env.language.applied": "Language applied! The next messages will be displayed in the selected language.",
|
|
269
270
|
|
|
270
271
|
"backup.components.edgeFunctions.title": "Edge Functions:",
|
|
271
272
|
"backup.components.edgeFunctions.description1": "We will delete existing functions in the supabase/functions folder, reset the link",
|
|
@@ -266,6 +266,7 @@
|
|
|
266
266
|
"env.language.english": "Inglês (English)",
|
|
267
267
|
"env.language.portuguese": "Português (pt-BR)",
|
|
268
268
|
"env.language.saved": "Idioma padrão salvo: {lang}",
|
|
269
|
+
"env.language.applied": "Idioma aplicado! As próximas mensagens serão exibidas no idioma selecionado.",
|
|
269
270
|
|
|
270
271
|
"backup.components.edgeFunctions.title": "Edge Functions:",
|
|
271
272
|
"backup.components.edgeFunctions.description1": "Vamos apagar as funções existentes na pasta supabase/functions, fazer um reset no link",
|
|
@@ -233,7 +233,18 @@ async function mapEnvVariablesInteractively(env, expectedKeys) {
|
|
|
233
233
|
}]);
|
|
234
234
|
|
|
235
235
|
finalEnv.SMOONB_LANG = selectedLang;
|
|
236
|
-
|
|
236
|
+
|
|
237
|
+
// Re-inicializar i18n com o novo idioma para aplicar mudança em tempo real
|
|
238
|
+
const { initI18n } = require('../i18n');
|
|
239
|
+
const newI18n = initI18n(process.argv, { ...process.env, SMOONB_LANG: selectedLang });
|
|
240
|
+
Object.assign(global.smoonbI18n, newI18n);
|
|
241
|
+
|
|
242
|
+
// Atualizar getT para usar o novo idioma (não redeclarar, apenas atualizar a referência)
|
|
243
|
+
// getT já 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')}`));
|
|
237
248
|
}
|
|
238
249
|
|
|
239
250
|
return { finalEnv, dePara };
|