mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 18:40:13 -06:00
localization: Use path relative to the application executable
This allows the languages to be loaded when the user is running the app from another directory (e.g. when the app is run from an exported path).
This commit is contained in:
@@ -30,7 +30,9 @@ Application::Application(int& argc, char** argv) :
|
||||
|
||||
// First of all try to load the application translation file.
|
||||
m_translatorApp = new QTranslator(this);
|
||||
ok = m_translatorApp->load("sqlb_" + name, "translations");
|
||||
ok = m_translatorApp->load("sqlb_" + name,
|
||||
QCoreApplication::applicationDirPath() + "/translations");
|
||||
|
||||
if (ok == true) {
|
||||
PreferencesDialog::setSettingsValue("General", "language", name);
|
||||
installTranslator(m_translatorApp);
|
||||
|
||||
@@ -265,7 +265,9 @@ void PreferencesDialog::removeExtension()
|
||||
|
||||
void PreferencesDialog::fillLanguageBox()
|
||||
{
|
||||
QDir translationsDir("translations", "sqlb_*.qm");
|
||||
// Use the path relative to the main executable
|
||||
QDir translationsDir(QCoreApplication::applicationDirPath() + "/translations",
|
||||
"sqlb_*.qm");
|
||||
|
||||
// Add default language
|
||||
ui->languageComboBox->addItem("English (United States)", "en_US");
|
||||
|
||||
Reference in New Issue
Block a user