diff --git a/CMakeLists.txt b/CMakeLists.txt index a7f0bf954..f6f31e1ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,26 +75,26 @@ ELSE(NOT GETTEXT_MSGFMT_EXECUTABLE) ENDFOREACH(_poFile ${PO_FILES}) #shell translations - SET(catalogname-shell plasma_shell_org.kde.latte.shell) - ADD_CUSTOM_TARGET(translations-shell ALL) + #SET(catalogname-shell plasma_shell_org.kde.latte.shell) + #ADD_CUSTOM_TARGET(translations-shell ALL) - FILE(GLOB PO_FILES_SHELL po/shell/*.po) + #FILE(GLOB PO_FILES_SHELL po/shell/*.po) - FOREACH(_poFile ${PO_FILES_SHELL}) - GET_FILENAME_COMPONENT(_poFileName ${_poFile} NAME) - STRING(REGEX REPLACE "^${catalogname-shell}_?" "" _langCode ${_poFileName} ) - STRING(REGEX REPLACE "\\.po$" "" _langCode ${_langCode} ) - - IF( _langCode ) - GET_FILENAME_COMPONENT(_lang ${_poFile} NAME_WE) - SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/shell/${_lang}.gmo) - - ADD_CUSTOM_COMMAND(TARGET translations-shell - COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${_gmoFile} ${_poFile} - DEPENDS ${_poFile}) - INSTALL(FILES ${_gmoFile} DESTINATION ${LOCALE_INSTALL_DIR}/kf5/${_langCode}/LC_MESSAGES/ RENAME ${catalogname-shell}.mo) - ENDIF( _langCode ) - ENDFOREACH(_poFile ${PO_FILES}) + #FOREACH(_poFile ${PO_FILES_SHELL}) + # GET_FILENAME_COMPONENT(_poFileName ${_poFile} NAME) + # STRING(REGEX REPLACE "^${catalogname-shell}_?" "" _langCode ${_poFileName} ) + # STRING(REGEX REPLACE "\\.po$" "" _langCode ${_langCode} ) + + # IF( _langCode ) + # GET_FILENAME_COMPONENT(_lang ${_poFile} NAME_WE) + # SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/shell/${_lang}.gmo) + + # ADD_CUSTOM_COMMAND(TARGET translations-shell + # COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} --check -o ${_gmoFile} ${_poFile} + # DEPENDS ${_poFile}) + # INSTALL(FILES ${_gmoFile} DESTINATION ${LOCALE_INSTALL_DIR}/kf5/${_langCode}/LC_MESSAGES/ RENAME ${catalogname-shell}.mo) + # ENDIF( _langCode ) + #ENDFOREACH(_poFile ${PO_FILES}) #corona translations SET(catalogname-corona latte-dock) diff --git a/corona/CMakeLists.txt b/corona/CMakeLists.txt index e77bfd939..29049d47d 100644 --- a/corona/CMakeLists.txt +++ b/corona/CMakeLists.txt @@ -1,3 +1,4 @@ +find_package(KF5I18n NO_MODULE) include(KDEInstallDirs) include(KDECMakeSettings) diff --git a/corona/main.cpp b/corona/main.cpp index 2bbc515f2..0f503c9cf 100644 --- a/corona/main.cpp +++ b/corona/main.cpp @@ -54,8 +54,10 @@ int main(int argc, char **argv) QApplication app(argc, argv); app.setApplicationVersion(version); - app.setOrganizationDomain(QStringLiteral("lattedock")); - app.setApplicationName(QStringLiteral("LatteDock")); + + app.setOrganizationDomain(QStringLiteral("latte-dock")); + KLocalizedString::setApplicationDomain("latte-dock"); + app.setApplicationName(QStringLiteral("Latte Dock")); //! set pattern for debug messages //! [%{type}] [%{function}:%{line}] - %{message} [%{backtrace}] @@ -74,4 +76,3 @@ int main(int argc, char **argv) return app.exec(); } - diff --git a/corona/nowdockconfigview.cpp b/corona/nowdockconfigview.cpp index 3f646c332..885dcf4ff 100644 --- a/corona/nowdockconfigview.cpp +++ b/corona/nowdockconfigview.cpp @@ -22,8 +22,10 @@ #include #include +#include #include +#include #include #include @@ -66,6 +68,7 @@ void NowDockConfigView::init() setDefaultAlphaBuffer(true); setColor(Qt::transparent); rootContext()->setContextProperty(QStringLiteral("dock"), m_dockView); + engine()->rootContext()->setContextObject(new KLocalizedContext(this)); auto source = QUrl::fromLocalFile(m_containment->corona()->kPackage().filePath("nowdockconfigurationui")); setSource(source); syncSlideEffect(); diff --git a/corona/nowdockview.cpp b/corona/nowdockview.cpp index 02c381642..5eb04b42d 100644 --- a/corona/nowdockview.cpp +++ b/corona/nowdockview.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include "nowdockcorona.h" @@ -117,6 +118,7 @@ void NowDockView::init() connect(this, SIGNAL(heightChanged(int)), this, SIGNAL(heightChanged())); rootContext()->setContextProperty(QStringLiteral("dock"), this); + engine()->rootContext()->setContextObject(new KLocalizedContext(this)); // engine()->rootContext()->setContextProperty(QStringLiteral("dock"), this); setSource(corona()->kPackage().filePath("nowdockui"));