mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-02-25 20:35:24 +02:00
Translations are separate qm files
This commit is contained in:
parent
1b35a1ae4b
commit
9cd73dfbbe
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
*.user
|
*.user
|
||||||
*.user.*
|
*.user.*
|
||||||
|
translations/*.qm
|
||||||
|
@ -26,7 +26,11 @@ bool TranslationManager::setLanguage(const QString &language)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// translations are compiled into app binary
|
// translations are compiled into app binary
|
||||||
QString dir = ":/translations";
|
#ifdef Q_OS_MACX
|
||||||
|
QString dir = qApp->applicationDirPath() + "/../Resources/translations";
|
||||||
|
#else
|
||||||
|
QString dir = qApp->applicationDirPath() + "/translations";
|
||||||
|
#endif
|
||||||
|
|
||||||
QString filename = "monero-core_" + language;
|
QString filename = "monero-core_" + language;
|
||||||
|
|
||||||
|
7
build.sh
7
build.sh
@ -2,14 +2,17 @@
|
|||||||
|
|
||||||
pushd $(pwd)
|
pushd $(pwd)
|
||||||
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
BITMOMERO_DIR=bitmonero
|
||||||
|
|
||||||
#$SHELL get_libwallet_api.sh
|
if [ ! -d $BITMOMERO_DIR ]; then
|
||||||
|
$SHELL get_libwallet_api.sh
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -d build ]; then mkdir build; fi
|
if [ ! -d build ]; then mkdir build; fi
|
||||||
cd build
|
cd build
|
||||||
echo $(pwd)
|
echo $(pwd)
|
||||||
qmake ../monero-core.pro "CONFIG+=release"
|
qmake ../monero-core.pro "CONFIG+=release"
|
||||||
make release
|
make
|
||||||
make deploy
|
make deploy
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
3
main.cpp
3
main.cpp
@ -30,6 +30,7 @@
|
|||||||
#include <QQmlApplicationEngine>
|
#include <QQmlApplicationEngine>
|
||||||
#include <QtQml>
|
#include <QtQml>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
#include <QDebug>
|
||||||
#include "clipboardAdapter.h"
|
#include "clipboardAdapter.h"
|
||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
#include "oscursor.h"
|
#include "oscursor.h"
|
||||||
@ -46,6 +47,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
|
qDebug() << "app startd";
|
||||||
|
|
||||||
app.setApplicationName("monero-core");
|
app.setApplicationName("monero-core");
|
||||||
app.setOrganizationDomain("getmonero.org");
|
app.setOrganizationDomain("getmonero.org");
|
||||||
app.setOrganizationName("The Monero Project");
|
app.setOrganizationName("The Monero Project");
|
||||||
|
@ -5,7 +5,6 @@ QT += qml quick widgets
|
|||||||
WALLET_ROOT=$$PWD/bitmonero
|
WALLET_ROOT=$$PWD/bitmonero
|
||||||
|
|
||||||
CONFIG += c++11
|
CONFIG += c++11
|
||||||
CONFIG += debug_and_release
|
|
||||||
|
|
||||||
# cleaning "auto-generated" bitmonero directory on "make distclean"
|
# cleaning "auto-generated" bitmonero directory on "make distclean"
|
||||||
QMAKE_DISTCLEAN += -r $$WALLET_ROOT
|
QMAKE_DISTCLEAN += -r $$WALLET_ROOT
|
||||||
@ -13,8 +12,6 @@ QMAKE_DISTCLEAN += -r $$WALLET_ROOT
|
|||||||
INCLUDEPATH += $$WALLET_ROOT/include \
|
INCLUDEPATH += $$WALLET_ROOT/include \
|
||||||
$$PWD/src/libwalletqt
|
$$PWD/src/libwalletqt
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
filter.h \
|
filter.h \
|
||||||
clipboardAdapter.h \
|
clipboardAdapter.h \
|
||||||
@ -104,51 +101,59 @@ macx {
|
|||||||
-lcrypto \
|
-lcrypto \
|
||||||
-ldl
|
-ldl
|
||||||
|
|
||||||
deploy.commands += macdeployqt $$sprintf("%1/release/%2.app", $$OUT_PWD,$$TARGET)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
deploy.commands +=
|
# translation stuff
|
||||||
|
TRANSLATIONS = \ # English is default language, no explicit translation file
|
||||||
# translations files;
|
|
||||||
TRANSLATIONS = $$PWD/translations/monero-core_en.ts \ # English (could be untranslated)
|
|
||||||
$$PWD/translations/monero-core_de.ts \ # Deutsch
|
$$PWD/translations/monero-core_de.ts \ # Deutsch
|
||||||
$$PWD/translations/monero-core_zh.ts \ # Chineese
|
$$PWD/translations/monero-core_zh.ts \ # Chineese
|
||||||
$$PWD/translations/monero-core_ru.ts \ # Russian
|
$$PWD/translations/monero-core_ru.ts \ # Russian
|
||||||
$$PWD/translations/monero-core_it.ts \ # Italian
|
$$PWD/translations/monero-core_it.ts \ # Italian
|
||||||
$$PWD/translations/monero-core_pl.ts \ # Polish
|
$$PWD/translations/monero-core_pl.ts \ # Polish
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# extra make targets for lupdate and lrelease invocation
|
|
||||||
# use "make lupdate" to update *.ts files and "make lrelease" to generate *.qm files
|
|
||||||
trans_update.commands = lupdate $$_PRO_FILE_
|
|
||||||
trans_update.depends = $$_PRO_FILE_
|
|
||||||
|
|
||||||
trans_release.commands = lrelease $$_PRO_FILE_
|
|
||||||
trans_release.depends = trans_update $$TRANSLATIONS
|
|
||||||
|
|
||||||
#translate.commands = $(MKDIR) ${DESTDIR}/i18n && $(COPY) $$PWD/translations/*.qm ${DESTDIR}/i18n
|
|
||||||
translate.depends = trans_release
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QMAKE_EXTRA_TARGETS += trans_update trans_release translate deploy
|
|
||||||
|
|
||||||
# updating transations only in release mode as this is requires to re-link project
|
|
||||||
# even if no changes were made.
|
|
||||||
|
|
||||||
#PRE_TARGETDEPS += translate
|
|
||||||
|
|
||||||
CONFIG(release, debug|release) {
|
CONFIG(release, debug|release) {
|
||||||
DESTDIR = release
|
DESTDIR = release
|
||||||
PRE_TARGETDEPS += translate
|
LANGUPD_OPTIONS = -locations relative -no-ui-lines
|
||||||
}
|
LANGREL_OPTIONS = -compress -nounfinished -removeidentical
|
||||||
|
|
||||||
CONFIG(debug, debug|release) {
|
} else {
|
||||||
DESTDIR = debug
|
DESTDIR = debug
|
||||||
|
LANGUPD_OPTIONS =
|
||||||
|
LANGREL_OPTIONS = -markuntranslated "MISS_TR "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TARGET_FULL_PATH = $$OUT_PWD/$$DESTDIR
|
||||||
|
|
||||||
|
macx {
|
||||||
|
TARGET_FULL_PATH = $$sprintf("%1/%2/%3.app", $$OUT_PWD, $$DESTDIR, $$TARGET)
|
||||||
|
}
|
||||||
|
|
||||||
|
TRANSLATION_TARGET_DIR = $$TARGET_FULL_PATH/Contents/Resources/translations
|
||||||
|
|
||||||
|
isEmpty(QMAKE_LUPDATE) {
|
||||||
|
win32:LANGUPD = $$[QT_INSTALL_BINS]\lupdate.exe
|
||||||
|
else:LANGUPD = $$[QT_INSTALL_BINS]/lupdate
|
||||||
|
}
|
||||||
|
|
||||||
|
isEmpty(QMAKE_LRELEASE) {
|
||||||
|
win32:LANGREL = $$[QT_INSTALL_BINS]\lrelease.exe
|
||||||
|
else:LANGREL = $$[QT_INSTALL_BINS]/lrelease
|
||||||
|
}
|
||||||
|
|
||||||
|
langupd.command = \
|
||||||
|
$$LANGUPD $$LANGUPD_OPTIONS $$shell_path($$_PRO_FILE) -ts $$_PRO_FILE_PWD/$$TRANSLATIONS
|
||||||
|
|
||||||
|
langrel.depends = langupd
|
||||||
|
langrel.input = TRANSLATIONS
|
||||||
|
langrel.output = $$TRANSLATION_TARGET_DIR/${QMAKE_FILE_BASE}.qm
|
||||||
|
langrel.commands = \
|
||||||
|
$$LANGREL $$LANGREL_OPTIONS ${QMAKE_FILE_IN} -qm $$TRANSLATION_TARGET_DIR/${QMAKE_FILE_BASE}.qm
|
||||||
|
langrel.CONFIG += no_link
|
||||||
|
|
||||||
|
QMAKE_EXTRA_TARGETS += langupd deploy
|
||||||
|
QMAKE_EXTRA_COMPILERS += langrel
|
||||||
|
PRE_TARGETDEPS += langupd compiler_langrel_make_all
|
||||||
|
|
||||||
RESOURCES += qml.qrc
|
RESOURCES += qml.qrc
|
||||||
|
|
||||||
@ -157,6 +162,14 @@ QML_IMPORT_PATH =
|
|||||||
|
|
||||||
# Default rules for deployment.
|
# Default rules for deployment.
|
||||||
include(deployment.pri)
|
include(deployment.pri)
|
||||||
|
macx {
|
||||||
|
deploy.commands += macdeployqt $$sprintf("%1/%2/%3.app", $$OUT_PWD, $$DESTDIR, $$TARGET)
|
||||||
|
}
|
||||||
|
|
||||||
|
win32 {
|
||||||
|
deploy.commands += windeployqt $$sprintf("%1/%2/%3", $$OUT_PWD, $$DESTDIR, $$TARGET)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -167,3 +180,4 @@ OTHER_FILES += \
|
|||||||
|
|
||||||
DISTFILES += \
|
DISTFILES += \
|
||||||
notes.txt
|
notes.txt
|
||||||
|
|
||||||
|
6
qml.qrc
6
qml.qrc
@ -114,11 +114,5 @@
|
|||||||
<file>pages/Receive.qml</file>
|
<file>pages/Receive.qml</file>
|
||||||
<file>components/IconButton.qml</file>
|
<file>components/IconButton.qml</file>
|
||||||
<file>lang/flags/italy.png</file>
|
<file>lang/flags/italy.png</file>
|
||||||
<file>translations/monero-core_de.qm</file>
|
|
||||||
<file>translations/monero-core_en.qm</file>
|
|
||||||
<file>translations/monero-core_it.qm</file>
|
|
||||||
<file>translations/monero-core_pl.qm</file>
|
|
||||||
<file>translations/monero-core_ru.qm</file>
|
|
||||||
<file>translations/monero-core_zh.qm</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
Loading…
Reference in New Issue
Block a user