mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-04 06:32:29 -06:00
More UI buttons are now translated
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
- BUGFIX: Improved compatibility with various SMTP servers
|
- BUGFIX: Improved compatibility with various SMTP servers
|
||||||
- BUGFIX: Fix Labeling in RSS downloader
|
- BUGFIX: Fix Labeling in RSS downloader
|
||||||
- BUGFIX: Avoid main window flashing on startup (closes #703984)
|
- BUGFIX: Avoid main window flashing on startup (closes #703984)
|
||||||
|
- I18N: More dialog buttons are now translated
|
||||||
|
|
||||||
* Sat Jan 15 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.6.3
|
* Sat Jan 15 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.6.3
|
||||||
- BUGFIX: Fix possible crashes in full allocation mode
|
- BUGFIX: Fix possible crashes in full allocation mode
|
||||||
|
|||||||
10
src/main.cpp
10
src/main.cpp
@@ -31,6 +31,7 @@
|
|||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QLibraryInfo>
|
||||||
|
|
||||||
#ifndef DISABLE_GUI
|
#ifndef DISABLE_GUI
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@@ -196,11 +197,20 @@ int main(int argc, char *argv[]){
|
|||||||
|
|
||||||
// Load translation
|
// Load translation
|
||||||
locale = settings.value(QString::fromUtf8("Preferences/General/Locale"), QString()).toString();
|
locale = settings.value(QString::fromUtf8("Preferences/General/Locale"), QString()).toString();
|
||||||
|
QTranslator qtTranslator;
|
||||||
QTranslator translator;
|
QTranslator translator;
|
||||||
if(locale.isEmpty()){
|
if(locale.isEmpty()){
|
||||||
locale = QLocale::system().name();
|
locale = QLocale::system().name();
|
||||||
settings.setValue(QString::fromUtf8("Preferences/General/Locale"), locale);
|
settings.setValue(QString::fromUtf8("Preferences/General/Locale"), locale);
|
||||||
}
|
}
|
||||||
|
if(qtTranslator.load(
|
||||||
|
QString::fromUtf8("qt_") + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath)
|
||||||
|
)){
|
||||||
|
qDebug("Qt %s locale recognized, using translation.", qPrintable(locale));
|
||||||
|
}else{
|
||||||
|
qDebug("Qt %s locale unrecognized, using default (en_GB).", qPrintable(locale));
|
||||||
|
}
|
||||||
|
app.installTranslator(&qtTranslator);
|
||||||
if(translator.load(QString::fromUtf8(":/lang/qbittorrent_") + locale)){
|
if(translator.load(QString::fromUtf8(":/lang/qbittorrent_") + locale)){
|
||||||
qDebug("%s locale recognized, using translation.", qPrintable(locale));
|
qDebug("%s locale recognized, using translation.", qPrintable(locale));
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
Reference in New Issue
Block a user