src/main.cpp

changeset 296
38f6fad61bad
parent 293
9f85a54ead29
child 299
cf9a854b56a9
--- a/src/main.cpp	Tue Jun 28 19:25:45 2022 +0300
+++ b/src/main.cpp	Tue Jun 28 19:31:55 2022 +0300
@@ -145,36 +145,6 @@
 		QObject::tr("LDraw models (*.ldr *.dat)"));
 }
 
-#if 0
-static const QString localeCode(const QString& locale)
-{
-	if (locale == "system") {
-		return QLocale::system().name();
-	}
-	else {
-		return locale;
-	}
-}
-
-/**
- * @brief Changes the application language to the specified language
- */
-static void changeLanguage(const QString& locale, QTranslator* translator)
-{
-	if (not locale.isEmpty()) {
-		const QString localeCode = ::localeCode(locale);
-		QLocale::setDefault(QLocale{localeCode});
-		qApp->removeTranslator(translator);
-		const QString path = LOCALE_DIR.filePath(localeCode + ".qm");
-		const bool loadSuccessful = translator->load(path);
-		if (loadSuccessful)
-		{
-			qApp->installTranslator(translator);
-		}
-	}
-}
-#endif
-
 static ModelData* findModelData(const DocumentManager* documents, ModelId modelId)
 {
 	return documents->findPayload<ModelData>(modelId);
@@ -495,7 +465,6 @@
 	const auto restoreSettings = [&]{
 		recentlyOpenedFiles = setting<Setting::RecentFiles>();
 		renderPreferences = loadRenderPreferences();
-		//changeLanguage(setting<Setting::Locale>(), &translator);
 		libraries.restoreFromSettings();
 		updateRecentlyOpenedDocumentsMenu();
 		colorTable = loadColors(&libraries);

mercurial