mirror of
https://github.com/pezkuwichain/pezkuwi-sdk-ui.git
synced 2026-06-17 16:01:08 +00:00
Initial commit: Pezkuwi SDK UI
Comprehensive web interface for interacting with Pezkuwi blockchain. Features: - Blockchain explorer - Wallet management - Staking interface - Governance participation - Developer tools Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Executable
+102
@@ -0,0 +1,102 @@
|
||||
// Copyright 2017-2025 @pezkuwi/apps authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
/** @type {Record<string, string[]>} */
|
||||
const defaults = {};
|
||||
const i18nRoot = path.join(__dirname, '../packages/apps/public/locales');
|
||||
|
||||
/**
|
||||
* @param {string} langRoot
|
||||
* @returns {string[]}
|
||||
*/
|
||||
function getEntries (langRoot) {
|
||||
return fs
|
||||
.readdirSync(langRoot)
|
||||
.filter((entry) =>
|
||||
!['.', '..'].includes(entry) &&
|
||||
fs.lstatSync(path.join(langRoot, entry)).isFile() &&
|
||||
entry.endsWith('.json') &&
|
||||
!['index.json', 'translation.json'].includes(entry)
|
||||
)
|
||||
.sort();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} lang
|
||||
*/
|
||||
function checkLanguage (lang) {
|
||||
console.log(`*** Checking ${lang}`);
|
||||
|
||||
const langRoot = path.join(i18nRoot, lang);
|
||||
const entries = getEntries(langRoot);
|
||||
const roots = Object.keys(defaults);
|
||||
const missing = roots.filter((entry) => !entries.includes(entry));
|
||||
|
||||
if (missing.length) {
|
||||
console.log(`\ttop-level missing ${missing.length}: ${missing.join(', ')}`);
|
||||
}
|
||||
|
||||
entries.forEach((entry) => {
|
||||
const json = require(path.join(langRoot, entry));
|
||||
const keys = Object.keys(json);
|
||||
const root = defaults[entry];
|
||||
|
||||
if (!root) {
|
||||
console.log(`\t> ${entry} not found in default, not checking`);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const missing = root.filter((key) => !keys.includes(key));
|
||||
const extra = keys.filter((key) => !root.includes(key));
|
||||
|
||||
if (missing.length) {
|
||||
console.log(`\t> ${entry} ${missing.length} keys missing`);
|
||||
|
||||
missing.forEach((key) =>
|
||||
console.log(`\t\t${key}`)
|
||||
);
|
||||
}
|
||||
|
||||
if (extra.length) {
|
||||
console.log(`\t> ${entry} ${extra.length} keys extra`);
|
||||
|
||||
extra.forEach((key) =>
|
||||
console.log(`\t\t${key}`)
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function checkLanguages () {
|
||||
fs
|
||||
.readdirSync(i18nRoot)
|
||||
.filter((entry) =>
|
||||
!['.', '..'].includes(entry) &&
|
||||
fs.lstatSync(path.join(i18nRoot, entry)).isDirectory() &&
|
||||
entry !== 'en'
|
||||
)
|
||||
.sort()
|
||||
.forEach(checkLanguage);
|
||||
}
|
||||
|
||||
function initDefault () {
|
||||
const enRoot = path.join(i18nRoot, 'en');
|
||||
|
||||
getEntries(enRoot).forEach((entry) => {
|
||||
const json = require(path.join(enRoot, entry));
|
||||
const keys = Object.keys(json);
|
||||
|
||||
// if (keys.length > 0) {
|
||||
// console.log(`${entry} ${keys.length} keys`);
|
||||
// }
|
||||
|
||||
defaults[entry] = keys;
|
||||
});
|
||||
}
|
||||
|
||||
initDefault();
|
||||
checkLanguages();
|
||||
Reference in New Issue
Block a user