mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-08 07:11:03 -04:00
pref(i18n): improve glob pattern
This commit is contained in:
parent
e07e2ae5bc
commit
ea6ec1be4f
1 changed files with 1 additions and 1 deletions
|
@ -4,7 +4,7 @@ import baseMessages from '@intlify/unplugin-vue-i18n/messages';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { parse as parseYaml } from 'yaml';
|
import { parse as parseYaml } from 'yaml';
|
||||||
|
|
||||||
const i18nFiles = import.meta.glob('../tools/*/locales/**.yml', { as: 'raw' });
|
const i18nFiles = import.meta.glob('../tools/**/locales/*.yml', { as: 'raw' });
|
||||||
|
|
||||||
const messagesByTools = await Promise.all(_.map(i18nFiles, async (fileDescriptor, path) => {
|
const messagesByTools = await Promise.all(_.map(i18nFiles, async (fileDescriptor, path) => {
|
||||||
const [, locale] = path.match(/\.\/tools\/.*?\/locales\/(.*)\.ya?ml$/i) ?? [];
|
const [, locale] = path.match(/\.\/tools\/.*?\/locales\/(.*)\.ya?ml$/i) ?? [];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue