mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-21 11:49:14 +00:00

* check in full site application * rm unused assets components * change base css * i18n * new doc workflow * fix crosslink to doc in github * nav, console link, assets, console brand * edit configjs server * rm go struct references * cleanup input output bindings * working dir * export path * always trigger * rel paths * cname * rev workdir * fix fallbacklanguage, home on large screens * remove mit from site
22 lines
687 B
JavaScript
22 lines
687 B
JavaScript
import fs from 'fs';
|
|
import path from 'path';
|
|
|
|
export default function extract_languages(dirpath, dir) {
|
|
|
|
const detectedLocales = fs.readdirSync(`${dirpath}${dir}`)
|
|
.filter(file => path.extname(file) == '.md')
|
|
.map((file) => {
|
|
file = file.replace(path.extname(file), '');
|
|
const arr = file.split('.');
|
|
const locale = arr.length ? arr[arr.length - 1] : null;
|
|
if (locale) {
|
|
return locale;
|
|
}
|
|
}).filter(locale => locale !== null);
|
|
|
|
const redDetectedLocales = [...new Set(detectedLocales)];
|
|
|
|
console.log('detected locales: ' + redDetectedLocales);
|
|
return redDetectedLocales;
|
|
}
|