diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6b21942b6..605caf6e8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -186,7 +186,7 @@ endif (UPDATE_TRANSLATIONS) # Generate a qrc file for the translations set(CLEMENTINE-QM-RESOURCE ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc) -file(WRITE ${CLEMENTINE-QM-RESOURCE} "") +file(WRITE ${CLEMENTINE-QM-RESOURCE} "") foreach(QM-FILE ${CLEMENTINE-QM-FILES}) file(RELATIVE_PATH QM-RELATIVE-PATH ${CMAKE_CURRENT_BINARY_DIR} ${QM-FILE}) file(APPEND ${CLEMENTINE-QM-RESOURCE} "" ${QM-RELATIVE-PATH} "") diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bd43b9aaf..6cd7b5b6e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -90,3 +90,4 @@ add_test_file(xspfparser_test.cpp false) add_test_file(library_test.cpp false) add_test_file(albumcovermanager_test.cpp true) add_test_file(songplaylistitem_test.cpp false) +add_test_file(translations_test.cpp false) diff --git a/tests/translations_test.cpp b/tests/translations_test.cpp new file mode 100644 index 000000000..7a8fab37c --- /dev/null +++ b/tests/translations_test.cpp @@ -0,0 +1,18 @@ +#include + +#include +#include + +#include "test_utils.h" + +TEST(Translations, Basic) { + ASSERT_TRUE(QFile::exists(":/translations")); + ASSERT_TRUE(QFile::exists(":/translations/clementine_empty.qm")); + ASSERT_TRUE(QFile::exists(":/translations/clementine_es.qm")); + + QTranslator t; + t.load("clementine_es.qm", ":/translations"); + + EXPECT_EQ(QString::fromUtf8("Colección"), + t.translate("MainWindow", "Library")); +}