diff --git a/src/Radiosender/Services/Localization/Loc.cs b/src/Radiosender/Services/Localization/Loc.cs new file mode 100644 index 0000000..b656b28 --- /dev/null +++ b/src/Radiosender/Services/Localization/Loc.cs @@ -0,0 +1,53 @@ +using System.ComponentModel; +using System.Globalization; +using System.Resources; + +namespace Radiosender.Services.Localization; + +// UI texts from Strings.resx (German, default) and Strings.en.resx. +// XAML binds to the indexer ({l:Tr Key}), so a language switch updates open views. +public sealed class Loc : INotifyPropertyChanged +{ + public const string German = "de"; + public const string English = "en"; + + private static readonly ResourceManager Texts = new($"{typeof(Loc).Namespace}.Strings", typeof(Loc).Assembly); + + private Loc() + { + } + + public static Loc Instance { get; } = new(); + + public static CultureInfo Culture { get; private set; } = CultureFor(German); + + public static string Language => Culture.TwoLetterISOLanguageName; + + // Views refresh texts they set in code. + public static event EventHandler? Changed; + + public event PropertyChangedEventHandler? PropertyChanged; + + public string this[string key] => T(key); + + // Missing key shows as #Key instead of crashing. + public static string T(string key) => Texts.GetString(key, Culture) ?? $"#{key}"; + + public static string F(string key, params object?[] args) => string.Format(Culture, T(key), args); + + public static bool IsSupported(string? language) => language is German or English; + + public static void SetLanguage(string language) + { + var culture = CultureFor(IsSupported(language) ? language : German); + if (culture.Name == Culture.Name) + return; + Culture = culture; + CultureInfo.CurrentUICulture = culture; + CultureInfo.DefaultThreadCurrentUICulture = culture; + Instance.PropertyChanged?.Invoke(Instance, new PropertyChangedEventArgs("Item[]")); + Changed?.Invoke(null, EventArgs.Empty); + } + + private static CultureInfo CultureFor(string language) => CultureInfo.GetCultureInfo(language == English ? "en-US" : "de-DE"); +} diff --git a/src/Radiosender/Services/Localization/Strings.en.resx b/src/Radiosender/Services/Localization/Strings.en.resx new file mode 100644 index 0000000..2a43344 --- /dev/null +++ b/src/Radiosender/Services/Localization/Strings.en.resx @@ -0,0 +1,290 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Audio file not found: {0} + Audio file cannot be read: {0} + The microphone could not be turned on: {0} + No microphone was found. + All licenses + Choose files... + Creator + Details + Source + Status + Downloading "{0}"... + Downloading {0} of {1}: "{2}"... + Drop MP3 or WAV files here + Drop area for MP3 and WAV files + Import failed + {0} of {1} songs could not be imported. The reasons are listed under "Imported". + "{0}" ({1}) was added to the library. + Audio files (*.mp3;*.wav)|*.mp3;*.wav + Import to library + Import {0} to library + {0} licenses + Licenses in search results + No license selected + Select at least one license for the search. + No results + Nothing found for "{0}". + Nothing found for "{0}" with the selected licenses. + Open library + Preview + Preview failed + Import progress + Search term + Search results + The song could not be saved: {0} + The song could not be saved to the library. + Search + Search failed + Searching for "{0}"... + Searching for "{0}"... {1} of {2} sources done + Not all sources responded + Search free music, for example "jazz piano" + Songs imported in this session + Imported + Added + Failed + In library + No duration + Stop + From computer + Online + Import + Importing {0} of {1}: {2} + New item: {0} + Cancel + Edit item: {0} + _Length (m:ss) + Enter the length as minutes and seconds, for example 5:00. + Optional + Save + _Title + Edit item + Ad + Host segment + News + Song + Cancel + Delete + Delete "{0}" by {1} from the library? + Delete song + Edit + No songs yet. Add music on the Import page. + Songs + No song matches the search. + Search songs + Search by title or artist + Library + laut.fm is turned off in the settings. + Import + Library + Schedule + Settings + OK + {0} at {1:HH:mm:ss} + {0} at {1:HH:mm:ss}: {2} + You're up soon. + "{0}" is already in the library. + Download failed: {0} + Download failed: the request timed out. + The download was empty. + Only https downloads are allowed. + {0} returned HTTP {1}. + This result has no duration and cannot be imported. + {0} limit reached (anonymous: 20 requests per minute, 200 per day). Please try again later. + {0} search failed: {1} + {0} search failed: the request timed out. + {0} search failed: unexpected response. + The server returned HTTP {0}. + The file is larger than 50 MB. + Add + Song (from song request) + Inserts as the item after next. + The item is already at the edge of the schedule. + The schedule could not be changed + Duration + Title + Type + Create plan + The schedule could not be created + Create a schedule first. + Drag to move + Edit selected item + Edit title and length + No schedule yet. Choose the hours and create a schedule. + End broadcast + The broadcast could not be ended + The item could not be ended + End now + Ends the current item right away; the next one starts. + The schedule could not be extended: {0} + Broadcast ended + The whole schedule has been played. + Go live + This item is already on air or over. + Replaces the item at {0:HH:mm:ss}. + Select an upcoming item in the schedule. + Hours + Hours to schedule + "{0}" skipped: {1} + This item is already over. Choose a later one. + Item skipped + The length must be greater than zero. + Microphone for listeners + Mic off + Turn microphone off, it is on air + Mic on + Turn microphone on + Microphone + Puts the microphone on air, also over playing music. + Microphone unavailable + What listeners hear + What you hear + Move down + Move selected item down + Move up + Move selected item up + Music + Music for listeners + Music you hear + You don't hear your own microphone, so no delay distracts you. + News cannot be replaced. + Running without laut.fm + No song selected + First choose a song under “Song request”. + Nothing on air + Nothing is on air. + Now + On air now + This item is on air. It can be edited or ended, but not moved or removed. + On air + Only news and host segments can change their length. + This schedule is already over. Create a new one. + Progress of the current item + Remove selected item + Remove from schedule + Song request + Requested song + The broadcast has moved on in the meantime. Try again. + Same as listeners + You hear exactly what listeners hear, including your microphone. + Select an item in the schedule. + The song is no longer in the library. + Songs are edited in the library. + Start + Cannot start + Starts the created schedule and broadcasts live to your laut.fm station. + Start now + Starts the created schedule. + Start time + “Now”, a full hour, or your own time like 14:30 + Choose “Now” or a time, or type one, for example 14:30. + Start time unclear + Stop + Stops playback and the live stream to laut.fm. + Stops playback. + Replace selection + Song request scheduled + "{0}" plays at {1:HH:mm:ss}. + The song request could not be scheduled + This item is already on air or over. Choose a later one. + This item has gone on air in the meantime. Choose a later one. + Schedule + Unlimited + No end: the next 5 hours are planned, and another hour is added every hour. + On air at {0:HH:mm:ss} + "{0}" ({1:m\:ss}) does not fit before the news at {2:HH:mm}; only {3:m\:ss} is left. Choose an earlier item. + No combination of songs fills the section from {0:HH:mm} so that the last song ends on time. Add more songs, especially shorter ones. + The requested song has no duration. + The library has no songs to schedule. + The song did not finish in time: {0} + Ad minutes per hour + Ads + The alert time must be between {0} and {1} seconds. + A selected audio device could not be opened. The previous devices stay active. + Audio output + Output device for listeners + Windows default device + Defaults applied + Save to apply. + Separate volumes for listeners and for you need two different devices. With only one device, you hear the settings of “What you hear”. + For listeners + For you + Language + This language is not supported. + laut.fm needs a valid server. + laut.fm server + Streams live to your laut.fm station. The start button on the schedule then reads “Go live”. + laut.fm needs a mount point. + laut.fm mount point + The password is stored encrypted for your Windows user. + laut.fm password + laut.fm port + The laut.fm port must be between 1 and 65535. + laut.fm user + You find these values in Radioadmin under “Live senden”. + Stream live + Target values, at most 60 minutes in total. Applies to the next schedule. + Minutes per hour cannot be negative. + Minutes per hour + News, host segments and ads can take at most 60 minutes per hour together. + Host segments + Host segment alert + Host segment minutes per hour + Seconds before host segment + Output device for you + News + News alert + News needs at least 2 minutes per hour. + News minutes per hour + Seconds before news + No separate device + Not saved + Password + Play chime + Reset + Puts the default values into the form. Save to apply them. + Save + Saved + Minutes per hour apply to the next schedule. + Seconds before start + Settings + User + Artist + Duration + unknown + License + The file contains no audio. + The file is not a readable MP3 or WAV file. + Only MP3 and WAV files are supported. + The file could not be read: {0} + Title + _Artist + Attri_bution + _License + _Title + Optional, e.g. CC BY 4.0 + Optional + Title and artist are required. + Save + Edit song + Lost connection to laut.fm: {0} + The live stream ended unexpectedly. + Server, mount point or user contain invalid characters. + The server sent an invalid reply. + laut.fm refused the login: user or password is wrong. + laut.fm is not accepting a live stream right now: the mount point is busy or not enabled. + This mount point does not exist on the server. + No connection to the laut.fm server: {0} + Windows has no MP3 encoder. + The laut.fm server is not responding. + The server closed the connection without a valid reply. + The server rejected the live stream (HTTP {0}). + The title could not be sent to laut.fm: {0} + laut.fm did not accept the title (HTTP {0}). + diff --git a/src/Radiosender/Services/Localization/Strings.resx b/src/Radiosender/Services/Localization/Strings.resx new file mode 100644 index 0000000..b7e3780 --- /dev/null +++ b/src/Radiosender/Services/Localization/Strings.resx @@ -0,0 +1,290 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + Audiodatei nicht gefunden: {0} + Audiodatei kann nicht gelesen werden: {0} + Das Mikrofon konnte nicht eingeschaltet werden: {0} + Es wurde kein Mikrofon gefunden. + Alle Lizenzen + Dateien auswählen... + Urheber + Details + Quelle + Status + Lade "{0}" herunter... + Lade {0} von {1} herunter: "{2}"... + MP3- oder WAV-Dateien hier ablegen + Ablagebereich für MP3- und WAV-Dateien + Import fehlgeschlagen + {0} von {1} Songs konnten nicht importiert werden. Die Gründe stehen in der Liste "Importiert". + "{0}" ({1}) wurde zur Bibliothek hinzugefügt. + Audiodateien (*.mp3;*.wav)|*.mp3;*.wav + In Bibliothek importieren + {0} in Bibliothek importieren + {0} Lizenzen + Lizenzen in den Suchergebnissen + Keine Lizenz gewählt + Wähle mindestens eine Lizenz für die Suche. + Keine Ergebnisse + Nichts zu "{0}" gefunden. + Nichts zu "{0}" mit den gewählten Lizenzen gefunden. + Bibliothek öffnen + Vorhören + Vorhören fehlgeschlagen + Import-Fortschritt + Suchbegriff + Suchergebnisse + Der Song konnte nicht gespeichert werden: {0} + Der Song konnte nicht in der Bibliothek gespeichert werden. + Suchen + Suche fehlgeschlagen + Suche nach "{0}"... + Suche nach "{0}"... {1} von {2} Quellen fertig + Nicht alle Quellen haben geantwortet + Freie Musik suchen, zum Beispiel "jazz piano" + In dieser Sitzung importierte Songs + Importiert + Hinzugefügt + Fehlgeschlagen + In Bibliothek + Keine Dauer + Stopp + Vom Computer + Online + Import + Importiere {0} von {1}: {2} + {0} hinzufügen + Abbrechen + {0} bearbeiten + _Länge (m:ss) + Länge als Minuten und Sekunden eingeben, zum Beispiel 5:00. + Optional + Speichern + _Titel + Element bearbeiten + Werbung + Moderation + Nachrichten + Song + Abbrechen + Löschen + "{0}" von {1} aus der Bibliothek löschen? + Song löschen + Bearbeiten + Noch keine Songs. Musik auf der Seite Import hinzufügen. + Songs + Kein Song passt zur Suche. + Songs suchen + Titel oder Interpret suchen + Bibliothek + laut.fm ist in den Einstellungen ausgeschaltet. + Import + Bibliothek + Sendeplan + Einstellungen + OK + {0} um {1:HH:mm:ss} + {0} um {1:HH:mm:ss}: {2} + Gleich bist du dran. + "{0}" ist bereits in der Bibliothek. + Download fehlgeschlagen: {0} + Download fehlgeschlagen: Zeitüberschreitung der Anfrage. + Der Download war leer. + Nur https-Downloads sind erlaubt. + {0} hat HTTP {1} geliefert. + Dieses Ergebnis hat keine Dauer und kann nicht importiert werden. + {0}-Limit erreicht (anonym: 20 Anfragen pro Minute, 200 pro Tag). Bitte später erneut versuchen. + {0}-Suche fehlgeschlagen: {1} + {0}-Suche fehlgeschlagen: Zeitüberschreitung der Anfrage. + {0}-Suche fehlgeschlagen: unerwartete Antwort. + Der Server hat HTTP {0} geliefert. + Die Datei ist größer als 50 MB. + Hinzufügen + Song (aus Songwunsch) + Fügt als übernächstes Element ein. + Das Element ist bereits am Rand des Plans. + Der Plan konnte nicht geändert werden + Dauer + Titel + Typ + Plan erstellen + Der Plan konnte nicht erstellt werden + Zuerst einen Plan erstellen. + Ziehen zum Verschieben + Ausgewähltes Element bearbeiten + Titel und Länge bearbeiten + Noch kein Plan. Stunden wählen und Plan erstellen. + Sendung beenden + Die Sendung konnte nicht beendet werden + Das Element konnte nicht beendet werden + Jetzt beenden + Beendet das laufende Element sofort; das nächste startet. + Der Plan konnte nicht verlängert werden: {0} + Sendung beendet + Der ganze Plan wurde gespielt. + Live starten + Dieses Element ist bereits auf Sendung oder vorbei. + Ersetzt das Element um {0:HH:mm:ss}. + Ein kommendes Element im Plan auswählen. + Stunden + Zu planende Stunden + "{0}" übersprungen: {1} + Dieses Element ist bereits vorbei. Ein späteres wählen. + Element übersprungen + Die Länge muss größer als null sein. + Mikrofon für die Hörer + Mikro aus + Mikrofon ausschalten, es ist auf Sendung + Mikro ein + Mikrofon einschalten + Mikrofon + Schaltet das Mikrofon auf Sendung, auch über laufende Musik. + Mikrofon nicht verfügbar + Was die Hörer hören + Was du hörst + Nach unten + Ausgewähltes Element nach unten verschieben + Nach oben + Ausgewähltes Element nach oben verschieben + Musik + Musik für die Hörer + Musik, die du hörst + Dein Mikrofon hörst du nicht selbst, damit dich keine Verzögerung stört. + Nachrichten können nicht ersetzt werden. + Läuft ohne laut.fm + Kein Song gewählt + Wähle zuerst unter „Songwunsch“ einen Song. + Nichts auf Sendung + Es ist nichts auf Sendung. + Jetzt + Läuft gerade + Dieses Element ist auf Sendung. Es kann bearbeitet oder beendet, aber nicht verschoben oder entfernt werden. + Auf Sendung + Nur Nachrichten und Moderation können ihre Länge ändern. + Dieser Plan ist bereits vorbei. Einen neuen erstellen. + Fortschritt des aktuellen Elements + Ausgewähltes Element entfernen + Aus dem Plan entfernen + Songwunsch + Gewünschter Song + Die Sendung ist inzwischen weitergelaufen. Erneut versuchen. + Genau wie die Hörer + Du hörst exakt, was die Hörer hören, auch dein Mikrofon. + Ein Element im Plan auswählen. + Der Song ist nicht mehr in der Bibliothek. + Songs werden in der Bibliothek bearbeitet. + Start + Start nicht möglich + Startet den erstellten Plan und sendet live auf deine laut.fm-Station. + Jetzt starten + Startet den erstellten Plan. + Startzeit + „Jetzt“, eine volle Stunde oder eine eigene Uhrzeit wie 14:30 + Wähle „Jetzt“ oder eine Uhrzeit, oder tippe eine ein, zum Beispiel 14:30. + Startzeit unklar + Stopp + Stoppt die Wiedergabe und den Livestream zu laut.fm. + Stoppt die Wiedergabe. + Auswahl ersetzen + Songwunsch eingeplant + "{0}" läuft um {1:HH:mm:ss}. + Der Songwunsch konnte nicht eingeplant werden + Dieses Element ist bereits auf Sendung oder vorbei. Ein späteres wählen. + Dieses Element ist inzwischen auf Sendung gegangen. Ein späteres wählen. + Sendeplan + Unbegrenzt + Ohne Ende: Die nächsten 5 Stunden sind geplant, jede Stunde kommt eine weitere dazu. + Auf Sendung um {0:HH:mm:ss} + "{0}" ({1:m\:ss}) passt nicht vor die Nachrichten um {2:HH:mm}; es sind nur noch {3:m\:ss} übrig. Ein früheres Element wählen. + Keine Song-Kombination füllt den Abschnitt ab {0:HH:mm} so, dass der letzte Song pünktlich endet. Mehr Songs hinzufügen, vor allem kürzere. + Der gewünschte Song hat keine Dauer. + Die Bibliothek enthält keine Songs zum Planen. + Der Song wurde nicht rechtzeitig fertig: {0} + Werbe-Minuten pro Stunde + Werbung + Die Hinweiszeit muss zwischen {0} und {1} Sekunden liegen. + Ein gewähltes Audiogerät konnte nicht geöffnet werden. Die bisherigen Geräte bleiben aktiv. + Audio-Ausgabe + Ausgabegerät für die Hörer + Windows-Standardgerät + Standardwerte eingesetzt + Mit Speichern übernehmen. + Getrennte Lautstärken für die Hörer und für dich brauchen zwei verschiedene Geräte. Mit nur einem Gerät hörst du die Einstellungen von „Was du hörst“. + Für die Hörer + Für dich + Sprache + Diese Sprache wird nicht unterstützt. + Für laut.fm fehlt ein gültiger Server. + laut.fm-Server + Sendet live auf deine laut.fm-Station. Der Start-Button im Sendeplan heißt dann „Live starten“. + Für laut.fm fehlt der Mountpoint. + laut.fm-Mountpoint + Das Passwort wird verschlüsselt für deinen Windows-Benutzer gespeichert. + laut.fm-Passwort + laut.fm-Port + Der laut.fm-Port muss zwischen 1 und 65535 liegen. + laut.fm-Benutzer + Diese Werte stehen in Radioadmin unter „Live senden“. + Live senden + Sollwerte, zusammen höchstens 60 Minuten. Gilt für den nächsten Plan. + Minuten pro Stunde dürfen nicht negativ sein. + Minuten pro Stunde + Nachrichten, Moderation und Werbung dürfen zusammen höchstens 60 Minuten pro Stunde dauern. + Moderation + Hinweis vor Moderation + Moderations-Minuten pro Stunde + Sekunden vor Moderation + Ausgabegerät für dich + Nachrichten + Hinweis vor Nachrichten + Nachrichten brauchen mindestens 2 Minuten pro Stunde. + Nachrichten-Minuten pro Stunde + Sekunden vor Nachrichten + Kein eigenes Gerät + Nicht gespeichert + Passwort + Bing-Ton abspielen + Zurücksetzen + Setzt die Standardwerte ins Formular. Mit Speichern übernehmen. + Speichern + Gespeichert + Minuten pro Stunde gelten für den nächsten Plan. + Sekunden vor dem Start + Einstellungen + Benutzer + Interpret + Dauer + unbekannt + Lizenz + Die Datei enthält kein Audio. + Die Datei ist keine lesbare MP3- oder WAV-Datei. + Nur MP3- und WAV-Dateien werden unterstützt. + Die Datei konnte nicht gelesen werden: {0} + Titel + _Interpret + _Namensnennung + _Lizenz + _Titel + Optional, z. B. CC BY 4.0 + Optional + Titel und Interpret sind erforderlich. + Speichern + Song bearbeiten + Verbindung zu laut.fm verloren: {0} + Der Livestream wurde unerwartet beendet. + Server, Mountpoint oder Benutzer enthalten ungültige Zeichen. + Der Server hat ungültig geantwortet. + laut.fm hat die Anmeldung abgelehnt: Benutzer oder Passwort stimmen nicht. + laut.fm nimmt gerade keinen Livestream an: Der Mountpoint ist belegt oder nicht freigeschaltet. + Diesen Mountpoint gibt es auf dem Server nicht. + Keine Verbindung zum laut.fm-Server: {0} + Windows hat keinen MP3-Encoder. + Der laut.fm-Server antwortet nicht. + Der Server hat die Verbindung ohne gültige Antwort beendet. + Der Server hat den Livestream abgelehnt (HTTP {0}). + Der Titel konnte nicht an laut.fm gesendet werden: {0} + laut.fm hat den Titel nicht angenommen (HTTP {0}). +