i18n: replace hardcoded strings in AudioOutputBadges tooltip
Moved all hardcoded English/Spanish tooltip text to i18n keys under audioBadges section in all 4 locale files. Removed dead dacTooltip derived property (unused in template).
This commit is contained in:
1 parent
af624d4642
commit
be56ecff90
5 files changed
+70
-32
No files matched your search
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { invoke } from '@tauri-apps/api/core';
|
import { invoke } from '@tauri-apps/api/core';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
|
import { t } from 'svelte-i18n';
|
||||||
import { getDevicePrettyName, isExternalDevice } from '$lib/utils/audioDeviceNames';
|
import { getDevicePrettyName, isExternalDevice } from '$lib/utils/audioDeviceNames';
|
||||||
import { isCasting, getConnectedDevice, getConnectedProtocol, subscribe as subscribeCast } from '$lib/stores/castStore';
|
import { isCasting, getConnectedDevice, getConnectedProtocol, subscribe as subscribeCast } from '$lib/stores/castStore';
|
||||||
|
|
||||||
@@ -139,25 +140,6 @@
|
|||||||
settings?.exclusive_mode === true
|
settings?.exclusive_mode === true
|
||||||
);
|
);
|
||||||
|
|
||||||
// Dynamic tooltip for DAC badge
|
|
||||||
const dacTooltip = $derived.by(() => {
|
|
||||||
if (!settings?.dac_passthrough) {
|
|
||||||
return 'DAC Passthrough desactivado - el sistema puede resamplear';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dacBadgeState === 'warning' && hardwareStatus?.hardware_sample_rate && samplingRate) {
|
|
||||||
const hwRate = (hardwareStatus.hardware_sample_rate / 1000).toFixed(1);
|
|
||||||
return `⚠ DAC Passthrough activo pero hay resampling\nArchivo: ${samplingRate} kHz → Hardware: ${hwRate} kHz`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hardwareStatus?.hardware_sample_rate) {
|
|
||||||
const hwRate = (hardwareStatus.hardware_sample_rate / 1000).toFixed(1);
|
|
||||||
return `DAC Passthrough activo - ${hwRate} kHz bit-perfect`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 'DAC Passthrough activo';
|
|
||||||
});
|
|
||||||
|
|
||||||
// Whether to show badges at all (only if at least one setting is enabled or device is external or casting)
|
// Whether to show badges at all (only if at least one setting is enabled or device is external or casting)
|
||||||
const shouldShowBadges = $derived(
|
const shouldShowBadges = $derived(
|
||||||
castConnected || settings?.dac_passthrough || settings?.exclusive_mode || isExternal || isAlsaDirect
|
castConnected || settings?.dac_passthrough || settings?.exclusive_mode || isExternal || isAlsaDirect
|
||||||
@@ -275,7 +257,7 @@
|
|||||||
<div class="device-tooltip">
|
<div class="device-tooltip">
|
||||||
<!-- Output Device -->
|
<!-- Output Device -->
|
||||||
<div class="tooltip-section">
|
<div class="tooltip-section">
|
||||||
<div class="tooltip-label">{castConnected ? 'Casting to' : 'Output Device'}</div>
|
<div class="tooltip-label">{castConnected ? $t('audioBadges.castingTo') : $t('audioBadges.outputDevice')}</div>
|
||||||
{#if castConnected}
|
{#if castConnected}
|
||||||
<div class="tooltip-device cast-device">
|
<div class="tooltip-device cast-device">
|
||||||
{#if castProtocol === 'dlna'}
|
{#if castProtocol === 'dlna'}
|
||||||
@@ -285,7 +267,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<span class="device-name-text">{castDeviceName || 'Unknown Device'}</span>
|
<span class="device-name-text">{castDeviceName || 'Unknown Device'}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="tooltip-raw">{castProtocol?.toUpperCase()} Streaming</div>
|
<div class="tooltip-raw">{$t('audioBadges.streaming', { values: { protocol: castProtocol?.toUpperCase() ?? '' } })}</div>
|
||||||
{:else}
|
{:else}
|
||||||
<div
|
<div
|
||||||
class="tooltip-device"
|
class="tooltip-device"
|
||||||
@@ -302,7 +284,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#if currentVolume !== null}
|
{#if currentVolume !== null}
|
||||||
<div class="tooltip-volume">
|
<div class="tooltip-volume">
|
||||||
<span class="volume-label">Volume:</span>
|
<span class="volume-label">{$t('player.volume')}:</span>
|
||||||
<span class="volume-value">{currentVolume}%</span>
|
<span class="volume-value">{currentVolume}%</span>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -312,14 +294,14 @@
|
|||||||
<!-- Audio Settings (only show when not casting) -->
|
<!-- Audio Settings (only show when not casting) -->
|
||||||
{#if !castConnected && (isAlsaDirect || settings?.dac_passthrough || settings?.exclusive_mode)}
|
{#if !castConnected && (isAlsaDirect || settings?.dac_passthrough || settings?.exclusive_mode)}
|
||||||
<div class="tooltip-section">
|
<div class="tooltip-section">
|
||||||
<div class="tooltip-label">Audio Settings</div>
|
<div class="tooltip-label">{$t('audioBadges.audioSettings')}</div>
|
||||||
{#if isAlsaDirect}
|
{#if isAlsaDirect}
|
||||||
<div class="tooltip-setting">
|
<div class="tooltip-setting">
|
||||||
<span class="setting-icon hw-icon">●</span>
|
<span class="setting-icon hw-icon">●</span>
|
||||||
<span class="setting-text">
|
<span class="setting-text">
|
||||||
✓ Hardware Direct: Bit-perfect ALSA
|
✓ {$t('audioBadges.hwDirectBitPerfect')}
|
||||||
{#if hardwareStatus?.hardware_sample_rate}
|
{#if hardwareStatus?.hardware_sample_rate}
|
||||||
<br><span class="setting-detail">{(hardwareStatus.hardware_sample_rate / 1000).toFixed(1)} kHz native</span>
|
<br><span class="setting-detail">{$t('audioBadges.kHzNative', { values: { rate: (hardwareStatus.hardware_sample_rate / 1000).toFixed(1) } })}</span>
|
||||||
{/if}
|
{/if}
|
||||||
<br><span class="setting-detail">{prettyDeviceName}</span>
|
<br><span class="setting-detail">{prettyDeviceName}</span>
|
||||||
</span>
|
</span>
|
||||||
@@ -330,18 +312,18 @@
|
|||||||
<span class="setting-icon" class:active={dacBadgeState === 'active'} class:warning={dacBadgeState === 'warning'}>●</span>
|
<span class="setting-icon" class:active={dacBadgeState === 'active'} class:warning={dacBadgeState === 'warning'}>●</span>
|
||||||
<span class="setting-text">
|
<span class="setting-text">
|
||||||
{#if dacBadgeState === 'warning'}
|
{#if dacBadgeState === 'warning'}
|
||||||
⚠ ERROR: PipeWire is resampling
|
⚠ {$t('audioBadges.resamplingError')}
|
||||||
{#if hardwareStatus?.hardware_sample_rate && samplingRate}
|
{#if hardwareStatus?.hardware_sample_rate && samplingRate}
|
||||||
<br><span class="setting-detail">File: {samplingRate} kHz → Hardware: {(hardwareStatus.hardware_sample_rate / 1000).toFixed(1)} kHz</span>
|
<br><span class="setting-detail">{$t('audioBadges.resamplingDetail', { values: { trackRate: samplingRate, hwRate: (hardwareStatus.hardware_sample_rate / 1000).toFixed(1) } })}</span>
|
||||||
<br><span class="setting-help">Fix: Configure PipeWire sample rate switching</span>
|
<br><span class="setting-help">{$t('audioBadges.resamplingFix')}</span>
|
||||||
{/if}
|
{/if}
|
||||||
{:else if dacBadgeState === 'active'}
|
{:else if dacBadgeState === 'active'}
|
||||||
✓ DAC Passthrough: Bit-perfect
|
✓ {$t('audioBadges.dacBitPerfect')}
|
||||||
{#if hardwareStatus?.hardware_sample_rate}
|
{#if hardwareStatus?.hardware_sample_rate}
|
||||||
<br><span class="setting-detail">{(hardwareStatus.hardware_sample_rate / 1000).toFixed(1)} kHz native</span>
|
<br><span class="setting-detail">{$t('audioBadges.kHzNative', { values: { rate: (hardwareStatus.hardware_sample_rate / 1000).toFixed(1) } })}</span>
|
||||||
{/if}
|
{/if}
|
||||||
{:else}
|
{:else}
|
||||||
DAC Passthrough: Disabled
|
{$t('audioBadges.dacDisabled')}
|
||||||
{/if}
|
{/if}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -349,7 +331,7 @@
|
|||||||
{#if settings.exclusive_mode}
|
{#if settings.exclusive_mode}
|
||||||
<div class="tooltip-setting">
|
<div class="tooltip-setting">
|
||||||
<span class="setting-icon" class:active={exclusiveModeActive}>●</span>
|
<span class="setting-icon" class:active={exclusiveModeActive}>●</span>
|
||||||
<span class="setting-text">Exclusive Mode</span>
|
<span class="setting-text">{$t('audioBadges.exclusiveMode')}</span>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -396,6 +396,20 @@
|
|||||||
"minimize": "Minimieren",
|
"minimize": "Minimieren",
|
||||||
"exitImmersive": "Immersiv-Modus beenden"
|
"exitImmersive": "Immersiv-Modus beenden"
|
||||||
},
|
},
|
||||||
|
"audioBadges": {
|
||||||
|
"castingTo": "Übertragung an",
|
||||||
|
"outputDevice": "Ausgabegerät",
|
||||||
|
"streaming": "{protocol} Streaming",
|
||||||
|
"audioSettings": "Audio-Einstellungen",
|
||||||
|
"hwDirectBitPerfect": "Hardware Direkt: Bit-perfect ALSA",
|
||||||
|
"kHzNative": "{rate} kHz nativ",
|
||||||
|
"resamplingError": "FEHLER: PipeWire führt Resampling durch",
|
||||||
|
"resamplingDetail": "Datei: {trackRate} kHz → Hardware: {hwRate} kHz",
|
||||||
|
"resamplingFix": "Lösung: PipeWire-Abtastratenumschaltung konfigurieren",
|
||||||
|
"dacBitPerfect": "DAC-Passthrough: Bit-perfect",
|
||||||
|
"dacDisabled": "DAC-Passthrough: Deaktiviert",
|
||||||
|
"exclusiveMode": "Exklusivmodus"
|
||||||
|
},
|
||||||
"quality": {
|
"quality": {
|
||||||
"mp3": "MP3 320kbps",
|
"mp3": "MP3 320kbps",
|
||||||
"cdQuality": "CD-Qualität",
|
"cdQuality": "CD-Qualität",
|
||||||
|
|||||||
@@ -410,6 +410,20 @@
|
|||||||
"minimize": "Minimize",
|
"minimize": "Minimize",
|
||||||
"exitImmersive": "Exit Immersive"
|
"exitImmersive": "Exit Immersive"
|
||||||
},
|
},
|
||||||
|
"audioBadges": {
|
||||||
|
"castingTo": "Casting to",
|
||||||
|
"outputDevice": "Output Device",
|
||||||
|
"streaming": "{protocol} Streaming",
|
||||||
|
"audioSettings": "Audio Settings",
|
||||||
|
"hwDirectBitPerfect": "Hardware Direct: Bit-perfect ALSA",
|
||||||
|
"kHzNative": "{rate} kHz native",
|
||||||
|
"resamplingError": "ERROR: PipeWire is resampling",
|
||||||
|
"resamplingDetail": "File: {trackRate} kHz → Hardware: {hwRate} kHz",
|
||||||
|
"resamplingFix": "Fix: Configure PipeWire sample rate switching",
|
||||||
|
"dacBitPerfect": "DAC Passthrough: Bit-perfect",
|
||||||
|
"dacDisabled": "DAC Passthrough: Disabled",
|
||||||
|
"exclusiveMode": "Exclusive Mode"
|
||||||
|
},
|
||||||
"quality": {
|
"quality": {
|
||||||
"mp3": "MP3 320kbps",
|
"mp3": "MP3 320kbps",
|
||||||
"cdQuality": "CD Quality",
|
"cdQuality": "CD Quality",
|
||||||
|
|||||||
@@ -410,6 +410,20 @@
|
|||||||
"minimize": "Minimizar",
|
"minimize": "Minimizar",
|
||||||
"exitImmersive": "Salir del modo inmersivo"
|
"exitImmersive": "Salir del modo inmersivo"
|
||||||
},
|
},
|
||||||
|
"audioBadges": {
|
||||||
|
"castingTo": "Transmitiendo a",
|
||||||
|
"outputDevice": "Dispositivo de salida",
|
||||||
|
"streaming": "{protocol} Streaming",
|
||||||
|
"audioSettings": "Configuración de audio",
|
||||||
|
"hwDirectBitPerfect": "Hardware Directo: Bit-perfect ALSA",
|
||||||
|
"kHzNative": "{rate} kHz nativo",
|
||||||
|
"resamplingError": "ERROR: PipeWire está resampleando",
|
||||||
|
"resamplingDetail": "Archivo: {trackRate} kHz → Hardware: {hwRate} kHz",
|
||||||
|
"resamplingFix": "Solución: Configura el cambio de sample rate en PipeWire",
|
||||||
|
"dacBitPerfect": "Passthrough DAC: Bit-perfect",
|
||||||
|
"dacDisabled": "Passthrough DAC: Desactivado",
|
||||||
|
"exclusiveMode": "Modo Exclusivo"
|
||||||
|
},
|
||||||
"quality": {
|
"quality": {
|
||||||
"mp3": "MP3 320kbps",
|
"mp3": "MP3 320kbps",
|
||||||
"cdQuality": "Calidad CD",
|
"cdQuality": "Calidad CD",
|
||||||
|
|||||||
@@ -396,6 +396,20 @@
|
|||||||
"minimize": "Réduire",
|
"minimize": "Réduire",
|
||||||
"exitImmersive": "Quitter le mode immersif"
|
"exitImmersive": "Quitter le mode immersif"
|
||||||
},
|
},
|
||||||
|
"audioBadges": {
|
||||||
|
"castingTo": "Diffusion vers",
|
||||||
|
"outputDevice": "Périphérique de sortie",
|
||||||
|
"streaming": "Streaming {protocol}",
|
||||||
|
"audioSettings": "Paramètres audio",
|
||||||
|
"hwDirectBitPerfect": "Hardware Direct : Bit-perfect ALSA",
|
||||||
|
"kHzNative": "{rate} kHz natif",
|
||||||
|
"resamplingError": "ERREUR : PipeWire effectue un rééchantillonnage",
|
||||||
|
"resamplingDetail": "Fichier : {trackRate} kHz → Hardware : {hwRate} kHz",
|
||||||
|
"resamplingFix": "Solution : Configurer le changement de taux d'échantillonnage PipeWire",
|
||||||
|
"dacBitPerfect": "Passthrough DAC : Bit-perfect",
|
||||||
|
"dacDisabled": "Passthrough DAC : Désactivé",
|
||||||
|
"exclusiveMode": "Mode exclusif"
|
||||||
|
},
|
||||||
"quality": {
|
"quality": {
|
||||||
"mp3": "MP3 320 kbps",
|
"mp3": "MP3 320 kbps",
|
||||||
"cdQuality": "Qualité CD",
|
"cdQuality": "Qualité CD",
|
||||||
|
|||||||
Reference in new issue
Block a user