[core] ChatWoot - load languages WAHA_APPS_CHATWOOT_LANGUAGES_FOLDER
fix #1160
This commit is contained in:
1 parent
0c388ee3a7
commit
2319dba68d
2 files changed
+10
-1
No files matched your search
@@ -26,7 +26,7 @@ export class I18N {
|
||||
if (!this.locales[locale]) {
|
||||
this.locales[locale] = new Locale(strings);
|
||||
} else {
|
||||
this.locales[locale].override(strings);
|
||||
this.locales[locale] = this.locales[locale].override(strings);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,4 +7,13 @@ const localesDir = path.join(__dirname, 'locales');
|
||||
// Load both .yml and .yaml files from locales directory (non-recursive)
|
||||
i18n.load(new YamlLocaleLoader(localesDir, 'yml').load());
|
||||
i18n.load(new YamlLocaleLoader(localesDir, 'yaml').load());
|
||||
|
||||
// Resolve env var (supports '.' and '~'); fallback to default
|
||||
const additional = process.env.WAHA_APPS_CHATWOOT_LANGUAGES_FOLDER?.trim();
|
||||
if (additional) {
|
||||
const resolved = path.resolve(additional);
|
||||
i18n.load(new YamlLocaleLoader(resolved, 'yml').load());
|
||||
i18n.load(new YamlLocaleLoader(resolved, 'yaml').load());
|
||||
}
|
||||
|
||||
export { i18n };
|
||||
Reference in new issue
Block a user