| 76 | } |
| 77 | |
| 78 | async getLangHelpersPaths(templatesPath) { |
| 79 | const files = await recursiveReadDir(templatesPath); |
| 80 | const paths = []; |
| 81 | for await (const file of files) { |
| 82 | const content = await fs.promises.readFile(file, { encoding: 'utf-8' }); |
| 83 | const result = content.matchAll(LANG_HELPER_REGEXP); |
| 84 | const arr = [...result]; |
| 85 | if (arr.length > 0) { |
| 86 | const langPath = arr[0][1]; |
| 87 | paths.push(langPath); |
| 88 | } |
| 89 | } |
| 90 | return paths; |
| 91 | } |
| 92 | |
| 93 | async getLangFilesContent(defaultLang = null) { |
| 94 | const filesContent = {}; |