fixed translations being updated twice at the same time, that's bad

Sun, 03 Nov 2019 13:07:04 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Sun, 03 Nov 2019 13:07:04 +0200
changeset 10
e249d97c7fe6
parent 9
8b9780700b5e
child 11
771168ee2c76

fixed translations being updated twice at the same time, that's bad

CMakeLists.txt file | annotate | diff | comparison | revisions
languages.qrc file | annotate | diff | comparison | revisions
locale/fi.ts file | annotate | diff | comparison | revisions
--- a/CMakeLists.txt	Sun Nov 03 12:56:42 2019 +0200
+++ b/CMakeLists.txt	Sun Nov 03 13:07:04 2019 +0200
@@ -80,7 +80,7 @@
 # Translations
 qt5_create_translation(QM_FILES ${LDFORGE_SOURCES} ${LDFORGE_HEADERS} ${LDFORGE_FORMS} ${LDFORGE_LOCALES})
 add_custom_target(translations ALL DEPENDS ${QM_FILES})
-add_custom_target(resources ALL DEPENDS ${RESOURCE_FILES})
+add_custom_target(resources ALL DEPENDS ${LDFORGE_RESOURCES})
 add_dependencies(resources translations)
 
 set(CMAKE_CXX_STANDARD 17)
@@ -103,8 +103,9 @@
 # Move languages.qrc into the build directory to bake the .qm-files into LDForge
 # so that they don't have to be shipped separately
 # https://stackoverflow.com/a/34798124
+# https://gist.github.com/giraldeau/546ba5512a74dfe9d8ea0862d66db412
 set(LANGUAGES_QRC "languages.qrc")
-configure_file(${LANGUAGES_QRC} ${LANGUAGES_QRC} COPYONLY)
+configure_file(${LANGUAGES_QRC} ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
 qt5_add_resources(LDFORGE_QM_RC_FILE ${CMAKE_CURRENT_BINARY_DIR}/${LANGUAGES_QRC})
 
 add_executable(ldforge WIN32
--- a/languages.qrc	Sun Nov 03 12:56:42 2019 +0200
+++ b/languages.qrc	Sun Nov 03 13:07:04 2019 +0200
@@ -1,7 +1,6 @@
 <RCC>
     <qresource prefix="/locale">
         <file>fi.qm</file>
-        <file>ru.qm</file>
         <file>sv.qm</file>
     </qresource>
 </RCC>
--- a/locale/fi.ts	Sun Nov 03 12:56:42 2019 +0200
+++ b/locale/fi.ts	Sun Nov 03 13:07:04 2019 +0200
@@ -1,10 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
-<TS version="2.1">
+<TS version="2.1" language="fi">
 <context>
     <name>Document</name>
     <message>
-        <location filename="../src/document.ui" line="14"/>
         <source>Form</source>
         <translation type="unfinished"></translation>
     </message>
@@ -12,62 +11,50 @@
 <context>
     <name>LibrariesEditor</name>
     <message>
-        <location filename="../src/settingseditor/librarieseditor.ui" line="14"/>
         <source>Form</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingseditor/librarieseditor.ui" line="25"/>
         <source>…</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingseditor/librarieseditor.ui" line="32"/>
         <source>Add</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingseditor/librarieseditor.cpp" line="39"/>
         <source>Browse LDraw library</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingseditor/librarieseditor.cpp" line="52"/>
         <source>Library does not exist</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingseditor/librarieseditor.cpp" line="54"/>
         <source>The directory %1 does not exist.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingseditor/librarieseditor.cpp" line="62"/>
         <source>Unreadable library</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingseditor/librarieseditor.cpp" line="64"/>
         <source>The directory %1 cannot be read.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingseditor/librarieseditor.cpp" line="78"/>
         <source>Remove library</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingseditor/librarieseditor.cpp" line="84"/>
         <source>Set role</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingseditor/librarieseditor.cpp" line="96"/>
         <source>Move up</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingseditor/librarieseditor.cpp" line="102"/>
         <source>Move down</source>
         <translation type="unfinished"></translation>
     </message>
@@ -75,27 +62,22 @@
 <context>
     <name>LibraryManager</name>
     <message>
-        <location filename="../src/libraries.cpp" line="202"/>
         <source>Official library</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/libraries.cpp" line="204"/>
         <source>Unofficial library</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/libraries.cpp" line="206"/>
         <source>Working library</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/libraries.cpp" line="266"/>
         <source>Path</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/libraries.cpp" line="268"/>
         <source>Role</source>
         <translation type="unfinished"></translation>
     </message>
@@ -103,101 +85,85 @@
 <context>
     <name>MainWindow</name>
     <message>
-        <location filename="../src/mainwindow.ui" line="14"/>
+        <source>File</source>
+        <translation>Tiedosto</translation>
+    </message>
+    <message>
+        <source>Quit</source>
+        <translation>Poistu</translation>
+    </message>
+    <message>
+        <source>Open…</source>
+        <translation>Avaa...</translation>
+    </message>
+    <message>
+        <source>Ctrl+O</source>
+        <translation>Ctrl+O</translation>
+    </message>
+    <message>
+        <source>New</source>
+        <translation>Uusi</translation>
+    </message>
+    <message>
+        <source>Ctrl+N</source>
+        <translation>Ctrl+N</translation>
+    </message>
+    <message>
+        <source>Language</source>
+        <translation type="vanished">Kieli</translation>
+    </message>
+    <message>
+        <source>Open model</source>
+        <translation type="unfinished">Avaa malli</translation>
+    </message>
+    <message>
+        <source>LDraw models (*.ldr *.dat)</source>
+        <translation>LDraw-mallit (*.ldr *.dat)</translation>
+    </message>
+    <message>
+        <source>Problem opening file</source>
+        <translation>Ongelma tiedoston avaamisessa</translation>
+    </message>
+    <message>
+        <source>Could not open %1: %2</source>
+        <translation>Ei voitu avata %1: %2</translation>
+    </message>
+    <message>
         <source>LDForge</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.ui" line="34"/>
-        <source>File</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.ui" line="38"/>
         <source>Recent files</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/mainwindow.ui" line="54"/>
-        <source>Quit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.ui" line="59"/>
-        <source>Open…</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.ui" line="62"/>
-        <source>Ctrl+O</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.ui" line="67"/>
-        <source>New</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.ui" line="70"/>
-        <source>Ctrl+N</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.ui" line="75"/>
         <source>Preferences…</source>
         <translation type="unfinished"></translation>
     </message>
-    <message>
-        <location filename="../src/mainwindow.cpp" line="42"/>
-        <source>Open model</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.cpp" line="44"/>
-        <source>LDraw models (*.ldr *.dat)</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.cpp" line="65"/>
-        <source>Problem opening file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../src/mainwindow.cpp" line="67"/>
-        <source>Could not open %1: %2</source>
-        <translation type="unfinished"></translation>
-    </message>
 </context>
 <context>
     <name>SettingsEditor</name>
     <message>
-        <location filename="../src/settingseditor/settingseditor.ui" line="14"/>
         <source>Dialog</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingseditor/settingseditor.ui" line="24"/>
         <source>General</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingseditor/settingseditor.ui" line="30"/>
         <source>Language:</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingseditor/settingseditor.ui" line="38"/>
-        <location filename="../src/settingseditor/settingseditor.cpp" line="47"/>
         <source>System language</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingseditor/settingseditor.ui" line="43"/>
         <source>English</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../src/settingseditor/settingseditor.ui" line="52"/>
         <source>LDraw parts libraries</source>
         <translation type="unfinished"></translation>
     </message>

mercurial