mirror of
https://github.com/UbuntuKylin/kylin-video.git
synced 2026-10-17 05:20:57 +08:00
Modified the path of translated pm files and the timing of generation
This commit is contained in:
+1
-2
@@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
#! /bin/sh
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
|
||||
#lrelease src/src.pro
|
||||
lrelease kylin-video.pro
|
||||
|
||||
Vendored
+3
-1
@@ -1,11 +1,13 @@
|
||||
kylin-video (2.0.0-0ubuntu2) eoan; urgency=low
|
||||
|
||||
* Supported Interface Size Tension.
|
||||
* Added new files, such as videowindow.cpp, autohidecursorwidget.cpp and displaylayercomposer.cpp.
|
||||
* Added new files, such as videowindow.cpp, autohidecursorwidget.cpp and
|
||||
displaylayercomposer.cpp.
|
||||
* Add remote controller dbus.
|
||||
* Add equalizer and filter for audio.
|
||||
* Fixed the exception of the esctip.
|
||||
* Access icon from theme.
|
||||
* Modified the path of translated pm files and the timing of generation.
|
||||
|
||||
-- lixiang <lixiang@kylinos.cn> Mon, 22 Jul 2019 10:51:05 +0800
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -14,7 +14,7 @@ override_dh_auto_configure:
|
||||
dh $@
|
||||
|
||||
override_dh_install:
|
||||
./autogen.sh
|
||||
# ./autogen.sh
|
||||
dh_install
|
||||
|
||||
override_dh_missing:
|
||||
|
||||
@@ -122,10 +122,4 @@
|
||||
<qresource prefix="/qss">
|
||||
<file>res/style.qss</file>
|
||||
</qresource>
|
||||
<qresource prefix="/qm">
|
||||
<file>translations/kylin-video_zh_CN.qm</file>
|
||||
<file>translations/kylin-video_fr.qm</file>
|
||||
<file>translations/kylin-video_pt.qm</file>
|
||||
<file>translations/kylin-video_ru.qm</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -37,16 +37,14 @@ QString Paths::appPath() {
|
||||
|
||||
QString Paths::translationPath()
|
||||
{
|
||||
return ":/qm/translations";
|
||||
|
||||
/*QString path;
|
||||
QString path;
|
||||
if (QDir("/usr/share/kylin-video/translations").exists()) {
|
||||
path = "/usr/share/kylin-video/translations";
|
||||
return path;
|
||||
}
|
||||
else {
|
||||
return appPath() + "/translations";
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
QString Paths::shortcutsPath() {
|
||||
|
||||
+12
-16
@@ -23,31 +23,32 @@
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
|
||||
Translator::Translator() {
|
||||
qApp->installTranslator( &app_trans );
|
||||
qApp->installTranslator( &qt_trans );
|
||||
Translator::Translator()
|
||||
{
|
||||
qApp->installTranslator(&app_trans);
|
||||
qApp->installTranslator(&qt_trans);
|
||||
}
|
||||
|
||||
Translator::~Translator() {
|
||||
Translator::~Translator()
|
||||
{
|
||||
}
|
||||
|
||||
bool Translator::loadCatalog(QTranslator & t, QString name, QString locale, QString dir) {
|
||||
bool Translator::loadCatalog(QTranslator & t, QString name, QString locale, QString dir)
|
||||
{
|
||||
QString s = name + "_" + locale + ".qm"; //.toLower();
|
||||
bool r = t.load(s, dir);
|
||||
if (r) {
|
||||
// qDebug("Translator::loadCatalog: successfully loaded %s from %s", s.toUtf8().data(), dir.toUtf8().data());
|
||||
}
|
||||
else {
|
||||
if (!r) {
|
||||
qDebug("Translator::loadCatalog: can't load %s from %s", s.toUtf8().data(), dir.toUtf8().data());
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
void Translator::load(const QString &snap/*QString locale*/) {
|
||||
void Translator::load(const QString &snap)
|
||||
{
|
||||
QString locale = QLocale::system().name();
|
||||
|
||||
QString trans_path = Paths::translationPath();
|
||||
//edited by kobe 20160823
|
||||
|
||||
QString qt_trans_path;
|
||||
if (!snap.isEmpty()) {
|
||||
qt_trans_path = QString("%1%2").arg(snap).arg(Paths::qtTranslationPath());
|
||||
@@ -56,11 +57,6 @@ void Translator::load(const QString &snap/*QString locale*/) {
|
||||
qt_trans_path = Paths::qtTranslationPath();
|
||||
}
|
||||
|
||||
// In linux try to load it first from app path (in case there's an updated
|
||||
// translation), if it fails it will try then from the Qt path.
|
||||
// if (! loadCatalog(qt_trans, "qt", locale, trans_path ) ) {
|
||||
loadCatalog(qt_trans, "qt", locale, qt_trans_path);
|
||||
// }
|
||||
|
||||
loadCatalog(app_trans, "kylin-video", locale, trans_path);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,9 @@ RESOURCES = res.qrc
|
||||
|
||||
DEFINES += SINGLE_INSTANCE
|
||||
|
||||
!system($$PWD/translations/generate_translations_pm.sh): error("Failed to generate pm")
|
||||
qm_files.files = translations/*.qm
|
||||
qm_files.path = /usr/share/kylin-video/translations/
|
||||
inst1.files += res/kylin-video.png
|
||||
inst1.path = /usr/share/pixmaps
|
||||
inst2.files += ../kylin-video.desktop
|
||||
@@ -21,6 +24,7 @@ target.source += $$TARGET
|
||||
target.path = /usr/bin
|
||||
INSTALLS += inst1 \
|
||||
inst2 \
|
||||
qm_files \
|
||||
target
|
||||
|
||||
QMAKE_CPPFLAGS *= $(shell dpkg-buildflags --get CPPFLAGS)
|
||||
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#! /bin/bash
|
||||
|
||||
ts_file_list=(`ls translations/*.ts`)
|
||||
|
||||
for ts in "${ts_file_list[@]}"
|
||||
do
|
||||
lrelease "${ts}"
|
||||
done
|
||||
Reference in New Issue
Block a user