From 55fc3d99ae7d1657d469b8fd2ae7e32781c3cab3 Mon Sep 17 00:00:00 2001
From: James Turner <james@flightgear.org>
Date: Sun, 1 Nov 2020 11:06:42 +0000
Subject: [PATCH] Launcher: fix selection of English language

Due to the file naming, we would not pick English (even if it was
the first UI language), if the active region was not US.

Ticket-Id: https://sourceforge.net/p/flightgear/codetickets/2406/
---
 CMakeModules/Translations.cmake | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/CMakeModules/Translations.cmake b/CMakeModules/Translations.cmake
index 7802ad5cf..7d91ad668 100644
--- a/CMakeModules/Translations.cmake
+++ b/CMakeModules/Translations.cmake
@@ -64,8 +64,16 @@ if (${do_translate})
 
         add_dependencies(fgfs_qm_files fgfs_${LANG}_qm)
 
-        # local path needed here, not absolute
-        file(APPEND ${translation_res} "<file>FlightGear_${LANG}.qm</file>\n")
+        # fix for bug https://sourceforge.net/p/flightgear/codetickets/2406/
+        # ensure we expose the English translations in a 'short' form, so that
+        # the QTranslator search order finds it
+        if (${LANG} STREQUAL "en_US")
+            message(STATUS "Wibble")
+            file(APPEND ${translation_res} "<file alias=\"FlightGear_en.qm\">FlightGear_${LANG}.qm</file>\n")
+        else()
+            # local path needed here, not absolute
+            file(APPEND ${translation_res} "<file>FlightGear_${LANG}.qm</file>\n")
+        endif()
     endforeach()
 
     file(APPEND ${translation_res} "</qresource>\n</RCC>")