mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
QML Plugins: Fix exporting i18n functions
This commit is contained in:
parent
71b54b5bbf
commit
797e4c12a2
@ -130,6 +130,9 @@ if (PySide2_FOUND AND Shiboken2_FOUND AND PythonLibs_FOUND)
|
||||
endif()
|
||||
|
||||
find_package(Intl)
|
||||
if (Intl_FOUND)
|
||||
set(HAVE_LIBINTL TRUE)
|
||||
endif()
|
||||
|
||||
# Git revision
|
||||
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
|
@ -69,10 +69,10 @@ void QmlPluginLoader::initEngineAndComponent()
|
||||
#if HAVE_LIBINTL
|
||||
auto i18n = new QmlI18n(m_name);
|
||||
m_engine->globalObject().setProperty(QSL("__falkon_i18n"), m_engine->newQObject(i18n));
|
||||
m_engine->globalObject().setProperty(QSL("i18n"), m_engine->evaluate(QSL("function (s) { return __falkon_i18n.i18n(s) }")));
|
||||
m_engine->globalObject().setProperty(QSL("i18np"), m_engine->evaluate(QSL("function (s1, s2) { return __falkon_i18n.i18np(s1, s2) }")));
|
||||
m_engine->evaluate(QSL("i18n = function (s) { return __falkon_i18n.i18n(s) };"));
|
||||
m_engine->evaluate(QSL("i18np = function (s1, s2) { return __falkon_i18n.i18np(s1, s2) }"));
|
||||
#else
|
||||
m_engine->globalObject().setProperty(QSL("i18n"), m_engine->evaluate(QSL("function (s) { return s }")));
|
||||
m_engine->globalObject().setProperty(QSL("i18np"), m_engine->evaluate(QSL("function (s1, s2) { return s1 }")));
|
||||
m_engine->evaluate(QSL("i18n = function (s) { return s; };"));
|
||||
m_engine->evaluate(QSL("i18np = function (s1, s2) { return s1; }"));
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user