avoided trying to load English translation file
This commit is contained in:
		
							parent
							
								
									c2e15100a4
								
							
						
					
					
						commit
						ca2e3cd5c4
					
				
							
								
								
									
										15
									
								
								main.cpp
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								main.cpp
									
									
									
									
									
								
							@ -20,15 +20,18 @@ int main(int argc, char *argv[])
 | 
				
			|||||||
        locale = QLocale::system().name();
 | 
					        locale = QLocale::system().name();
 | 
				
			||||||
        settings.setValue("language", locale);
 | 
					        settings.setValue("language", locale);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    QString tsFile = "2048-qt_" + locale;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    QTranslator translator;
 | 
					    QTranslator translator;
 | 
				
			||||||
    if (translator.load(tsFile, ":/ts")) {
 | 
					    if (! locale.startsWith("en")) {
 | 
				
			||||||
        qDebug() << "Successfully loaded " + tsFile;
 | 
					        QString tsFile = "2048-qt_" + locale;
 | 
				
			||||||
    } else {
 | 
					
 | 
				
			||||||
        qDebug() << "Failed to load " + tsFile;
 | 
					        if (translator.load(tsFile, ":/ts")) {
 | 
				
			||||||
 | 
					            qDebug() << "Successfully loaded " + tsFile;
 | 
				
			||||||
 | 
					            app.installTranslator(&translator);
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            qDebug() << "Failed to load " + tsFile;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    app.installTranslator(&translator);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    QQmlApplicationEngine engine;
 | 
					    QQmlApplicationEngine engine;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user