fix: track Laya language batches and normalize labels (#22)

Report post-projection Laya language detection as a busy analysis phase and normalize Laya language labels before caching and display.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
blomios
2026-10-05 23:42:11 +02:00
parent 45b56d872f
commit a6759b116d
9 changed files with 282 additions and 21 deletions

View File

@ -2,6 +2,12 @@ const test = require('node:test');
const assert = require('node:assert/strict');
const fusion = require('../public/js/services/channelLanguageFusion.js');
test('normalizes common Laya language labels to supported codes', () => {
assert.equal(fusion.normalizeLanguageCode('French'), 'fr');
assert.equal(fusion.normalizeLanguageCode('English'), 'en');
assert.equal(fusion.normalizeLanguageCode('ESPAÑOL'), 'es');
});
const algo = {
language: { code: 'fr', label: 'French', confidence: 70, status: 'medium' },
languageScores: { fr: 70, en: 30 },