generated from canisminor1990/canisminor-template
-
-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Labels
🌠 Feature RequestNew feature or request | 特性与建议New feature or request | 特性与建议
Description
🥰 需求描述 | Feature Description
Your project @lobehub/i18n-cli uses the eld fork @yutengjing/eld, which removed eld v1 top-level await and requires lazy initialization, this is what you do now:
import { eld } from '@yutengjing/eld';
...
if (!initPromise) {
initPromise = (async () => {
console.log('🔧 Initializing ELD language detector...');
await eld.init('L'); // 使用中等规模的数据集
console.log('✅ ELD language detector initialized');
})();
}I’ve published eld v2 on npm: https://www.npmjs.com/package/eld which introduces static builds, you can import a specific size directly (no init/load/await required):
import { eld } from 'eld/large'
// ready to use immediatelyIf needed there is still dynamic import option , if you prefer lazy loading (similar to the fork), you can still do:
(Note: the static import is preferred for simplicity and faster startup.)
import { eld } from 'eld'
await eld.load('large')Performance & accuracy :
ELD v2 includes a notable 1.5x execution-speed improvement and modest accuracy gains.
Also eld npm install size has decreased to 9MB (from 34MB @yutengjing/eld) by removing unnecessary files.
🧐 解决方案 | Proposed Solution
import { eld } from 'eld/large'📝 补充信息 | Additional Information
No response
Metadata
Metadata
Assignees
Labels
🌠 Feature RequestNew feature or request | 特性与建议New feature or request | 特性与建议