Localization: Also collect first line of credits.csv
authorWuzzy <Wuzzy2@mail.ru>
Fri, 21 Dec 2018 20:48:28 +0100
changeset 14497 34fd1f32f440
parent 14496 8db03d9bc6e9
child 14498 df86be1bdbeb
Localization: Also collect first line of credits.csv
QTfrontend/CMakeLists.txt
--- a/QTfrontend/CMakeLists.txt	Fri Dec 21 20:31:21 2018 +0100
+++ b/QTfrontend/CMakeLists.txt	Fri Dec 21 20:48:28 2018 +0100
@@ -49,7 +49,15 @@
 # Credits localization
 file(GLOB CreditsCSV ${CMAKE_SOURCE_DIR}/QTfrontend/res/credits.csv)
 foreach(csvfile ${CreditsCSV})
+    # Load credits.csv
     file(READ ${csvfile} csv)
+
+    # Match first line of CSV file
+    string(REGEX MATCH "(E|S|U),\"[^\n\"]+\"" loc_top ${csv})
+    string(REGEX REPLACE "(E|S|U),\"([^\n\"]+)\"" "\nQT_TRANSLATE_NOOP(\"credits\", \"\\2\")" s ${loc_top})
+    list(APPEND csvlocs ${s})
+
+    # Match remaining lines of CSV file
     string(REGEX MATCHALL "\n(E|S|U),\"[^\n\"]+\"" locs ${csv})
     foreach(str ${locs})
         string(REGEX REPLACE "(E|S|U),\"([^\n\"]+)\"" "QT_TRANSLATE_NOOP(\"credits\", \"\\2\")" s ${str})