mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 05:39:20 +08:00
Ship folder-based workspaces and data migration, daily practice, redesigned provider and model settings, and streaming conversation improvements. Synchronize README translations and document the archive/permanent-delete upgrade behavior in assets/releases/ver1-6-9.md. Reduce initial JavaScript by deduplicating English resources and loading animation features after hydration. Keep the existing route size budgets. Update regression fixtures and browser audits for scoped URLs and the new settings and learning interfaces.
17 lines
667 B
JavaScript
17 lines
667 B
JavaScript
// English uses the displayed copy as most translation keys. Store those
|
|
// strings once in the bundle, while keeping the authored JSON and the runtime
|
|
// resource dictionary unchanged (including explicit translations).
|
|
module.exports = function compactLocaleLoader(source) {
|
|
this.cacheable?.();
|
|
const identities = [];
|
|
const translations = [];
|
|
for (const [key, value] of Object.entries(JSON.parse(source))) {
|
|
if (key === value) identities.push(key);
|
|
else translations.push([key, value]);
|
|
}
|
|
return `module.exports = Object.fromEntries([
|
|
...${JSON.stringify(identities)}.map(key => [key, key]),
|
|
...${JSON.stringify(translations)}
|
|
]);`;
|
|
};
|