add guh-translations package
This commit is contained in:
parent
1a74e9c1fe
commit
d3abd9bf9f
19
debian/control
vendored
19
debian/control
vendored
@ -19,7 +19,7 @@ Standards-Version: 3.9.5
|
|||||||
|
|
||||||
Package: guh
|
Package: guh
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Section: misc
|
Section: metapackages
|
||||||
Depends: guhd (= ${binary:Version}),
|
Depends: guhd (= ${binary:Version}),
|
||||||
guh-plugins (= ${binary:Version}),
|
guh-plugins (= ${binary:Version}),
|
||||||
Description: An open source IoT server - meta package
|
Description: An open source IoT server - meta package
|
||||||
@ -31,6 +31,7 @@ Description: An open source IoT server - meta package
|
|||||||
|
|
||||||
Package: guhd
|
Package: guhd
|
||||||
Architecture: any
|
Architecture: any
|
||||||
|
Section: net
|
||||||
Depends: libqt5network5,
|
Depends: libqt5network5,
|
||||||
libqt5gui5,
|
libqt5gui5,
|
||||||
libqt5sql5,
|
libqt5sql5,
|
||||||
@ -39,6 +40,7 @@ Depends: libqt5network5,
|
|||||||
libqt5bluetooth5,
|
libqt5bluetooth5,
|
||||||
logrotate,
|
logrotate,
|
||||||
avahi-daemon,
|
avahi-daemon,
|
||||||
|
guh-translations (= ${binary:Version}),
|
||||||
libguh1 (= ${binary:Version}),
|
libguh1 (= ${binary:Version}),
|
||||||
${shlibs:Depends},
|
${shlibs:Depends},
|
||||||
${misc:Depends}
|
${misc:Depends}
|
||||||
@ -73,12 +75,25 @@ Description: Documentation for the guh package (on-site) - documentation
|
|||||||
powerful rule engine you are able to connect any device available in
|
powerful rule engine you are able to connect any device available in
|
||||||
the system and create individual scenes and behaviors for your home.
|
the system and create individual scenes and behaviors for your home.
|
||||||
|
|
||||||
|
Package: guh-translations
|
||||||
|
Section: translations
|
||||||
|
Architecture: all
|
||||||
|
Depends: guh (= ${binary:Version}),
|
||||||
|
${misc:Depends}
|
||||||
|
Recommends: guh (= ${binary:Version})
|
||||||
|
Description: Documentation for the guh package (on-site) - documentation
|
||||||
|
guh is an open source home automation server, which allows to control
|
||||||
|
a lot of different devices from many different manufacturers. With the
|
||||||
|
powerful rule engine you are able to connect any device available in
|
||||||
|
the system and create individual scenes and behaviors for your home.
|
||||||
|
|
||||||
Package: guh-tests
|
Package: guh-tests
|
||||||
|
Section: misc
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: guh (= ${binary:Version}),
|
Depends: guh (= ${binary:Version}),
|
||||||
${shlibs:Depends},
|
${shlibs:Depends},
|
||||||
${misc:Depends}
|
${misc:Depends}
|
||||||
Description: Tests and mock plugin for the guh package
|
Description: Translation files for guh - translations
|
||||||
guh is an open source IoT (Internet of Things) server,
|
guh is an open source IoT (Internet of Things) server,
|
||||||
which allows to control a lot of different devices from many different
|
which allows to control a lot of different devices from many different
|
||||||
manufacturers. With the powerful rule engine you are able to connect any
|
manufacturers. With the powerful rule engine you are able to connect any
|
||||||
|
|||||||
1
debian/guh-plugins-maker.dirs
vendored
1
debian/guh-plugins-maker.dirs
vendored
@ -1,2 +1 @@
|
|||||||
usr/lib/guh/plugins
|
usr/lib/guh/plugins
|
||||||
usr/share/guh/translations
|
|
||||||
|
|||||||
1
debian/guh-plugins-merkur.dirs
vendored
1
debian/guh-plugins-merkur.dirs
vendored
@ -1,2 +1 @@
|
|||||||
usr/lib/guh/plugins
|
usr/lib/guh/plugins
|
||||||
usr/share/guh/translations
|
|
||||||
|
|||||||
1
debian/guh-plugins.dirs
vendored
1
debian/guh-plugins.dirs
vendored
@ -1,2 +1 @@
|
|||||||
usr/lib/guh/plugins
|
usr/lib/guh/plugins
|
||||||
usr/share/guh/translations
|
|
||||||
|
|||||||
1
debian/guh-translations.dirs
vendored
Normal file
1
debian/guh-translations.dirs
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
usr/share/guh/translations
|
||||||
2
debian/guh-translations.install
vendored
Normal file
2
debian/guh-translations.install
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
translations/*.qm usr/share/guh/translations
|
||||||
|
|
||||||
1
debian/guhd.dirs
vendored
1
debian/guhd.dirs
vendored
@ -1,3 +1,2 @@
|
|||||||
usr/bin
|
usr/bin
|
||||||
etc/guh/
|
etc/guh/
|
||||||
usr/share/guh/translations
|
|
||||||
|
|||||||
1
debian/guhd.install
vendored
1
debian/guhd.install
vendored
@ -1,4 +1,3 @@
|
|||||||
usr/bin/guhd
|
usr/bin/guhd
|
||||||
data/systemd/guhd.service /etc/systemd/system/
|
data/systemd/guhd.service /etc/systemd/system/
|
||||||
data/logrotate/guhd /etc/logrotate.d/
|
data/logrotate/guhd /etc/logrotate.d/
|
||||||
translations/*.qm /usr/share/guh/translations
|
|
||||||
|
|||||||
@ -286,9 +286,9 @@ void DeviceManager::setLocale(const QLocale &locale)
|
|||||||
{
|
{
|
||||||
m_locale = locale;
|
m_locale = locale;
|
||||||
foreach (DevicePlugin *plugin, m_devicePlugins.values()) {
|
foreach (DevicePlugin *plugin, m_devicePlugins.values()) {
|
||||||
if (!plugin->setLocale(m_locale))
|
QCoreApplication::removeTranslator(plugin->translator());
|
||||||
qCWarning(dcDeviceManager()) << "Could not load translation" << m_locale.name() << "for plugin" << plugin->pluginName();
|
plugin->setLocale(m_locale);
|
||||||
|
QCoreApplication::installTranslator(plugin->translator());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -451,7 +451,7 @@ QTranslator *DevicePlugin::translator()
|
|||||||
bool DevicePlugin::setLocale(const QLocale &locale)
|
bool DevicePlugin::setLocale(const QLocale &locale)
|
||||||
{
|
{
|
||||||
// check if there are local translations
|
// check if there are local translations
|
||||||
if (m_translator->load(locale, m_metaData.value("id").toString(), "-", QDir(QCoreApplication::applicationDirPath() + "../../plugins/translations/").absolutePath(), ".qm")) {
|
if (m_translator->load(locale, m_metaData.value("id").toString(), "-", QDir(QCoreApplication::applicationDirPath() + "../../translations/").absolutePath(), ".qm")) {
|
||||||
qCDebug(dcDeviceManager()) << "* Load translation" << locale.name() << "for" << pluginName() << "from" << QDir(QCoreApplication::applicationDirPath() + "../../translations/").absolutePath();
|
qCDebug(dcDeviceManager()) << "* Load translation" << locale.name() << "for" << pluginName() << "from" << QDir(QCoreApplication::applicationDirPath() + "../../translations/").absolutePath();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -462,6 +462,7 @@ bool DevicePlugin::setLocale(const QLocale &locale)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qCWarning(dcDeviceManager()) << "* Could not load translation" << locale.name() << "for plugin" << pluginName();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ infofile.commands = $$top_srcdir/plugins/guh-generateplugininfo -j ${QMAKE_FILE_
|
|||||||
-o ${QMAKE_FILE_OUT} \
|
-o ${QMAKE_FILE_OUT} \
|
||||||
-b $$OUT_PWD \
|
-b $$OUT_PWD \
|
||||||
-t $$TRANSLATIONS; \
|
-t $$TRANSLATIONS; \
|
||||||
rsync -a "$$OUT_PWD"/translations/*.qm $$top_builddir/plugins/translations/;
|
rsync -a "$$OUT_PWD"/translations/*.qm $$top_builddir/translations/;
|
||||||
|
|
||||||
QMAKE_EXTRA_COMPILERS += infofile
|
QMAKE_EXTRA_COMPILERS += infofile
|
||||||
PRE_TARGETDEPS += compiler_infofile_make_all
|
PRE_TARGETDEPS += compiler_infofile_make_all
|
||||||
|
|||||||
@ -132,7 +132,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Translator for the server application
|
// Translator for the server application
|
||||||
QTranslator translator;
|
QTranslator translator;
|
||||||
translator.load(QLocale::system(), application.applicationName(), "_", GuhSettings::translationsPath(), ".qm");
|
// check if there are local translations
|
||||||
|
if (!translator.load(QLocale::system(), application.applicationName(), "-", QDir(QCoreApplication::applicationDirPath() + "../../translations/").absolutePath(), ".qm"))
|
||||||
|
if (!translator.load(QLocale::system(), application.applicationName(), "-", GuhSettings::translationsPath(), ".qm"))
|
||||||
|
qWarning(dcApplication()) << "Could not find guhd translations for" << QLocale::system();
|
||||||
|
|
||||||
qApp->installTranslator(&translator);
|
qApp->installTranslator(&translator);
|
||||||
|
|
||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>main</name>
|
<name>main</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../server/main.cpp" line="141"/>
|
<location filename="../server/main.cpp" line="145"/>
|
||||||
<source>
|
<source>
|
||||||
guh ( /[guːh]/ ) is an open source IoT (Internet of Things) server,
|
guh ( /[guːh]/ ) is an open source IoT (Internet of Things) server,
|
||||||
which allows to control a lot of different devices from many different
|
which allows to control a lot of different devices from many different
|
||||||
@ -23,12 +23,12 @@ Szenen undVerhaltensweisen des Systems festzulegen.
|
|||||||
</translation>
|
</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../server/main.cpp" line="153"/>
|
<location filename="../server/main.cpp" line="157"/>
|
||||||
<source>Run guhd in the foreground, not as daemon.</source>
|
<source>Run guhd in the foreground, not as daemon.</source>
|
||||||
<translation>Starte guhd im Vordergrund, nicht als Service.</translation>
|
<translation>Starte guhd im Vordergrund, nicht als Service.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../server/main.cpp" line="156"/>
|
<location filename="../server/main.cpp" line="160"/>
|
||||||
<source>Debug categories to enable. Prefix with "No" to disable. Warnings from all categories will be printed unless explicitly muted with "NoWarnings".
|
<source>Debug categories to enable. Prefix with "No" to disable. Warnings from all categories will be printed unless explicitly muted with "NoWarnings".
|
||||||
|
|
||||||
Categories are:</source>
|
Categories are:</source>
|
||||||
@ -36,12 +36,12 @@ Categories are:</source>
|
|||||||
Es gibt folgende Kategorien:</translation>
|
Es gibt folgende Kategorien:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../server/main.cpp" line="173"/>
|
<location filename="../server/main.cpp" line="177"/>
|
||||||
<source>Enables all debug categories. This parameter overrides all debug category parameters.</source>
|
<source>Enables all debug categories. This parameter overrides all debug category parameters.</source>
|
||||||
<translation>Aktiviere alle Debug-Kategorien. Dieser Parameter überschreibt alle anderen Debug-Kategorien Parameter.</translation>
|
<translation>Aktiviere alle Debug-Kategorien. Dieser Parameter überschreibt alle anderen Debug-Kategorien Parameter.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../server/main.cpp" line="193"/>
|
<location filename="../server/main.cpp" line="197"/>
|
||||||
<source>No such debug category:</source>
|
<source>No such debug category:</source>
|
||||||
<translation>Diese Debug-Kategorie existiert nicht:</translation>
|
<translation>Diese Debug-Kategorie existiert nicht:</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>main</name>
|
<name>main</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../server/main.cpp" line="141"/>
|
<location filename="../server/main.cpp" line="145"/>
|
||||||
<source>
|
<source>
|
||||||
guh ( /[guːh]/ ) is an open source IoT (Internet of Things) server,
|
guh ( /[guːh]/ ) is an open source IoT (Internet of Things) server,
|
||||||
which allows to control a lot of different devices from many different
|
which allows to control a lot of different devices from many different
|
||||||
@ -16,24 +16,24 @@ for your environment.
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../server/main.cpp" line="153"/>
|
<location filename="../server/main.cpp" line="157"/>
|
||||||
<source>Run guhd in the foreground, not as daemon.</source>
|
<source>Run guhd in the foreground, not as daemon.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../server/main.cpp" line="156"/>
|
<location filename="../server/main.cpp" line="160"/>
|
||||||
<source>Debug categories to enable. Prefix with "No" to disable. Warnings from all categories will be printed unless explicitly muted with "NoWarnings".
|
<source>Debug categories to enable. Prefix with "No" to disable. Warnings from all categories will be printed unless explicitly muted with "NoWarnings".
|
||||||
|
|
||||||
Categories are:</source>
|
Categories are:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../server/main.cpp" line="173"/>
|
<location filename="../server/main.cpp" line="177"/>
|
||||||
<source>Enables all debug categories. This parameter overrides all debug category parameters.</source>
|
<source>Enables all debug categories. This parameter overrides all debug category parameters.</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../server/main.cpp" line="193"/>
|
<location filename="../server/main.cpp" line="197"/>
|
||||||
<source>No such debug category:</source>
|
<source>No such debug category:</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
|||||||
Reference in New Issue
Block a user