From e19c613dba5de735c50fe82b16d9d3628f057305 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Thu, 29 Sep 2022 14:27:30 -0400 Subject: [PATCH] 2022-09-29 Fred Gleason * Fixed a bug in the i18n system that would throw warnings when attempting to load the (non-existent) English translation. Signed-off-by: Fred Gleason --- ChangeLog | 3 +++ lib/rdtranslator.cpp | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 988258b2..b14c290d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23419,3 +23419,6 @@ * Fixed a regression in rdairplay(1) that caused a segfault when selecting a cart in the 'Select Cart' dialog if the Cue output assignment was disabled. +2022-09-29 Fred Gleason + * Fixed a bug in the i18n system that would throw warnings when + attempting to load the (non-existent) English translation. diff --git a/lib/rdtranslator.cpp b/lib/rdtranslator.cpp index 23dbd314..36dff741 100644 --- a/lib/rdtranslator.cpp +++ b/lib/rdtranslator.cpp @@ -31,10 +31,12 @@ RDTranslator::RDTranslator(const QString &cmdname,QObject *parent) d_command_name=cmdname; QString loc=RDApplication::locale().left(2)+".qm"; - LoadTranslation("qt_"+loc,"/usr/share/qt5/translations"); - LoadTranslation("librd_"+loc,"/usr/share/rivendell"); - LoadTranslation("rdhpi_"+loc,"/usr/share/rivendell"); - LoadTranslation(d_command_name+"_"+loc,"/usr/share/rivendell"); + if(loc.left(2)!="en") { // There are no English translations + LoadTranslation("qt_"+loc,"/usr/share/qt5/translations"); + LoadTranslation("librd_"+loc,"/usr/share/rivendell"); + LoadTranslation("rdhpi_"+loc,"/usr/share/rivendell"); + LoadTranslation(d_command_name+"_"+loc,"/usr/share/rivendell"); + } }