mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Merge pull request #57 from VanDerSam/master
I18N was improved. Translation GUI to Russian was made.
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -15,6 +15,9 @@ src/debug
|
||||
src/release
|
||||
src/gen_version.h
|
||||
|
||||
# ignore compiled translation files
|
||||
src/translations/*.qm
|
||||
|
||||
# no one needs the txt file
|
||||
src/grammar/sqlite3TokenTypes.txt
|
||||
|
||||
|
||||
@@ -96,6 +96,12 @@ set(SQLB_RESOURCES
|
||||
src/icons/icons.qrc
|
||||
)
|
||||
|
||||
# Translation files
|
||||
set(SQLB_TSS
|
||||
${CMAKE_SOURCE_DIR}/src/translations/sqlb_de.ts
|
||||
${CMAKE_SOURCE_DIR}/src/translations/sqlb_ru.ts
|
||||
)
|
||||
|
||||
if(USE_QT5)
|
||||
qt5_wrap_ui(SQLB_FORM_HDR ${SQLB_FORMS})
|
||||
qt5_add_resources(SQLB_RESOURCES_RCC ${SQLB_RESOURCES})
|
||||
@@ -103,6 +109,13 @@ else()
|
||||
QT4_WRAP_CPP(SQLB_MOC ${SQLB_MOC_HDR})
|
||||
QT4_WRAP_UI(SQLB_FORM_HDR ${SQLB_FORMS})
|
||||
QT4_ADD_RESOURCES(SQLB_RESOURCES_RCC ${SQLB_RESOURCES})
|
||||
if(SQLB_TSS)
|
||||
# add translations
|
||||
foreach(SQLB_TS ${SQLB_TSS})
|
||||
SET_SOURCE_FILES_PROPERTIES(${SQLB_TS} PROPERTIES OUTPUT_LOCATION "${CMAKE_BINARY_DIR}/translations")
|
||||
endforeach(SQLB_TS ${SQLB_TSS})
|
||||
QT4_ADD_TRANSLATION(SQLB_QMS ${SQLB_TSS})
|
||||
endif(SQLB_TSS)
|
||||
endif()
|
||||
|
||||
# get git version hash
|
||||
@@ -168,7 +181,8 @@ add_executable(${PROJECT_NAME}
|
||||
${SQLB_SRC}
|
||||
${SQLB_FORM_HDR}
|
||||
${SQLB_MOC}
|
||||
${SQLB_RESOURCES_RCC})
|
||||
${SQLB_RESOURCES_RCC}
|
||||
${SQLB_QMS})
|
||||
|
||||
if(USE_QT5)
|
||||
qt5_use_modules(${PROJECT_NAME} Gui Widgets Network Test PrintSupport)
|
||||
|
||||
@@ -23,12 +23,29 @@ Application::Application(int& argc, char** argv) :
|
||||
#endif
|
||||
|
||||
// Load translations
|
||||
m_translatorQt = new QTranslator(this);
|
||||
m_translatorQt->load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
installTranslator(m_translatorQt);
|
||||
bool ok;
|
||||
QString name = QLocale::system().name();
|
||||
|
||||
// First of all try to load the application translation file.
|
||||
m_translatorApp = new QTranslator(this);
|
||||
m_translatorApp->load("tr_" + QLocale::system().name(), "translations");
|
||||
installTranslator(m_translatorApp);
|
||||
ok = m_translatorApp->load("sqlb_" + name, "translations");
|
||||
if (ok == true) {
|
||||
installTranslator(m_translatorApp);
|
||||
|
||||
// The application translation file has been found and loaded.
|
||||
// And now try to load a Qt translation file.
|
||||
// Search path:
|
||||
// 1) standard Qt translations directory;
|
||||
// 2) the application translations directory.
|
||||
m_translatorQt = new QTranslator(this);
|
||||
|
||||
ok = m_translatorQt->load("qt_" + name,
|
||||
QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||
if (ok == false)
|
||||
ok = m_translatorQt->load("qt_" + name, "translations");
|
||||
if (ok == true)
|
||||
installTranslator(m_translatorQt);
|
||||
}
|
||||
|
||||
// Parse command line
|
||||
QString fileToOpen;
|
||||
|
||||
@@ -278,8 +278,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>637</width>
|
||||
<height>501</height>
|
||||
<width>281</width>
|
||||
<height>444</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
@@ -1033,7 +1033,7 @@
|
||||
<item>
|
||||
<widget class="QPushButton" name="butSavePlot">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>Save current plot...</p><p>File format choosen by extension (png, jpg, pdf, bmp)</p></body></html></string>
|
||||
<string><html><head/><body><p>Save current plot...</p><p>File format chosen by extension (png, jpg, pdf, bmp)</p></body></html></string>
|
||||
</property>
|
||||
<property name="statusTip">
|
||||
<string>Save current plot...</string>
|
||||
@@ -1256,7 +1256,7 @@
|
||||
<string>Delete Table...</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Delete Object</string>
|
||||
<string>Delete Table</string>
|
||||
</property>
|
||||
<property name="whatsThis">
|
||||
<string>Open the Delete Table wizard, where you can select a database table to be dropped.</string>
|
||||
|
||||
40
src/i18n.pri
Normal file
40
src/i18n.pri
Normal file
@@ -0,0 +1,40 @@
|
||||
# This file is taken from the project https://gitorious.org/qop/qop/.
|
||||
# For autocompiling qm-files.
|
||||
|
||||
#rules to generate ts
|
||||
isEmpty(QMAKE_LUPDATE) {
|
||||
win32: QMAKE_LUPDATE = $$[QT_INSTALL_BINS]/lupdate.exe
|
||||
unix {
|
||||
QMAKE_LUPDATE = $$[QT_INSTALL_BINS]/lupdate
|
||||
!exists($$QMAKE_LUPDATE) { QMAKE_LUPDATE = lupdate-qt4 }
|
||||
} else {
|
||||
!exists($$QMAKE_LUPDATE) { QMAKE_LUPDATE = lupdate }
|
||||
}
|
||||
}
|
||||
#limitation: only on ts can be generated
|
||||
updatets.name = Creating or updating ts-files...
|
||||
updatets.input = _PRO_FILE_
|
||||
updatets.output = $$TRANSLATIONS
|
||||
updatets.commands = $$QMAKE_LUPDATE ${QMAKE_FILE_IN}
|
||||
updatets.CONFIG += no_link no_clean
|
||||
QMAKE_EXTRA_COMPILERS += updatets
|
||||
|
||||
#rules for ts->qm
|
||||
isEmpty(QMAKE_LRELEASE) {
|
||||
#a qm generated by lrelease-qt3 can be used for qt2, qt3, qt4!
|
||||
win32: QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease.exe
|
||||
unix {
|
||||
QMAKE_LRELEASE = lrelease-qt3
|
||||
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease }
|
||||
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease }
|
||||
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease-qt4 }
|
||||
} else {
|
||||
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease }
|
||||
}
|
||||
}
|
||||
updatets.name = Compiling qm-files...
|
||||
updateqm.input = TRANSLATIONS
|
||||
updateqm.output = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.qm
|
||||
updateqm.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.qm
|
||||
updateqm.CONFIG += no_link no_clean target_predeps
|
||||
QMAKE_EXTRA_COMPILERS += updateqm
|
||||
@@ -81,7 +81,8 @@ FORMS += \
|
||||
VacuumDialog.ui
|
||||
|
||||
TRANSLATIONS += \
|
||||
translations/tr_de.ts
|
||||
translations/sqlb_de.ts \
|
||||
translations/sqlb_ru.ts
|
||||
|
||||
LIBPATH_QHEXEDIT=$$PWD/../libs/qhexedit
|
||||
LIBPATH_ANTLR=$$PWD/../libs/antlr-2.7.7
|
||||
@@ -117,3 +118,6 @@ UI_DIR = .ui
|
||||
INCLUDEPATH += $$PWD/../libs/antlr-2.7.7 $$PWD/../libs/qhexedit $$PWD/../libs/qcustomplot-source $$PWD/..
|
||||
LIBS += -L$$LIBPATH_QHEXEDIT -L$$LIBPATH_ANTLR -L$$LIBPATH_QCUSTOMPLOT -lantlr -lqhexedit -lqcustomplot -lsqlite3
|
||||
DEPENDPATH += $$PWD/../libs/antlr-2.7.7 $$PWD/../libs/qhexedit $$PWD/../libs/qcustomplot-source
|
||||
|
||||
# Rules for creating/updating {ts|qm}-files
|
||||
include(i18n.pri)
|
||||
|
||||
1
src/translations/README
Normal file
1
src/translations/README
Normal file
@@ -0,0 +1 @@
|
||||
TS files for the application should be all named according to a convention such as <short_appname>_<locale>, e.g. sqlb_de, sqlb_ru etc.
|
||||
File diff suppressed because it is too large
Load Diff
2057
src/translations/sqlb_ru.ts
Executable file
2057
src/translations/sqlb_ru.ts
Executable file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Reference in New Issue
Block a user