mirror of
https://github.com/hexastack/hexabot
synced 2025-01-23 02:47:56 +00:00
fix: i18n dir scan
This commit is contained in:
parent
92bb4978c3
commit
a65e937003
@ -6,7 +6,7 @@
|
||||
* 2. All derivative works must include clear attribution to the original creator and software, Hexastack and Hexabot, in a prominent location (e.g., in the software's "About" section, documentation, and README file).
|
||||
*/
|
||||
|
||||
import { promises as fs } from 'fs';
|
||||
import { existsSync, promises as fs } from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
import { Injectable, OnModuleInit } from '@nestjs/common';
|
||||
@ -86,11 +86,16 @@ export class I18nService<K = Record<string, unknown>>
|
||||
|
||||
async loadExtensionI18nTranslations() {
|
||||
const baseDir = path.join(__dirname, '..', '..', 'extensions');
|
||||
const extensionTypes = ['channels', 'plugins'];
|
||||
const extensionTypes = ['channels', 'helpers', 'plugins'];
|
||||
|
||||
try {
|
||||
for (const type of extensionTypes) {
|
||||
const extensionsDir = path.join(baseDir, type);
|
||||
|
||||
if (!existsSync(extensionsDir)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const extensionFolders = await fs.readdir(extensionsDir, {
|
||||
withFileTypes: true,
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user