diff --git a/tests/test-gain-controls.mjs b/tests/test-gain-controls.mjs index 444d28e..c1b6ed3 100644 --- a/tests/test-gain-controls.mjs +++ b/tests/test-gain-controls.mjs @@ -164,7 +164,7 @@ async function testGainControls() { muteButton.click(); // Check if button text changed and slider disabled - const isMuted = muteButton.textContent.toLowerCase().includes('muted'); + const isMuted = muteButton.textContent.includes('已静音'); const isDisabled = slider.disabled; console.log(`[Test] Mute button text: ${muteButton.textContent}`); @@ -211,12 +211,12 @@ async function testGainControls() { const muteButton = card.querySelector('.mute-button'); const slider = card.querySelector('.gain-slider'); - if (muteButton && slider && muteButton.textContent.toLowerCase().includes('muted') && !muteButton.textContent.toLowerCase().includes('unmuted')) { + if (muteButton && slider && muteButton.textContent.includes('已静音') && !muteButton.textContent.includes('未静音')) { // Click unmute muteButton.click(); // Check if button text changed and slider enabled - const isUnmuted = muteButton.textContent.toLowerCase().includes('unmuted'); + const isUnmuted = muteButton.textContent.includes('未静音'); const isEnabled = !slider.disabled; console.log(`[Test] Unmute button text: ${muteButton.textContent}`); diff --git a/tests/test-mix-minus.mjs b/tests/test-mix-minus.mjs index fff36e2..5b3ae20 100644 --- a/tests/test-mix-minus.mjs +++ b/tests/test-mix-minus.mjs @@ -116,7 +116,7 @@ async function runTest() { // Wait for connection to signaling server console.log('[A] Waiting for connection...'); - const aConnected = await waitForStatus(peerA.page, 'Connected'); + const aConnected = await waitForStatus(peerA.page, '已连接'); if (!aConnected) { throw new Error('A failed to connect to signaling server'); } @@ -174,7 +174,7 @@ async function runTest() { // Wait for connection console.log('[B] Waiting for connection...'); - const bConnected = await waitForStatus(peerB.page, 'Connected'); + const bConnected = await waitForStatus(peerB.page, '已连接'); if (!bConnected) { throw new Error('B failed to connect to signaling server'); } @@ -213,7 +213,7 @@ async function runTest() { // Wait for connection console.log('[C] Waiting for connection...'); - const cConnected = await waitForStatus(peerC.page, 'Connected'); + const cConnected = await waitForStatus(peerC.page, '已连接'); if (!cConnected) { throw new Error('C failed to connect to signaling server'); } diff --git a/tests/test-mute-controls.mjs b/tests/test-mute-controls.mjs index a1931aa..23fbdcb 100644 --- a/tests/test-mute-controls.mjs +++ b/tests/test-mute-controls.mjs @@ -117,7 +117,7 @@ async function testMuteControls() { console.log(` Host sees caller button: "${initialButtonText}" (class: ${initialButtonClass})`); - if (initialButtonText.toLowerCase().includes('unmuted') && !initialButtonClass.includes('self-muted') && !initialButtonClass.includes('producer-muted')) { + if (initialButtonText.includes('未静音') && !initialButtonClass.includes('self-muted') && !initialButtonClass.includes('producer-muted')) { console.log(' ✅ PASS: Caller initially unmuted (green state)'); } else { console.log(' ❌ FAIL: Expected unmuted state'); @@ -140,7 +140,7 @@ async function testMuteControls() { const selfButtonClass = await selfMuteButtonOnCaller.getAttribute('class'); console.log(` Caller sees own button: "${selfButtonText}" (class: ${selfButtonClass})`); - if (selfButtonText.toLowerCase().includes('muted') && selfButtonClass.includes('self-muted')) { + if (selfButtonText.includes('已静音') && selfButtonClass.includes('self-muted')) { console.log(' ✅ PASS: Caller shows self-muted state (yellow)'); } else { console.log(' ❌ FAIL: Expected self-muted state'); @@ -153,7 +153,7 @@ async function testMuteControls() { const hostSeesButtonClass = await muteButtonOnHost.getAttribute('class'); console.log(` Host sees caller button: "${hostSeesButtonText}" (class: ${hostSeesButtonClass})`); - if (hostSeesButtonText.toLowerCase().includes('muted')) { + if (hostSeesButtonText.includes('已静音')) { console.log(' ✅ PASS: Mute state propagated to host'); } else { console.log(' ❌ FAIL: Mute state did not propagate'); @@ -177,7 +177,7 @@ async function testMuteControls() { const callerSeesClass = await selfMuteButtonOnCaller.getAttribute('class'); console.log(` Caller sees: "${callerSeesUnmuted}" (class: ${callerSeesClass})`); - if (hostSeesUnmuted.toLowerCase().includes('unmuted') && callerSeesUnmuted.toLowerCase().includes('unmuted')) { + if (hostSeesUnmuted.includes('未静音') && callerSeesUnmuted.includes('未静音')) { console.log(' ✅ PASS: Producer authority overrode self-mute'); } else { console.log(' ❌ FAIL: Producer authority did not override self-mute'); @@ -202,7 +202,7 @@ async function testMuteControls() { const callerSeesProducerClass = await selfMuteButtonOnCaller.getAttribute('class'); console.log(` Caller sees: "${callerSeesProducerMuted}" (class: ${callerSeesProducerClass})`); - if (callerSeesProducerMuted.toLowerCase().includes('muted') && callerSeesProducerMuted.toLowerCase().includes('host') && callerSeesProducerClass.includes('producer-muted')) { + if (callerSeesProducerMuted.includes('已静音') && callerSeesProducerMuted.includes('主播') && callerSeesProducerClass.includes('producer-muted')) { console.log(' ✅ PASS: Caller shows producer-muted state (red, with "Host" label)'); } else { console.log(' ❌ FAIL: Expected producer-muted state with "Host" label'); @@ -223,7 +223,7 @@ async function testMuteControls() { // Note: Due to conflict resolution, the mute should remain with producer authority // The button click might show an alert, but state should not change - if (stillMutedText.toLowerCase().includes('muted')) { + if (stillMutedText.includes('已静音')) { console.log(' ✅ PASS: Caller remains muted (producer authority blocks self-unmute)'); } else { console.log(' ⚠️ WARNING: Caller appears unmuted (check conflict resolution logic)'); @@ -268,7 +268,7 @@ async function testMuteControls() { const callerFinalClass = await selfMuteButtonOnCaller.getAttribute('class'); console.log(` Caller sees: "${callerFinalText}" (class: ${callerFinalClass})`); - if (finalButtonText.toLowerCase().includes('unmuted') && callerFinalText.toLowerCase().includes('unmuted')) { + if (finalButtonText.includes('未静音') && callerFinalText.includes('未静音')) { console.log(' ✅ PASS: Full mute cycle completed successfully'); } else { console.log(' ❌ FAIL: Full mute cycle did not complete correctly'); diff --git a/tests/test-return-feed.mjs b/tests/test-return-feed.mjs index 45d9b60..3eb213d 100644 --- a/tests/test-return-feed.mjs +++ b/tests/test-return-feed.mjs @@ -176,7 +176,7 @@ async function runTest() { await peerA.page.goto(WEB_SERVER_URL); console.log('[A] Waiting for connection...'); - const aConnected = await waitForStatus(peerA.page, 'Connected'); + const aConnected = await waitForStatus(peerA.page, '已连接'); if (!aConnected) { throw new Error('A failed to connect to signaling server'); } @@ -204,7 +204,7 @@ async function runTest() { await peerB.page.goto(`${WEB_SERVER_URL}#${roomId}`); console.log('[B] Waiting for connection...'); - const bConnected = await waitForStatus(peerB.page, 'Connected'); + const bConnected = await waitForStatus(peerB.page, '已连接'); if (!bConnected) { throw new Error('B failed to connect to signaling server'); } diff --git a/tests/test-webrtc.mjs b/tests/test-webrtc.mjs index 37256d6..10442db 100644 --- a/tests/test-webrtc.mjs +++ b/tests/test-webrtc.mjs @@ -108,7 +108,7 @@ async function runTest() { // Wait for connection to signaling server console.log('[Host] Waiting for connection to signaling server...'); - const hostConnected = await waitForStatus(hostBrowser.page, 'Connected'); + const hostConnected = await waitForStatus(hostBrowser.page, '已连接'); if (!hostConnected) { throw new Error('Host failed to connect to signaling server'); } @@ -163,7 +163,7 @@ async function runTest() { // Wait for connection console.log('[Caller] Waiting for connection to signaling server...'); - const callerConnected = await waitForStatus(callerBrowser.page, 'Connected'); + const callerConnected = await waitForStatus(callerBrowser.page, '已连接'); if (!callerConnected) { throw new Error('Caller failed to connect to signaling server'); } @@ -222,8 +222,8 @@ async function runTest() { console.log(`[Caller] Participant statuses: ${JSON.stringify(callerParticipantStatus)}`); // Check if at least one connection shows "Connected" - const hasConnectedPeer = hostParticipantStatus.some(s => s.includes('Connected')) || - callerParticipantStatus.some(s => s.includes('Connected')); + const hasConnectedPeer = hostParticipantStatus.some(s => s.includes('已连接')) || + callerParticipantStatus.some(s => s.includes('已连接')); if (hasConnectedPeer) { console.log('✅ WebRTC peer connection established\n'); @@ -252,10 +252,10 @@ async function runTest() { '#toggle-mute', btn => btn.textContent ); - if (muteButtonText !== 'Unmute') { - throw new Error(`Expected "Unmute", got "${muteButtonText}"`); + if (muteButtonText !== '取消静音') { + throw new Error(`Expected "取消静音", got "${muteButtonText}"`); } - console.log('✅ Mute toggle working (text changed to "Unmute")'); + console.log('✅ Mute toggle working (text changed to "取消静音")'); // Click unmute await hostBrowser.page.click('#toggle-mute'); @@ -265,10 +265,10 @@ async function runTest() { '#toggle-mute', btn => btn.textContent ); - if (unmuteButtonText !== 'Mute') { - throw new Error(`Expected "Mute", got "${unmuteButtonText}"`); + if (unmuteButtonText !== '静音') { + throw new Error(`Expected "静音", got "${unmuteButtonText}"`); } - console.log('✅ Unmute toggle working (text changed to "Mute")\n'); + console.log('✅ Unmute toggle working (text changed to "静音")\n'); // ===== Test 5: End Session ===== console.log('--- Test 5: End Session ---'); diff --git a/web/css/studio.css b/web/css/studio.css index b0771d5..267c924 100644 --- a/web/css/studio.css +++ b/web/css/studio.css @@ -77,8 +77,8 @@ --meter-ghost: rgba(255,255,255,0.03); /* TYPOGRAPHY */ - --font-display: 'Space Grotesk', system-ui, sans-serif; - --font-body: 'Inter', system-ui, sans-serif; + --font-display: 'Space Grotesk', system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif; + --font-body: 'Inter', system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif; --font-mono: 'JetBrains Mono', monospace; --text-xs: 0.6875rem; @@ -319,7 +319,7 @@ main { /* Empty state */ #participants:empty::after { - content: 'The frequency is clear.'; + content: '频率清晰。'; grid-column: 1 / -1; text-align: center; font-family: var(--font-display); diff --git a/web/index.html b/web/index.html index e2a5c71..2fbc5a0 100644 --- a/web/index.html +++ b/web/index.html @@ -1,11 +1,11 @@ - + - + - OpenStudio - Web Studio + OpenStudio - 网页工作室 @@ -20,7 +20,7 @@

OPENSTUDIO

talk hard.
-
Disconnected
+
未连接
@@ -34,7 +34,7 @@

OPENSTUDIO

-
SIGNAL OUTPUT
+
信号输出
@@ -43,13 +43,13 @@

OPENSTUDIO

- - - - - - - + + + + + + +
@@ -57,14 +57,14 @@

OPENSTUDIO

- REC + 录音 00:00:00
- +
- +