From c7d82f743d501e0708fcc552201c2defa4f00c20 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Mon, 6 Jul 2020 18:39:35 +0200 Subject: [PATCH] implementation for the client: add support to change language (#297) -> server implementation still TODO --- ChangeLog | 1 + src/clientsettingsdlg.cpp | 6 + src/clientsettingsdlg.h | 1 + src/clientsettingsdlgbase.ui | 16 ++ src/res/translation/translation_de_DE.ts | 176 ++++++++++--------- src/res/translation/translation_es_ES.ts | 176 ++++++++++--------- src/res/translation/translation_fr_FR.ts | 204 ++++++++++++----------- src/res/translation/translation_it_IT.ts | 176 ++++++++++--------- src/res/translation/translation_nl_NL.ts | 176 ++++++++++--------- src/res/translation/translation_pl_PL.ts | 176 ++++++++++--------- src/res/translation/translation_pt_BR.ts | 176 ++++++++++--------- src/res/translation/translation_pt_PT.ts | 176 ++++++++++--------- src/res/translation/translation_sv_SE.ts | 176 ++++++++++--------- src/settings.h | 15 +- src/util.cpp | 71 ++++++++ src/util.h | 22 ++- 16 files changed, 1012 insertions(+), 732 deletions(-) diff --git a/ChangeLog b/ChangeLog index a265811d..7503d638 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,7 @@ TODO add support to change language (#297) TODO add language selector also in the server GUI + TODO search in the code for "TODO maybe first try to find the complete string, if not found use only first two letters instead" TODO bug fix: incorrect selection of UI language (#408) !!!!!!!!!!!!!!!!!!!!!!!!!!!!! -> note that for the 3.5.8 bug fix release we went back to the original translation code (e.g. no pt_BR!) diff --git a/src/clientsettingsdlg.cpp b/src/clientsettingsdlg.cpp index 11b841cb..83451379 100755 --- a/src/clientsettingsdlg.cpp +++ b/src/clientsettingsdlg.cpp @@ -341,6 +341,9 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, cbxSkin->addItem ( tr ( "Compact" ) ); // GD_SLIMFADER cbxSkin->setCurrentIndex ( static_cast ( pClient->GetGUIDesign() ) ); + // language combo box (corrects the setting if language not found) + cbxLanguage->Init ( pSettings->strLanguage ); + // custom central server address edtCentralServerAddress->setText ( pClient->GetServerListCentralServerAddress() ); @@ -423,6 +426,9 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QObject::connect ( cbxSkin, static_cast ( &QComboBox::activated ), this, &CClientSettingsDlg::OnGUIDesignActivated ); + QObject::connect ( cbxLanguage, &CLanguageComboBox::LanguageChanged, + this, &CClientSettingsDlg::OnLanguageChanged ); + // buttons QObject::connect ( butDriverSetup, &QPushButton::clicked, this, &CClientSettingsDlg::OnDriverSetupClicked ); diff --git a/src/clientsettingsdlg.h b/src/clientsettingsdlg.h index 6a589e8e..2bb04f52 100755 --- a/src/clientsettingsdlg.h +++ b/src/clientsettingsdlg.h @@ -107,6 +107,7 @@ protected: void OnAudioQualityActivated ( int iQualityIdx ); void OnGUIDesignActivated ( int iDesignIdx ); void OnDriverSetupClicked(); + void OnLanguageChanged ( QString strLanguage ) { pSettings->strLanguage = strLanguage; } signals: void GUIDesignChanged(); diff --git a/src/clientsettingsdlgbase.ui b/src/clientsettingsdlgbase.ui index 40fb9f45..bf9bc4e4 100755 --- a/src/clientsettingsdlgbase.ui +++ b/src/clientsettingsdlgbase.ui @@ -515,6 +515,13 @@ + + + + Language + + + @@ -542,6 +549,9 @@ + + + @@ -707,6 +717,11 @@ QWidget
multicolorled.h
+ + CLanguageComboBox + QComboBox +
util.h
+
cbxSoundcard @@ -726,6 +741,7 @@ cbxAudioQuality edtNewClientLevel cbxSkin + cbxLanguage chbDisplayChannelLevels edtCentralServerAddress diff --git a/src/res/translation/translation_de_DE.ts b/src/res/translation/translation_de_DE.ts index 0853e28d..48176fb4 100644 --- a/src/res/translation/translation_de_DE.ts +++ b/src/res/translation/translation_de_DE.ts @@ -1588,22 +1588,22 @@ Manuell - + Custom Benutzerdefiniert - + All Genres Alle Genres - + Genre Rock Genre Rock - + Genre Jazz Genre Jazz @@ -1612,12 +1612,12 @@ Genre Rock/Jazz - + Genre Classical/Folk/Choir Genre Klassik/Volksmusik/Chor - + Default Standard @@ -1626,23 +1626,23 @@ Standard (Nordamerika) - + preferred bevorzugt - - + + Size: Größe: - + Buffer Delay Puffergröße - + Buffer Delay: Puffergröße: @@ -1651,17 +1651,17 @@ Vordefinierte Adresse - + The selected audio device could not be used because of the following error: Das ausgewählte Audiogerät kann aus folgendem Grund nicht verwendet werden: - + The previous driver will be selected. Der vorherige Treiber wird wieder ausgewählt. - + Ok @@ -1787,7 +1787,12 @@ Oberfläche - + + Language + + + + % @@ -1796,12 +1801,12 @@ Schicke Oberfläche - + Display Channel Levels Zeige Signalpegel - + Custom Central Server Address: Benutzerdefinierte Zentralserveradresse: @@ -1810,24 +1815,24 @@ Zentralserveradresse: - + Audio Stream Rate Netzwerkrate - - - + + + val Wert - + Ping Time Ping-Zeit - + Overall Delay Gesamtverzögerung @@ -2027,6 +2032,19 @@ Ü&ber... + + CLanguageComboBox + + + Restart Required + + + + + Please restart the application for the language change to take effect. + + + CLicenceDlg @@ -2164,7 +2182,7 @@ - + None Kein @@ -2242,212 +2260,212 @@ Was man hier sieht wird auch am Fader im Mixer angezeigt, wenn du mit einem Server verbunden bist. Dieses Schild wird auch bei allen anderen Musikern, die mit dem gleichen Server verbunden sind, angezeigt. - + Drum Set Schlagzeug - + Djembe Djembe - + Electric Guitar E-Gitarre - + Acoustic Guitar Akustikgitarre - + Bass Guitar E-Bass - + Keyboard Keyboard - + Synthesizer Synthesizer - + Grand Piano Flügel - + Accordion Akkordeon - + Vocal Gesang - + Microphone Mikrofon - + Harmonica Mundharmonika - + Trumpet Trompete - + Trombone Posaune - + French Horn Waldhorn - + Tuba Tuba - + Saxophone Saxophon - + Clarinet Klarinette - + Flute Flöte - + Violin Violine - + Cello Cello - + Double Bass Kontrabass - + Recorder Recorder - + Streamer - + Listener Zuhörer - + Guitar+Vocal Gitarre+Gesang - + Keyboard+Vocal Keyboard+Gesang - + Bodhran - + Bassoon Fagott - + Oboe Oboe - + Harp Harfe - + Viola Viola - + Congas Congas - + Bongo Bongos - + Vocal Bass Gesang Bass - + Vocal Tenor Gesang Tenor - + Vocal Alto Gesang Alt - + Vocal Soprano Gesang Sopran - + Banjo Banjo - + Mandolin Mandoline - + Ukulele - + Bass Ukulele @@ -2860,52 +2878,52 @@ &Fenster - + Unregistered Nicht registriert - + Bad address Ungültige Adresse - + Registration requested Registrierung angefordert - + Registration failed Registrierung fehlgeschlagen - + Check server version Überprüfe Version des Servers - + Registered Registriert - + Central Server full Zentralserver voll - + Your server version is too old Deine Serverversion ist zu alt - + Requirements not fulfilled Anfoderungen nicht erfüllt - + Unknown value Unbekannter Wert @@ -3197,17 +3215,17 @@ QCoreApplication - + , Version , Version - + Internet Jam Session Software Internet Jam Session Software - + Released under the GNU General Public License (GPL) Unter der GNU General Public License (GPL) diff --git a/src/res/translation/translation_es_ES.ts b/src/res/translation/translation_es_ES.ts index c3b0f4cf..f27f9f11 100644 --- a/src/res/translation/translation_es_ES.ts +++ b/src/res/translation/translation_es_ES.ts @@ -1604,12 +1604,12 @@ Manual - + Custom Personalizado - + All Genres Todos los Géneros @@ -1618,22 +1618,22 @@ Género Rock/Jazz - + Genre Classical/Folk/Choir Género Clásica/Folk/Coro - + Genre Rock Género Rock - + Genre Jazz Género Jazz - + Default Por defecto @@ -1642,23 +1642,23 @@ Por defecto (Norteamérica) - + preferred aconsejado - - + + Size: Tamaño: - + Buffer Delay Retardo Buffer - + Buffer Delay: Retardo Buffer: @@ -1667,17 +1667,17 @@ Dirección Preestablecida - + The selected audio device could not be used because of the following error: El dispositivo de audio seleccionado no puede utilizarse a causa del siguiente error: - + The previous driver will be selected. Se utilizará el driver anterior. - + Ok Ok @@ -1803,7 +1803,12 @@ Skin - + + Language + + + + % % @@ -1812,12 +1817,12 @@ Intfaz Oscura - + Display Channel Levels Mostrar Nivel Canales - + Custom Central Server Address: Dirección Personalizada Servidor Central: @@ -1826,24 +1831,24 @@ Dirección Servidor Central: - + Audio Stream Rate Tasa Muestreo Audio - - - + + + val val - + Ping Time Tiempo Ping - + Overall Delay Retardo Total @@ -2051,6 +2056,19 @@ &Acerca de... + + CLanguageComboBox + + + Restart Required + + + + + Please restart the application for the language change to take effect. + + + CLicenceDlg @@ -2188,7 +2206,7 @@ - + None Ninguno @@ -2266,212 +2284,212 @@ Lo que introduzcas aquí aparecerá en tu fader del mezclador cuando te conectes a un servidor Jamulus. Esta etiqueta también se mostrará en cada cliente conectado al mismo servidor que tú. - + Drum Set Batería - + Djembe Djembé - + Electric Guitar Guitarra Eléctrica - + Acoustic Guitar Guitarra Acústica - + Bass Guitar Bajo Eléctrico - + Keyboard Teclado - + Synthesizer Sintetizador - + Grand Piano Piano de Cola - + Accordion Acordeón - + Vocal Voz - + Microphone Micrófono - + Harmonica Armónica - + Trumpet Trompeta - + Trombone Trombón - + French Horn Trompa - + Tuba Tuba - + Saxophone Saxofón - + Clarinet Clarinete - + Flute Flauta - + Violin Violín - + Cello Violonchelo - + Double Bass Contrabajo - + Recorder Grabadora - + Streamer Streamer - + Listener Oyente - + Guitar+Vocal Guitarra+Voz - + Keyboard+Vocal Teclado+Voz - + Bodhran Bodhran - + Bassoon Fagot - + Oboe Oboe - + Harp Arpa - + Viola Viola - + Congas Congas - + Bongo Bongo - + Vocal Bass Voz Bajo - + Vocal Tenor Voz Tenor - + Vocal Alto Voz Alto - + Vocal Soprano Voz Soprano - + Banjo Banjo - + Mandolin Mandolina - + Ukulele Ukulele - + Bass Ukulele Ukulele Barítono @@ -2880,52 +2898,52 @@ &Ventana - + Unregistered Sin registrar - + Bad address Dirección no válida - + Registration requested Registro solicitado - + Registration failed Error de registro - + Check server version Comprueba la versión del servidor - + Registered Registrado - + Central Server full Servidor Central lleno - + Your server version is too old La versión de tu servidor es demasiado antigua - + Requirements not fulfilled No se cumplen los requisitos - + Unknown value Valor desconocido @@ -3217,17 +3235,17 @@ QCoreApplication - + , Version , Versión - + Internet Jam Session Software Internet Jam Session Software - + Released under the GNU General Public License (GPL) Publicado bajo la GNU General Public License (GPL) diff --git a/src/res/translation/translation_fr_FR.ts b/src/res/translation/translation_fr_FR.ts index dd2c1797..854eefa4 100644 --- a/src/res/translation/translation_fr_FR.ts +++ b/src/res/translation/translation_fr_FR.ts @@ -1608,12 +1608,12 @@ Manuel - + Custom Personnalisé - + All Genres Tous les genres @@ -1622,22 +1622,22 @@ Genre rock/jazz - + Genre Classical/Folk/Choir Genre classique/folk/choeur - + Genre Rock Genre Rock - + Genre Jazz Genre Jazz - + Default Défaut @@ -1646,23 +1646,23 @@ Défaut (Amérique du Nord) - + preferred préféré - - + + Size: Taille : - + Buffer Delay Délai de temporisation - + Buffer Delay: Délai de temporisation : @@ -1671,17 +1671,17 @@ Adresse prédéfinie - + The selected audio device could not be used because of the following error: Le périphérique audio sélectionné n'a pas pu être utilisé en raison de l'erreur suivante : - + The previous driver will be selected. Le pilote précédent sera sélectionné. - + Ok Ok @@ -1807,7 +1807,12 @@ Thème graphique - + + Language + + + + % % @@ -1816,12 +1821,12 @@ Habillage fantaisie - + Display Channel Levels Afficher les niveaux des canaux - + Custom Central Server Address: Adresse personnalisée du serveur central : @@ -1830,24 +1835,24 @@ Adresse du serveur central : - + Audio Stream Rate Débit du flux audio - - - + + + val val - + Ping Time Temps de réponse - + Overall Delay Délai global @@ -2047,6 +2052,19 @@ À &propos + + CLanguageComboBox + + + Restart Required + + + + + Please restart the application for the language change to take effect. + + + CLicenceDlg @@ -2184,7 +2202,7 @@ - + None Aucune @@ -2258,212 +2276,212 @@ Ce que vous réglez ici apparaîtra au niveau de votre chariot sur la table de mixage lorsque vous serez connecté à un serveur Jamulus. Cette étiquette sera également affichée dans chaque client qui est connecté au même serveur que vous. - + Drum Set Batterie - + Djembe Djembé - + Electric Guitar Guitare électrique - + Acoustic Guitar Guitare accoustique - + Bass Guitar Guitare basse - + Keyboard Clavier - + Synthesizer Synthétiseur - + Grand Piano Piano à queue - + Accordion Accordéon - + Vocal Voix - + Microphone Microphone - + Harmonica Harmonica - + Trumpet Trompette - + Trombone Trombone - + French Horn Cor d'harmonie - + Tuba Tuba - + Saxophone Saxophone - + Clarinet Clarinette - + Flute Flute - + Violin Violon - + Cello Violoncelle - + Double Bass Contrebasse - + Recorder Enregistreur - + Streamer Diffuseur - + Listener Auditeur - + Guitar+Vocal Guitare+voix - + Keyboard+Vocal Clavier+voix - + Bodhran Bodhran - + Bassoon Basson - + Oboe Hautbois - + Harp Harpe - + Viola Alto - + Congas Congas - + Bongo Bongo - + Vocal Bass Voix basse - + Vocal Tenor Voix ténor - + Vocal Alto Voix alto - + Vocal Soprano Voix soprano - + Banjo Banjo - + Mandolin Mandoline - + Ukulele Ukulélé - + Bass Ukulele Ukulélé basse @@ -2644,7 +2662,7 @@ Display dialog to select recording directory button - Afficher le dialogue pour sélectionner le bouton du répertoire d'enregistrement + Afficher le dialogue pour sélectionner le bouton du répertoire d'enregistrement @@ -2655,22 +2673,22 @@ Click the button to open the dialog that allows the main recording directory to be selected.The chosen value must exist and be writeable (allow creation of sub-directories by the user Jamulus is running as). - Cliquez sur le bouton pour ouvrir la boîte de dialogue permettant de sélectionner le répertoire d'enregistrement principal. La valeur choisie doit exister et être inscriptible (permettre la création de sous-répertoires par l'utilisateur sous lequel Jamulus fonctionne). + Cliquez sur le bouton pour ouvrir la boîte de dialogue permettant de sélectionner le répertoire d'enregistrement principal. La valeur choisie doit exister et être inscriptible (permettre la création de sous-répertoires par l'utilisateur sous lequel Jamulus fonctionne). Main recording directory text box (read-only) - Zone de texte du répertoire principal d'enregistrement (lecture seule) + Zone de texte du répertoire principal d'enregistrement (lecture seule) The current value of the main recording directory. The chosen value must exist and be writeable (allow creation of sub-directories by the user Jamulus is running as). Click the button to open the dialog that allows the main recording directory to be selected. - La valeur actuelle du répertoire principal d'enregistrement. La valeur choisie doit exister et être inscriptible (permettre la création de sous-répertoires par l'utilisateur sous lequel Jamulus fonctionne). Cliquez sur le bouton pour ouvrir la boîte de dialogue permettant de sélectionner le répertoire d'enregistrement principal. + La valeur actuelle du répertoire principal d'enregistrement. La valeur choisie doit exister et être inscriptible (permettre la création de sous-répertoires par l'utilisateur sous lequel Jamulus fonctionne). Cliquez sur le bouton pour ouvrir la boîte de dialogue permettant de sélectionner le répertoire d'enregistrement principal. Clear the recording directory button - Effacer le bouton du répertoire d'enregistrement + Effacer le bouton du répertoire d'enregistrement @@ -2680,7 +2698,7 @@ Click the button to clear the currently selected recording directory. This will prevent recording until a new value is selected. - Cliquez sur le bouton pour effacer le répertoire d'enregistrement actuellement sélectionné. Cela empêchera l'enregistrement jusqu'à ce qu'une nouvelle valeur soit sélectionnée. + Cliquez sur le bouton pour effacer le répertoire d'enregistrement actuellement sélectionné. Cela empêchera l'enregistrement jusqu'à ce qu'une nouvelle valeur soit sélectionnée. @@ -2725,32 +2743,32 @@ Displays the current status of the recorder. The following values are possible: - Affiche l'état actuel de l'enregistreur. Les valeurs suivantes sont possibles : + Affiche l'état actuel de l'enregistreur. Les valeurs suivantes sont possibles : No recording directory has been set or the value is not useable - Aucun répertoire d'enregistrement n'a été défini ou la valeur n'est pas utilisable + Aucun répertoire d'enregistrement n'a été défini ou la valeur n'est pas utilisable Recording has been switched off - L'enregistrement a été désactivé + L'enregistrement a été désactivé by the UI checkbox - par la case à cocher de l'interface graphique + par la case à cocher de l'interface graphique , either by the UI checkbox or SIGUSR2 being received - , soit en cochant la case de l'interface graphique ou en recevant SIGUSR2 + , soit en cochant la case de l'interface graphique ou en recevant SIGUSR2 There is no one connected to the server to record - Il n'y a personne connecté au serveur pour enregistrer + Il n'y a personne connecté au serveur pour enregistrer @@ -2765,7 +2783,7 @@ If the recording directory is not useable, the problem will be displayed in place of the directory. - Si le répertoire d'enregistrement n'est pas utilisable, le problème sera affiché à la place du répertoire. + Si le répertoire d'enregistrement n'est pas utilisable, le problème sera affiché à la place du répertoire. @@ -2872,52 +2890,52 @@ &Fenêtre - + Unregistered Non inscrit - + Bad address Mauvaise adresse - + Registration requested Inscription demandée - + Registration failed Échec de l'inscription - + Check server version Vérifier la version du serveur - + Registered Inscrit - + Central Server full Serveur central rempli - + Your server version is too old La version de votre serveur est trop vieille - + Requirements not fulfilled Exigences non satisfaites - + Unknown value Valeur inconnue @@ -2979,7 +2997,7 @@ Enable Jam Recorder - Activer l'enregistreur de bœuf + Activer l'enregistreur de bœuf @@ -3209,17 +3227,17 @@ QCoreApplication - + , Version , version - + Internet Jam Session Software Logiciel de bœuf sur Internet - + Released under the GNU General Public License (GPL) Publié sous la licence publique générale GNU (GPL) diff --git a/src/res/translation/translation_it_IT.ts b/src/res/translation/translation_it_IT.ts index 86e3e67e..79c5d4eb 100644 --- a/src/res/translation/translation_it_IT.ts +++ b/src/res/translation/translation_it_IT.ts @@ -1576,23 +1576,23 @@ Compatto - + preferred consigliato - - + + Size: Livello: - + Buffer Delay Buffer Delay - + Buffer Delay: Buffer Delay: @@ -1601,47 +1601,47 @@ Indirizzo Preferito - + The selected audio device could not be used because of the following error: La scheda audio selezionata non può essere usata per i seguenti motivi: - + The previous driver will be selected. Sarà ripristinato il driver precedentemente usato. - + Ok Ok - + Custom Personalizzato - + All Genres Tutti i Generi - + Genre Rock Genere Rock - + Genre Jazz Genere Jazz - + Genre Classical/Folk/Choir Genere Classica/Folk/Corale - + Default Default @@ -1767,7 +1767,12 @@ Vista - + + Language + + + + % % @@ -1776,12 +1781,12 @@ Tema Fantasia - + Display Channel Levels Visualizza Livelli Canali - + Custom Central Server Address: Indirizzo Server Centrale alternativo: @@ -1790,24 +1795,24 @@ Indirizzo Server Centrale: - + Audio Stream Rate Velocità dello Streaming - - - + + + val val - + Ping Time Ping - + Overall Delay Overall Delay @@ -2007,6 +2012,19 @@ I&nformazioni su... + + CLanguageComboBox + + + Restart Required + + + + + Please restart the application for the language change to take effect. + + + CLicenceDlg @@ -2151,7 +2169,7 @@ - + None None @@ -2218,212 +2236,212 @@ Livello di Abilità - + Drum Set Batteria - + Djembe Djembe - + Electric Guitar Chitarra elettrica - + Acoustic Guitar Chitarra Acustica - + Bass Guitar Basso Elettrico - + Keyboard Tastiera - + Synthesizer Sintetizzatore - + Grand Piano Grand Piano - + Accordion Fisarmonica - + Vocal Voce - + Microphone Microfono - + Harmonica Armonica - + Trumpet Tromba - + Trombone Trombone - + French Horn Corno Francese - + Tuba Tuba - + Saxophone Sassofono - + Clarinet Clarinet - + Flute Flauto - + Violin Violino - + Cello Cello - + Double Bass Contrabbasso - + Recorder Recorder - + Streamer Streamer - + Listener Ascoltatore - + Guitar+Vocal Chitarra+Voce - + Keyboard+Vocal Tastiera+Voce - + Bodhran Bodhran - + Bassoon Fagotto - + Oboe Oboe - + Harp Arpa - + Viola Viola - + Congas Congas - + Bongo Bongo - + Vocal Bass Voce Basso - + Vocal Tenor Voce Tenore - + Vocal Alto Voce Alto - + Vocal Soprano Voce Soprano - + Banjo Banjo - + Mandolin Mandolino - + Ukulele Uculele - + Bass Ukulele Uculele Basso @@ -2820,52 +2838,52 @@ Non Abilitata - + Unregistered Non registrato - + Bad address Indirizzo Errato - + Registration requested Registrazione richiesta - + Registration failed Registrazione fallita - + Check server version Controlla Versione server - + Registered Registrato - + Central Server full Server Centrale Pieno - + Your server version is too old - + Requirements not fulfilled - + Unknown value Valore sconosciuto @@ -3157,17 +3175,17 @@ QCoreApplication - + , Version Versione, Versione - + Internet Jam Session Software Programma per Jam Session su Internet - + Released under the GNU General Public License (GPL) Rilasciato sotto licensa GNU General Public License (GPL) diff --git a/src/res/translation/translation_nl_NL.ts b/src/res/translation/translation_nl_NL.ts index da2ed210..cce637e9 100644 --- a/src/res/translation/translation_nl_NL.ts +++ b/src/res/translation/translation_nl_NL.ts @@ -1564,32 +1564,32 @@ Handmatig - + Custom Aangepast - + All Genres Alle genres - + Genre Rock Genre Rock - + Genre Jazz Genre Jazz - + Genre Classical/Folk/Choir Genre Klassiek/Folk/Zang - + Default Standaard @@ -1598,38 +1598,38 @@ Standaard (Noord-Amerika) - + preferred gewenst - - + + Size: Size: - + Buffer Delay Buffervertraging - + Buffer Delay: Buffervertraging: - + The selected audio device could not be used because of the following error: Het geselecteerde audioapparaat kon niet worden gebruikt vanwege de volgende fout: - + The previous driver will be selected. Het vorige stuurprogramma wordt geselecteerd. - + Ok Ok @@ -1755,7 +1755,12 @@ Skin - + + Language + + + + % % @@ -1764,12 +1769,12 @@ Fancy Skin - + Display Channel Levels Weergave Kanaalniveaus - + Custom Central Server Address: Eigen centrale serveradres: @@ -1778,24 +1783,24 @@ Centraal Serveradres: - + Audio Stream Rate Audio Stream Rate - - - + + + val val - + Ping Time Ping-tijd - + Overall Delay Algehele vertraging @@ -1995,6 +2000,19 @@ &Over... + + CLanguageComboBox + + + Restart Required + + + + + Please restart the application for the language change to take effect. + + + CLicenceDlg @@ -2139,7 +2157,7 @@ - + None Geen @@ -2206,212 +2224,212 @@ Combo-box voor vaardigheidsniveau - + Drum Set Drumstel - + Djembe Djembe - + Electric Guitar Elektrische Gitaar - + Acoustic Guitar Akoestische Gitaar - + Bass Guitar Basgitaar - + Keyboard Toetsenbord - + Synthesizer Synthesizer - + Grand Piano Piano - + Accordion Accordeon - + Vocal Vocaal - + Microphone Microfoon - + Harmonica Harmonica - + Trumpet Trompet - + Trombone Trombone - + French Horn Hoorn - + Tuba Tuba - + Saxophone Saxofoon - + Clarinet Klarinet - + Flute Fluit - + Violin Viool - + Cello Cello - + Double Bass Contrabas - + Recorder Opnemer - + Streamer Streamer - + Listener Luisteraar - + Guitar+Vocal Gitaar+Vocaal - + Keyboard+Vocal Toetsenbord+Vocaal - + Bodhran Bodhran - + Bassoon Fagot - + Oboe Hobo - + Harp Harp - + Viola Viola - + Congas Congas - + Bongo Bongo - + Vocal Bass Bas (stem) - + Vocal Tenor Tenor (stem) - + Vocal Alto Alt (stem) - + Vocal Soprano Sopraan (stem) - + Banjo Banjo - + Mandolin Mandoline - + Ukulele Ukelele - + Bass Ukulele Ukelele-bas @@ -2820,52 +2838,52 @@ &Window - + Unregistered Niet geregistreerd - + Bad address Slecht adres - + Registration requested Aanmelding gevraagd - + Registration failed Registratie is mislukt - + Check server version Controleer de versie van de server - + Registered Geregistreerd - + Central Server full Centrale server vol - + Your server version is too old Je serverversie is te oud - + Requirements not fulfilled Vereisten niet gehaald - + Unknown value Onbekende waarde @@ -3157,17 +3175,17 @@ QCoreApplication - + , Version , Versie - + Internet Jam Session Software Internet Jamsessie Software - + Released under the GNU General Public License (GPL) Gereleased onder de GNU General Public License (GPL) diff --git a/src/res/translation/translation_pl_PL.ts b/src/res/translation/translation_pl_PL.ts index 7100c02f..a99f40c5 100644 --- a/src/res/translation/translation_pl_PL.ts +++ b/src/res/translation/translation_pl_PL.ts @@ -1299,68 +1299,68 @@ nie jestem pewna - + Custom - + All Genres - + Genre Rock - + Genre Jazz - + Genre Classical/Folk/Choir - + Default - + preferred - - + + Size: - + Buffer Delay Opóźnienie bufora - + Buffer Delay: - + The selected audio device could not be used because of the following error: - + The previous driver will be selected. - + Ok Ok @@ -1487,7 +1487,12 @@ nie jestem pewna - + + Language + + + + % % @@ -1496,34 +1501,34 @@ nie jestem pewna Wuszukany wygąd - + Display Channel Levels Wyświetlaj poziomy kanały - + Custom Central Server Address: Własny adres serwera centralnego: - + Audio Stream Rate Prędkość strumienia audio - - - + + + val wartość - + Ping Time Czas odpowiedzi - + Overall Delay Opóźnienie całkowite @@ -1703,6 +1708,19 @@ nie jestem pewna &O programie... + + CLanguageComboBox + + + Restart Required + + + + + Please restart the application for the language change to take effect. + + + CLicenceDlg @@ -1847,7 +1865,7 @@ nie jestem pewna - + None *nie jestem pewna Żaden @@ -1903,213 +1921,213 @@ nie jestem pewna - + Drum Set Zestaw perkusyjny - + Djembe Djembe - + Electric Guitar Gitara elektryczna - + Acoustic Guitar Gitara akustyczna - + Bass Guitar Gitara basowa - + Keyboard Keyboard - + Synthesizer Syntezator - + Grand Piano Fortepian - + Accordion Akordeon - + Vocal Wokal - + Microphone Mikrofon - + Harmonica Harmonijka ustna - + Trumpet Trąbka - + Trombone Puzon - + French Horn Waltornia - + Tuba Tuba - + Saxophone Saksofon - + Clarinet Klarnet - + Flute Flet - + Violin Skrzypce - + Cello Wiolonczela - + Double Bass Kontrabas - + Recorder *nie wiem Flet prosty - + Streamer Streamer - + Listener Słuchacz - + Guitar+Vocal Gitara+Wokal - + Keyboard+Vocal Keyboard+Wokal - + Bodhran Bodhran - + Bassoon Fagot - + Oboe Obój - + Harp Harfa - + Viola Altówka - + Congas Kongi - + Bongo Bongo - + Vocal Bass Bas - + Vocal Tenor Tenor - + Vocal Alto Alt - + Vocal Soprano Sopran - + Banjo Banjo - + Mandolin Mandolina - + Ukulele Ukulele - + Bass Ukulele Ukulele basowe @@ -2446,52 +2464,52 @@ nie jestem pewna - + Unregistered - + Bad address - + Registration requested - + Registration failed - + Check server version - + Registered - + Central Server full - + Your server version is too old - + Requirements not fulfilled - + Unknown value @@ -2800,17 +2818,17 @@ nie jestem pewna QCoreApplication - + , Version - + Internet Jam Session Software - + Released under the GNU General Public License (GPL) diff --git a/src/res/translation/translation_pt_BR.ts b/src/res/translation/translation_pt_BR.ts index 645daf60..b8b8ec4e 100644 --- a/src/res/translation/translation_pt_BR.ts +++ b/src/res/translation/translation_pt_BR.ts @@ -1598,22 +1598,22 @@ Manual - + Custom Personalizado - + All Genres Servidor Geral - + Genre Rock Servidor Rock - + Genre Jazz Servidor Jazz @@ -1622,12 +1622,12 @@ Servidor Rock/Jazz - + Genre Classical/Folk/Choir Serv. Clássica/Folclore/Coro - + Default Servidor Padrão @@ -1636,38 +1636,38 @@ Servidor Padrão (America do Norte) - + preferred preferido - - + + Size: Tamanho: - + Buffer Delay Atraso do buffer - + Buffer Delay: Atraso do buffer: - + The selected audio device could not be used because of the following error: O dispositivo de áudio selecionado não pôde ser usado devido ao seguinte erro: - + The previous driver will be selected. O driver anterior será selecionado. - + Ok Ok @@ -1793,7 +1793,12 @@ Aparência - + + Language + + + + % % @@ -1802,12 +1807,12 @@ Skin Sofisticada - + Display Channel Levels Mostrar Níveis de Canais - + Custom Central Server Address: Endereço do Servidor Central Personalizado: @@ -1816,24 +1821,24 @@ Endereço do Servidor Central: - + Audio Stream Rate Taxa de Transmissão de Áudio - - - + + + val val - + Ping Time Latência da Ligação - + Overall Delay Latência Geral @@ -2033,6 +2038,19 @@ &Sobre... + + CLanguageComboBox + + + Restart Required + + + + + Please restart the application for the language change to take effect. + + + CLicenceDlg @@ -2170,7 +2188,7 @@ - + None Nenhum @@ -2244,212 +2262,212 @@ O que definir aqui aparecerá abaixo do seu fader no mixer quando estiver conectado a um servidor Jamulus. Esta etiqueta também será exibida em cada cliente que estiver conectado ao mesmo servidor. - + Drum Set Bateria - + Djembe Djembe - + Electric Guitar Guitarra Elétrica - + Acoustic Guitar Guitarra Acústica - + Bass Guitar Baixo - + Keyboard Teclado - + Synthesizer Sintetizador - + Grand Piano Piano de Cauda - + Accordion Acordeão - + Vocal Voz - + Microphone Microfone - + Harmonica Harmónica - + Trumpet Trompete - + Trombone Trombone - + French Horn Trompa Francesa - + Tuba Tuba - + Saxophone Saxofone - + Clarinet Clarinete - + Flute Flauta - + Violin Violino - + Cello Violoncelo - + Double Bass Contrabaixo - + Recorder Gravador - + Streamer Streamer - + Listener Ouvinte - + Guitar+Vocal Guitarra+Voz - + Keyboard+Vocal Teclado+Voz - + Bodhran Bodhrán - + Bassoon Fagote - + Oboe Oboé - + Harp Harpa - + Viola Viola de Arco - + Congas Congas - + Bongo Bongo - + Vocal Bass Voz Baixo - + Vocal Tenor Voz Tenor - + Vocal Alto Voz Alto - + Vocal Soprano Voz Soprano - + Banjo Banjo - + Mandolin Bandolim - + Ukulele Ukulele - + Bass Ukulele Ukulele Baixo @@ -2858,52 +2876,52 @@ &Janela - + Unregistered Não Registrado - + Bad address Endereço incorreto - + Registration requested Registro solicitado - + Registration failed Falha no registro - + Check server version Verifique versão do servidor - + Registered Registrado - + Central Server full Servidor Central Cheio - + Your server version is too old - + Requirements not fulfilled - + Unknown value Valor desconhecido @@ -3195,17 +3213,17 @@ QCoreApplication - + , Version , Versão - + Internet Jam Session Software Programa de Jam Sessions pela Internet - + Released under the GNU General Public License (GPL) Lançado sob a Licença Pública Geral GNU (GPL) diff --git a/src/res/translation/translation_pt_PT.ts b/src/res/translation/translation_pt_PT.ts index fbe98519..c2e15306 100644 --- a/src/res/translation/translation_pt_PT.ts +++ b/src/res/translation/translation_pt_PT.ts @@ -1596,22 +1596,22 @@ Manual - + Custom Personalizado - + All Genres Servidor Geral - + Genre Rock Servidor Rock - + Genre Jazz Servidor Jazz @@ -1620,12 +1620,12 @@ Servidor Rock/Jazz - + Genre Classical/Folk/Choir Serv. Clássica/Folclore/Coro - + Default Servidor Padrão @@ -1634,38 +1634,38 @@ Servidor Padrão (America do Norte) - + preferred preferido - - + + Size: Tamanho: - + Buffer Delay Atraso do buffer - + Buffer Delay: Atraso do buffer: - + The selected audio device could not be used because of the following error: O dispositivo de áudio selecionado não pôde ser usado devido ao seguinte erro: - + The previous driver will be selected. O driver anterior será selecionado. - + Ok Ok @@ -1791,7 +1791,12 @@ Tema - + + Language + + + + % % @@ -1800,12 +1805,12 @@ Skin Sofisticada - + Display Channel Levels Mostrar Níveis de Canais - + Custom Central Server Address: Endereço do Servidor Central Personalizado: @@ -1814,24 +1819,24 @@ Endereço do Servidor Central: - + Audio Stream Rate Taxa de Transmissão de Áudio - - - + + + val val - + Ping Time Latência da Ligação - + Overall Delay Latência Geral @@ -2031,6 +2036,19 @@ &Sobre... + + CLanguageComboBox + + + Restart Required + + + + + Please restart the application for the language change to take effect. + + + CLicenceDlg @@ -2168,7 +2186,7 @@ - + None Nenhum @@ -2242,212 +2260,212 @@ O que definir aqui aparecerá por baixo do seu fader na secção de mistura quando estiver ligado a um servidor Esta etiqueta também será exibida em cada cliente que estiver ligado ao mesmo servidor. - + Drum Set Bateria - + Djembe Djembe - + Electric Guitar Guitarra Elétrica - + Acoustic Guitar Guitarra Acústica - + Bass Guitar Baixo - + Keyboard Teclado - + Synthesizer Sintetizador - + Grand Piano Piano de Cauda - + Accordion Acordeão - + Vocal Voz - + Microphone Microfone - + Harmonica Harmónica - + Trumpet Trompete - + Trombone Trombone - + French Horn Trompa Francesa - + Tuba Tuba - + Saxophone Saxofone - + Clarinet Clarinete - + Flute Flauta - + Violin Violino - + Cello Violoncelo - + Double Bass Contrabaixo - + Recorder Gravador - + Streamer Streamer - + Listener Ouvinte - + Guitar+Vocal Guitarra+Voz - + Keyboard+Vocal Teclado+Voz - + Bodhran Bodhrán - + Bassoon Fagote - + Oboe Oboé - + Harp Harpa - + Viola Viola de Arco - + Congas Congas - + Bongo Bongo - + Vocal Bass Voz Baixo - + Vocal Tenor Voz Tenor - + Vocal Alto Voz Alto - + Vocal Soprano Voz Soprano - + Banjo Banjo - + Mandolin Bandolim - + Ukulele Ukulele - + Bass Ukulele Ukulele Baixo @@ -2856,52 +2874,52 @@ &Janela - + Unregistered Não Registado - + Bad address Endereço incorrecto - + Registration requested Registo solicitado - + Registration failed Falha no registo - + Check server version Verifique versão do servidor - + Registered Registado - + Central Server full Servidor Central Cheio - + Your server version is too old A versão do seu servidor é muito antiga - + Requirements not fulfilled Requisitos não cumpridos - + Unknown value Valor desconhecido @@ -3193,17 +3211,17 @@ QCoreApplication - + , Version , Versão - + Internet Jam Session Software Programa de Jam Sessions pela Internet - + Released under the GNU General Public License (GPL) Lançado sob a Licença Pública Geral GNU (GPL) diff --git a/src/res/translation/translation_sv_SE.ts b/src/res/translation/translation_sv_SE.ts index a200e6b9..d482b865 100644 --- a/src/res/translation/translation_sv_SE.ts +++ b/src/res/translation/translation_sv_SE.ts @@ -1288,68 +1288,68 @@ - + preferred - - + + Size: - + Buffer Delay - + Buffer Delay: - + The selected audio device could not be used because of the following error: - + The previous driver will be selected. - + Ok - + Custom - + All Genres - + Genre Rock - + Genre Jazz - + Genre Classical/Folk/Choir - + Default @@ -1475,39 +1475,44 @@ - + + Language + + + + % - + Display Channel Levels - + Custom Central Server Address: - + Audio Stream Rate - - - + + + val - + Ping Time - + Overall Delay @@ -1687,6 +1692,19 @@ + + CLanguageComboBox + + + Restart Required + + + + + Please restart the application for the language change to take effect. + + + CLicenceDlg @@ -1836,7 +1854,7 @@ - + None @@ -1891,212 +1909,212 @@ - + Drum Set - + Djembe - + Electric Guitar - + Acoustic Guitar - + Bass Guitar - + Keyboard - + Synthesizer - + Grand Piano - + Accordion - + Vocal - + Microphone - + Harmonica - + Trumpet - + Trombone - + French Horn - + Tuba - + Saxophone - + Clarinet - + Flute - + Violin - + Cello - + Double Bass - + Recorder - + Streamer - + Listener - + Guitar+Vocal - + Keyboard+Vocal - + Bodhran - + Bassoon - + Oboe - + Harp - + Viola - + Congas - + Bongo - + Vocal Bass - + Vocal Tenor - + Vocal Alto - + Vocal Soprano - + Banjo - + Mandolin - + Ukulele - + Bass Ukulele @@ -2428,52 +2446,52 @@ - + Unregistered - + Bad address - + Registration requested - + Registration failed - + Check server version - + Registered - + Central Server full - + Your server version is too old - + Requirements not fulfilled - + Unknown value @@ -2769,17 +2787,17 @@ QCoreApplication - + , Version - + Internet Jam Session Software - + Released under the GNU General Public License (GPL) diff --git a/src/settings.h b/src/settings.h index a4d1adac..4884c5f9 100755 --- a/src/settings.h +++ b/src/settings.h @@ -39,11 +39,16 @@ class CSettings { public: - CSettings() : strFileName ( "" ) {} + CSettings() : + strLanguage ( "" ), + strFileName ( "" ) {} void Load(); void Save(); + // common settings + QString strLanguage; + protected: virtual void ReadFromXML ( const QDomDocument& IniXMLDocument ) = 0; virtual void WriteToXML ( QDomDocument& IniXMLDocument ) = 0; @@ -111,6 +116,7 @@ class CClientSettings : public CSettings { public: CClientSettings ( CClient* pNCliP, const QString& sNFiName ) : + CSettings ( ), vecStoredFaderTags ( MAX_NUM_STORED_FADER_SETTINGS, "" ), vecStoredFaderLevels ( MAX_NUM_STORED_FADER_SETTINGS, AUD_MIX_FADER_MAX ), vecStoredPanValues ( MAX_NUM_STORED_FADER_SETTINGS, AUD_MIX_PAN_MAX / 2 ), @@ -120,7 +126,6 @@ public: vstrIPAddress ( MAX_NUM_SERVER_ADDR_ITEMS, "" ), iNewClientFaderLevel ( 100 ), bConnectDlgShowAllMusicians ( true ), - strLanguage ( "" ), vecWindowPosMain ( ), // empty array vecWindowPosSettings ( ), // empty array vecWindowPosChat ( ), // empty array @@ -133,6 +138,7 @@ public: pClient ( pNCliP ) { SetFileName ( sNFiName, DEFAULT_INI_FILE_NAME ); } + // general settings CVector vecStoredFaderTags; CVector vecStoredFaderLevels; CVector vecStoredPanValues; @@ -142,7 +148,6 @@ public: CVector vstrIPAddress; int iNewClientFaderLevel; bool bConnectDlgShowAllMusicians; - QString strLanguage; // window position/state settings QByteArray vecWindowPosMain; @@ -167,13 +172,11 @@ class CServerSettings : public CSettings { public: CServerSettings ( CServer* pNSerP, const QString& sNFiName ) : - strLanguage ( "" ), + CSettings ( ), vecWindowPosMain ( ), // empty array pServer ( pNSerP ) { SetFileName ( sNFiName, DEFAULT_INI_FILE_NAME_SERVER); } - QString strLanguage; - // window position/state settings QByteArray vecWindowPosMain; diff --git a/src/util.cpp b/src/util.cpp index 4c38900f..d1b68b35 100755 --- a/src/util.cpp +++ b/src/util.cpp @@ -882,6 +882,71 @@ CHelpMenu::CHelpMenu ( const bool bIsClient, QWidget* parent ) : QMenu ( tr ( "& addSeparator(); addAction ( tr ( "&About..." ), this, SLOT ( OnHelpAbout() ) ); } + + +// Language combo box ---------------------------------------------------------- +CLanguageComboBox::CLanguageComboBox ( QWidget* parent ) : + QComboBox ( parent ), + iIdxSelectedLanguage ( INVALID_INDEX ) +{ + QObject::connect ( this, static_cast ( &QComboBox::activated ), + this, &CLanguageComboBox::OnLanguageActivated ); +} + +void CLanguageComboBox::Init ( QString& strSelLanguage ) +{ + // load available translations + const QMap TranslMap = CLocale::GetAvailableTranslations(); + QMapIterator MapIter ( TranslMap ); + + // add translations to the combobox list + clear(); + int iCnt = 0; + int iIdxOfEnglishLanguage = 0; + iIdxSelectedLanguage = INVALID_INDEX; + + while ( MapIter.hasNext() ) + { + MapIter.next(); + addItem ( QLocale ( MapIter.key() ).nativeLanguageName() + " (" + MapIter.key() + ")", MapIter.key() ); + + // store the combo box index of the default english language + if ( MapIter.key().compare ( "en" ) == 0 ) + { + iIdxOfEnglishLanguage = iCnt; + } + + // if the selected language is found, store the combo box index + if ( MapIter.key().compare ( strSelLanguage ) == 0 ) + { + iIdxSelectedLanguage = iCnt; + } + + iCnt++; + } + + // if the selected language was not found, use the english language + if ( iIdxSelectedLanguage == INVALID_INDEX ) + { + strSelLanguage = "en"; + iIdxSelectedLanguage = iIdxOfEnglishLanguage; + } + + setCurrentIndex ( iIdxSelectedLanguage ); +} + +void CLanguageComboBox::OnLanguageActivated ( int iLanguageIdx ) +{ + // only update if the language selection is different from the current selected language + if ( iIdxSelectedLanguage != iLanguageIdx ) + { + QMessageBox::information ( this, + tr ( "Restart Required" ), + tr ( "Please restart the application for the language change to take effect." ) ); + + emit LanguageChanged ( itemData ( iLanguageIdx ).toString() ); + } +} #endif @@ -1380,6 +1445,9 @@ QMap CLocale::GetAvailableTranslations() QMap TranslMap; QDirIterator DirIter ( ":/translations" ); + // add english language (default which is in the actual source code) + TranslMap["en"] = ""; // empty file name means that the translation load fails and we get the default english language + while ( DirIter.hasNext() ) { // get alias of translation file @@ -1408,6 +1476,9 @@ QPair CLocale::FindSysLangTransFileName ( const QMap= 2 ) { + +// TODO maybe first try to find the complete string, if not found use only first two letters instead + PairSysLang.first = strUiLang.left ( 2 ); PairSysLang.second = TranslMap[PairSysLang.first]; } diff --git a/src/util.h b/src/util.h index 177202f8..841518a1 100755 --- a/src/util.h +++ b/src/util.h @@ -423,7 +423,6 @@ class CAboutDlg : public QDialog, private Ui_CAboutDlgBase public: CAboutDlg ( QWidget* parent = nullptr ); - }; @@ -491,8 +490,29 @@ public slots: void OnHelpSoftwareMan() { QDesktopServices::openUrl ( QUrl ( SOFTWARE_MANUAL_URL ) ); } }; + +// Language combo box ---------------------------------------------------------- +class CLanguageComboBox : public QComboBox +{ + Q_OBJECT + +public: + CLanguageComboBox ( QWidget* parent = nullptr ); + + void Init ( QString& strSelLanguage ); + +protected: + int iIdxSelectedLanguage; + +public slots: + void OnLanguageActivated ( int iLanguageIdx ); + +signals: + void LanguageChanged ( QString strLanguage ); +}; #endif + // Console writer factory ------------------------------------------------------ // this class was written by pljones class ConsoleWriterFactory