1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-27 06:03:51 +03:00

fix #3, load KLocalizedString for qml parts

This commit is contained in:
Michail Vourlakos 2016-12-28 18:01:25 +02:00
parent 7e412d9cab
commit 152d2eb8ec
5 changed files with 26 additions and 19 deletions

View File

@ -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} )
#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)
# 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})
# 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)

View File

@ -1,3 +1,4 @@
find_package(KF5I18n NO_MODULE)
include(KDEInstallDirs)
include(KDECMakeSettings)

View File

@ -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();
}

View File

@ -22,8 +22,10 @@
#include <QQuickItem>
#include <QQmlContext>
#include <QQmlEngine>
#include <QScreen>
#include <KLocalizedContext>
#include <KWindowSystem>
#include <KWindowEffects>
@ -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();

View File

@ -35,6 +35,7 @@
#include <KWindowSystem>
#include <Plasma/Containment>
#include <KActionCollection>
#include <KLocalizedContext>
#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"));