Commit 452f18fd authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

fix i18n

parent 5ef89b41
Pipeline #157155 passed with stage
in 10 minutes and 11 seconds
#ecm_optional_add_subdirectory(shared)
ecm_optional_add_subdirectory(lib)
ecm_optional_add_subdirectory(kate)
ecm_optional_add_subdirectory(kwrite)
# We use an intermediate static library because linking tests directly to an executable is not
# possible with CMake yet.
add_library(kate-lib STATIC "")
configure_file(config.h.in config.h)
include(GenerateExportHeader)
generate_export_header(
kate-lib
EXPORT_FILE_NAME katetests_export.h
EXPORT_MACRO_NAME KATE_TESTS_EXPORT
)
target_include_directories(
kate-lib
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/session
${CMAKE_CURRENT_SOURCE_DIR}/qtsingleapplication
${CMAKE_CURRENT_SOURCE_DIR}/quickopen
${CMAKE_CURRENT_BINARY_DIR} # katetests_export.h + config.h
)
find_package(
KF5 ${KF5_DEP_VERSION}
QUIET
REQUIRED
COMPONENTS
TextEditor
WindowSystem
DBusAddons
Crash
OPTIONAL_COMPONENTS
Activities
)
target_link_libraries(
kate-lib
PUBLIC
KF5::I18n
KF5::TextEditor
KF5::WindowSystem
KF5::DBusAddons
KF5::Crash
KF5::TextWidgets
kateshared
)
if(KF5Activities_FOUND)
target_link_libraries(kate-lib PUBLIC KF5::Activities)
endif()
# optional KUserFeedback integration
find_package(KUserFeedback)
if (TARGET KUserFeedbackWidgets)
target_link_libraries(kate-lib PUBLIC KUserFeedbackWidgets)
target_compile_definitions(kate-lib PUBLIC -DWITH_KUSERFEEDBACK)
endif()
ki18n_wrap_ui(kate-lib ui/sessionconfigwidget.ui session/katesessionmanagedialog.ui)
target_sources(
kate-lib
PRIVATE
data/kate.qrc
session/katesession.cpp
session/katesessionmanagedialog.cpp
session/katesessionmanager.cpp
session/katesessionsaction.cpp
quickopen/katequickopen.cpp
quickopen/katequickopenmodel.cpp
quickopen/katequickopenlineedit.cpp
kateapp.cpp
kateappadaptor.cpp
kateconfigdialog.cpp
kateconfigplugindialogpage.cpp
katedocmanager.cpp
katefileactions.cpp
katemainwindow.cpp
katemdi.cpp
katemwmodonhddialog.cpp
katepluginmanager.cpp
katerunninginstanceinfo.cpp
katesavemodifieddialog.cpp
katetabbar.cpp
katesplitter.cpp
kateviewmanager.cpp
kateviewspace.cpp
katewaiter.cpp
tabmimedata.cpp
kateoutputview.cpp
katestashmanager.cpp
kateurlbar.cpp
)
# Executable only adds the main definition.
add_executable(kate-bin main.cpp)
add_executable(kate-bin main.cpp data/kate.qrc)
target_link_libraries(kate-bin PRIVATE kate-lib)
# Use a single application on MacOS + Windows instead of dbus.
if(APPLE OR WIN32)
target_compile_definitions(kate-bin PRIVATE USE_QT_SINGLE_APP)
target_sources(
kate-lib
PRIVATE
qtsingleapplication/qtlocalpeer.cpp
qtsingleapplication/qtsingleapplication.cpp
qtsingleapplication/qtlockedfile.cpp
)
if(WIN32)
target_sources(kate-lib PRIVATE qtsingleapplication/qtlockedfile_win.cpp)
else()
target_sources(kate-lib PRIVATE qtsingleapplication/qtlockedfile_unix.cpp)
endif()
endif()
# we have different windows icons, less margins
......@@ -189,7 +74,3 @@ install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/org.kde.kate.appdata.xml
DESTINATION ${KDE_INSTALL_METAINFODIR}
)
if(BUILD_TESTING)
add_subdirectory(autotests)
endif()
#! /usr/bin/env bash
$EXTRACTRC `find . -name \*.rc -o -name \*.ui` >> rc.cpp || exit 11
$XGETTEXT `find . -name "*.cpp" -o -name "*.h"` -o $podir/kate.pot
$EXTRACTRC `find . ../lib -name \*.rc -o -name \*.ui` >> rc.cpp || exit 11
$XGETTEXT `find . ../lib -name "*.cpp" -o -name "*.h"` -o $podir/kate.pot
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource prefix="/kxmlgui5/kate">
<file>kateui.rc</file>
</qresource>
<qresource prefix="/kxmlgui5/kwrite">
<file>kateui.rc</file>
<file alias="kateui.rc">../../lib/data/kateui.rc</file>
</qresource>
<qresource prefix="/kate">
<file alias="kate.svg">../icons/unix/sc-apps-kate.svg</file>
......
......@@ -46,7 +46,7 @@ target_sources(
kwrite
PRIVATE
main.cpp
../kate/data/kate.qrc # tried to init static resource, failed
data/kwrite.qrc
)
# See https://cmake.org/cmake/help/v3.15/prop_tgt/MACOSX_BUNDLE_INFO_PLIST.html
......
#! /usr/bin/env bash
$EXTRACTRC `find . -name \*.rc -o -name \*.ui` >> rc.cpp || exit 11
$XGETTEXT `find . -name "*.cpp" -o -name "*.h"` -o $podir/kwrite.pot
$EXTRACTRC `find . ../lib -name \*.rc -o -name \*.ui` >> rc.cpp || exit 11
$XGETTEXT `find . ../lib -name "*.cpp" -o -name "*.h"` -o $podir/kwrite.pot
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource prefix="/kxmlgui5/kwrite">
<file alias="kateui.rc">../../lib/data/kateui.rc</file>
</qresource>
</RCC>
# We use an intermediate static library because linking tests directly to an executable is not
# possible with CMake yet.
add_library(kate-lib STATIC "")
configure_file(config.h.in config.h)
include(GenerateExportHeader)
generate_export_header(
kate-lib
EXPORT_FILE_NAME katetests_export.h
EXPORT_MACRO_NAME KATE_TESTS_EXPORT
)
target_include_directories(
kate-lib
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/session
${CMAKE_CURRENT_SOURCE_DIR}/qtsingleapplication
${CMAKE_CURRENT_SOURCE_DIR}/quickopen
${CMAKE_CURRENT_BINARY_DIR} # katetests_export.h + config.h
)
find_package(
KF5 ${KF5_DEP_VERSION}
QUIET
REQUIRED
COMPONENTS
TextEditor
WindowSystem
DBusAddons
Crash
OPTIONAL_COMPONENTS
Activities
)
target_link_libraries(
kate-lib
PUBLIC
KF5::I18n
KF5::TextEditor
KF5::WindowSystem
KF5::DBusAddons
KF5::Crash
KF5::TextWidgets
kateshared
)
if(KF5Activities_FOUND)
target_link_libraries(kate-lib PUBLIC KF5::Activities)
endif()
# optional KUserFeedback integration
find_package(KUserFeedback)
if (TARGET KUserFeedbackWidgets)
target_link_libraries(kate-lib PUBLIC KUserFeedbackWidgets)
target_compile_definitions(kate-lib PUBLIC -DWITH_KUSERFEEDBACK)
endif()
ki18n_wrap_ui(kate-lib ui/sessionconfigwidget.ui session/katesessionmanagedialog.ui)
target_sources(
kate-lib
PRIVATE
session/katesession.cpp
session/katesessionmanagedialog.cpp
session/katesessionmanager.cpp
session/katesessionsaction.cpp
quickopen/katequickopen.cpp
quickopen/katequickopenmodel.cpp
quickopen/katequickopenlineedit.cpp
kateapp.cpp
kateappadaptor.cpp
kateconfigdialog.cpp
kateconfigplugindialogpage.cpp
katedocmanager.cpp
katefileactions.cpp
katemainwindow.cpp
katemdi.cpp
katemwmodonhddialog.cpp
katepluginmanager.cpp
katerunninginstanceinfo.cpp
katesavemodifieddialog.cpp
katetabbar.cpp
katesplitter.cpp
kateviewmanager.cpp
kateviewspace.cpp
katewaiter.cpp
tabmimedata.cpp
kateoutputview.cpp
katestashmanager.cpp
kateurlbar.cpp
)
# Use a single application on MacOS + Windows instead of dbus.
if(APPLE OR WIN32)
target_sources(
kate-lib
PRIVATE
qtsingleapplication/qtlocalpeer.cpp
qtsingleapplication/qtsingleapplication.cpp
qtsingleapplication/qtlockedfile.cpp
)
if(WIN32)
target_sources(kate-lib PRIVATE qtsingleapplication/qtlockedfile_win.cpp)
else()
target_sources(kate-lib PRIVATE qtsingleapplication/qtlockedfile_unix.cpp)
endif()
endif()
if(BUILD_TESTING)
add_subdirectory(autotests)
endif()
......@@ -4,7 +4,7 @@ find_package(Qt${QT_MAJOR_VERSION}Test ${QT_MIN_VERSION} QUIET REQUIRED)
macro(kate_executable_tests)
foreach(_testname ${ARGN})
add_executable(${_testname} ${_testname}.cpp)
add_executable(${_testname} ${_testname}.cpp tests.qrc)
target_link_libraries(
${_testname}
......
......@@ -20,11 +20,6 @@ QTEST_MAIN(KateSessionManagerTest)
void KateSessionManagerTest::initTestCase()
{
/**
* init resources from our static lib
*/
Q_INIT_RESOURCE(kate);
// we need an application object, as session loading will trigger modifications to that
m_app = new KateApp(QCommandLineParser());
m_app->sessionManager()->activateAnonymousSession();
......
......@@ -19,11 +19,6 @@ QTEST_MAIN(KateSessionsActionTest)
void KateSessionsActionTest::initTestCase()
{
/**
* init resources from our static lib
*/
Q_INIT_RESOURCE(kate);
// we need an application object, as session loading will trigger modifications to that
m_app = new KateApp(QCommandLineParser());
m_app->sessionManager()->activateAnonymousSession();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment