Qt: made translations possible, added german translation (#5)
parent
3cbc2323a2
commit
532e4ec95f
|
@ -1,6 +1,6 @@
|
||||||
cmake_minimum_required (VERSION 3.6)
|
cmake_minimum_required (VERSION 3.6)
|
||||||
project (whyblocked
|
project (whyblocked
|
||||||
VERSION 0.8.0
|
VERSION 0.9.0
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ include(GNUInstallDirs)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(LIBXDG_BASEDIR REQUIRED libxdg-basedir)
|
pkg_check_modules(LIBXDG_BASEDIR REQUIRED libxdg-basedir)
|
||||||
find_package(Qt5Widgets CONFIG REQUIRED)
|
find_package(Qt5Widgets CONFIG REQUIRED)
|
||||||
|
find_package(Qt5LinguistTools)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
@ -31,18 +32,29 @@ configure_file (
|
||||||
"${PROJECT_BINARY_DIR}/version.hpp"
|
"${PROJECT_BINARY_DIR}/version.hpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(Qt5_LRELEASE_EXECUTABLE)
|
||||||
|
file(GLOB TS_FILES "translations/*.ts")
|
||||||
|
file(GLOB TS_SRC_FILES "src/*")
|
||||||
|
qt5_create_translation(QM_FILES ${TS_SRC_FILES} ${TS_FILES} OPTIONS -no-obsolete)
|
||||||
|
qt5_add_translation(QM_FILES ${TS_FILES})
|
||||||
|
endif()
|
||||||
|
|
||||||
add_executable(whyblocked src/interface_text.cpp src/whyblocked.cpp)
|
add_executable(whyblocked src/interface_text.cpp src/whyblocked.cpp)
|
||||||
target_link_libraries(whyblocked
|
target_link_libraries(whyblocked
|
||||||
${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp stdc++fs)
|
${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp stdc++fs)
|
||||||
install(TARGETS whyblocked DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS whyblocked DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
|
||||||
if(NOT WITHOUT_QT)
|
if(NOT WITHOUT_QT)
|
||||||
add_executable(whyblocked-gui src/interface_qt.cpp src/whyblocked.cpp)
|
add_executable(whyblocked-gui src/interface_qt.cpp src/whyblocked.cpp ${QM_FILES})
|
||||||
target_link_libraries(whyblocked-gui
|
target_link_libraries(whyblocked-gui
|
||||||
${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp stdc++fs Qt5::Widgets)
|
${LIBXDG_BASEDIR_LIBRARIES} vsqlitepp stdc++fs
|
||||||
|
Qt5::Widgets)
|
||||||
|
|
||||||
install(TARGETS whyblocked-gui DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS whyblocked-gui DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
install(FILES de.tastytea.Whyblocked.desktop DESTINATION
|
install(FILES de.tastytea.Whyblocked.desktop DESTINATION
|
||||||
${CMAKE_INSTALL_DATAROOTDIR}/applications)
|
${CMAKE_INSTALL_DATAROOTDIR}/applications)
|
||||||
|
install(FILES ${QM_FILES} DESTINATION
|
||||||
|
${CMAKE_INSTALL_DATAROOTDIR}/qt5/translations)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QTranslator>
|
||||||
|
#include <QLibraryInfo>
|
||||||
#include "version.hpp"
|
#include "version.hpp"
|
||||||
#include "whyblocked.hpp"
|
#include "whyblocked.hpp"
|
||||||
#include "interface_qt.hpp"
|
#include "interface_qt.hpp"
|
||||||
|
@ -133,8 +135,8 @@ void MainWindow::remove()
|
||||||
|
|
||||||
void MainWindow::about()
|
void MainWindow::about()
|
||||||
{
|
{
|
||||||
QMessageBox::about(this, tr("About whyblocked"),
|
QMessageBox::about(this, tr("About Whyblocked"),
|
||||||
tr("<p><b>whyblocked</b> %1</p>"
|
tr("<p><b>Whyblocked</b> %1</p>"
|
||||||
"<p>Reminds you why you blocked someone.</p>"
|
"<p>Reminds you why you blocked someone.</p>"
|
||||||
"<p>Sourcecode: <a href=\"https://schlomp.space/tastytea/whyblocked\">"
|
"<p>Sourcecode: <a href=\"https://schlomp.space/tastytea/whyblocked\">"
|
||||||
"https://schlomp.space/tastytea/whyblocked</a></p>"
|
"https://schlomp.space/tastytea/whyblocked</a></p>"
|
||||||
|
@ -259,6 +261,15 @@ int main(int argc, char *argv[])
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
QCoreApplication::setApplicationName("Whyblocked");
|
QCoreApplication::setApplicationName("Whyblocked");
|
||||||
|
|
||||||
|
QTranslator qtTranslator;
|
||||||
|
qtTranslator.load("qt_" + QLocale::system().name(),
|
||||||
|
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||||
|
app.installTranslator(&qtTranslator);
|
||||||
|
QTranslator appTranslator;
|
||||||
|
appTranslator.load("whyblocked_" + QLocale::system().name(),
|
||||||
|
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||||
|
app.installTranslator(&appTranslator);
|
||||||
|
|
||||||
MainWindow win;
|
MainWindow win;
|
||||||
win.show();
|
win.show();
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@
|
||||||
<widget class="QStatusBar" name="statusbar"/>
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
<widget class="QToolBar" name="toolbar">
|
<widget class="QToolBar" name="toolbar">
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>toolBar</string>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="toolBarArea">
|
<attribute name="toolBarArea">
|
||||||
<enum>TopToolBarArea</enum>
|
<enum>TopToolBarArea</enum>
|
||||||
|
@ -205,7 +205,8 @@
|
||||||
</action>
|
</action>
|
||||||
<action name="action_edit">
|
<action name="action_edit">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset theme="edit-redo"/>
|
<iconset theme="edit-redo">
|
||||||
|
<normaloff>.</normaloff>.</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Edit</string>
|
<string>&Edit</string>
|
||||||
|
|
|
@ -0,0 +1,251 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1" language="de_DE">
|
||||||
|
<context>
|
||||||
|
<name>DialogAdd</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked_add.ui" line="14"/>
|
||||||
|
<source>Add entry</source>
|
||||||
|
<translation>Eintrag hinzufügen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked_add.ui" line="37"/>
|
||||||
|
<source>Memory aids, proof</source>
|
||||||
|
<translation>Gedächtnisstützen, Beweise</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked_add.ui" line="40"/>
|
||||||
|
<source>Rece&ipts</source>
|
||||||
|
<translation>Be&lege</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked_add.ui" line="53"/>
|
||||||
|
<source>Add receipt</source>
|
||||||
|
<translation>Beleg hinzufügen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked_add.ui" line="56"/>
|
||||||
|
<source>&Add</source>
|
||||||
|
<translation>&Hinzufügen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked_add.ui" line="76"/>
|
||||||
|
<source>&Blocked</source>
|
||||||
|
<translation>&Blockiert</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked_add.ui" line="95"/>
|
||||||
|
<source>&Silenced</source>
|
||||||
|
<translation>&Gedämpft</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked_add.ui" line="102"/>
|
||||||
|
<source>R&eason</source>
|
||||||
|
<translation>B&egründung</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked_add.ui" line="131"/>
|
||||||
|
<source>Blocked/Silenced</source>
|
||||||
|
<translation>Blockiert/Gedämpft</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked_add.ui" line="141"/>
|
||||||
|
<source>&User/Instance</source>
|
||||||
|
<translation>Ben&utzer/Instanz</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked_add.ui" line="151"/>
|
||||||
|
<source>Remove receipt</source>
|
||||||
|
<translation>Beleg entfernen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked_add.ui" line="154"/>
|
||||||
|
<source>Re&move</source>
|
||||||
|
<translation>Ent&fernen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/interface_qt.cpp" line="218"/>
|
||||||
|
<source>Insert receipt here.</source>
|
||||||
|
<translation>Beleg hier einfügen.</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/interface_qt.cpp" line="253"/>
|
||||||
|
<source>Added %1 to database.</source>
|
||||||
|
<translation>%1 zur Datenbank hinzugefügt.</translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>MainWindow</name>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="14"/>
|
||||||
|
<source>Whyblocked</source>
|
||||||
|
<translation></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="24"/>
|
||||||
|
<source>Click or press enter to view receipts</source>
|
||||||
|
<translation>Klicken oder Eingabe drücken, um Belege zu anzuzeigen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="67"/>
|
||||||
|
<source>Memory aids, proof</source>
|
||||||
|
<translation>Gedächtnisstützen, Beweise</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="117"/>
|
||||||
|
<source>&Database</source>
|
||||||
|
<translation>&Datenbank</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="127"/>
|
||||||
|
<source>&Help</source>
|
||||||
|
<translation>&Hilfe</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="140"/>
|
||||||
|
<source>&Add</source>
|
||||||
|
<translation>&Hinzufügen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="143"/>
|
||||||
|
<source>Add user or instance</source>
|
||||||
|
<translation>Benutzer oder Instanz hinzufügen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="146"/>
|
||||||
|
<source>Ctrl+N</source>
|
||||||
|
<translation>Strg+N</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="155"/>
|
||||||
|
<source>Re&move</source>
|
||||||
|
<translation>Ent&fernen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="158"/>
|
||||||
|
<source>Remove user or instance</source>
|
||||||
|
<translation>Benutzer oder Instanz entfernen</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="161"/>
|
||||||
|
<source>Del</source>
|
||||||
|
<translation>Entf</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="170"/>
|
||||||
|
<source>&About</source>
|
||||||
|
<translation>&Über</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="173"/>
|
||||||
|
<source>About this application</source>
|
||||||
|
<translation>Über dieses Programm</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="182"/>
|
||||||
|
<source>&Reload</source>
|
||||||
|
<translation>Neu &laden</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="185"/>
|
||||||
|
<source>Reload database</source>
|
||||||
|
<translation>Datenbank neu laden</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="188"/>
|
||||||
|
<source>Ctrl+R</source>
|
||||||
|
<translation>Strg+R</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="197"/>
|
||||||
|
<source>&Quit</source>
|
||||||
|
<translation>&Beenden</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="200"/>
|
||||||
|
<source>Quit application</source>
|
||||||
|
<translation>Programm beenden</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="203"/>
|
||||||
|
<source>Ctrl+Q</source>
|
||||||
|
<translation>Strg+Q</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="212"/>
|
||||||
|
<source>&Edit</source>
|
||||||
|
<translation>B&earbeiten</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="215"/>
|
||||||
|
<location filename="../src/interface_qt.cpp" line="92"/>
|
||||||
|
<source>Edit entry</source>
|
||||||
|
<translation>Eintrag bearbeiten</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/whyblocked.ui" line="218"/>
|
||||||
|
<source>Ctrl+E</source>
|
||||||
|
<translation>Strg+E</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/interface_qt.cpp" line="40"/>
|
||||||
|
<source>User/Instance</source>
|
||||||
|
<translation>Benutzer/Instanz</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/interface_qt.cpp" line="41"/>
|
||||||
|
<source>Blocked/Silenced</source>
|
||||||
|
<translation>Blockiert/Gedämpft</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/interface_qt.cpp" line="42"/>
|
||||||
|
<source>Reason</source>
|
||||||
|
<translation>Begründung</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/interface_qt.cpp" line="57"/>
|
||||||
|
<source>Database loaded.</source>
|
||||||
|
<translation>Datenbank geladen.</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/interface_qt.cpp" line="66"/>
|
||||||
|
<source>blocked</source>
|
||||||
|
<translation>blockiert</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/interface_qt.cpp" line="70"/>
|
||||||
|
<source>silenced</source>
|
||||||
|
<translation>gedämpft</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/interface_qt.cpp" line="86"/>
|
||||||
|
<source>Invalid selection</source>
|
||||||
|
<translation>Ungültige Auswahl</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/interface_qt.cpp" line="87"/>
|
||||||
|
<source>Please select only 1 entry to edit.</source>
|
||||||
|
<translation>Bitte nur 1 Eintrag zum bearbeiten auswählen.</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/interface_qt.cpp" line="124"/>
|
||||||
|
<source>Removed %1 from database.</source>
|
||||||
|
<translation>%1 aus der Datenbank gelöscht.</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/interface_qt.cpp" line="132"/>
|
||||||
|
<source>Select data to remove.</source>
|
||||||
|
<translation>Wähle Daten zum löschen aus.</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/interface_qt.cpp" line="138"/>
|
||||||
|
<source>About Whyblocked</source>
|
||||||
|
<translation>Über Whyblocked</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../src/interface_qt.cpp" line="139"/>
|
||||||
|
<source><p><b>Whyblocked</b> %1</p><p>Reminds you why you blocked someone.</p><p>Sourcecode: <a href="https://schlomp.space/tastytea/whyblocked">https://schlomp.space/tastytea/whyblocked</a></p><p><small>Copyright © 2018 <a href="mailto:tastytea@tastytea.de">tastytea</a>.<br>Licence GPLv3: <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU GPL version 3</a>.<br>This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.</small></p></source>
|
||||||
|
<translation><p><b>Whyblocked</b> %1</p><p>Erinnert dich, warum du jemanden blockiertest.</p><p>Quelltext: <a href="https://schlomp.space/tastytea/whyblocked">https://schlomp.space/tastytea/whyblocked</a></p><p><small>Copyright © 2018 <a href="mailto:tastytea@tastytea.de">tastytea</a>.<br>Lizenz GPLv3: <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU GPL version 3</a>.<br>Für dieses Programm besteht KEINERLEI GARANTIE. Dies ist freie Software, die Sie unter bestimmten Bedingungen weitergeben dürfen.</small></p></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
|
</TS>
|
Loading…
Reference in New Issue