| 1 |
// Copyright (C) 2021 The Qt Company Ltd. |
| 2 |
// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, [email protected], author Stephen Kelly <[email protected]> |
| 3 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 4 |
|
| 5 |
#include <QDebug> |
| 6 |
#include <QCoreApplication> |
| 7 |
#include <QLocale> |
| 8 |
#include <QTranslator> |
| 9 |
|
| 10 |
#include "some_include.h" |
| 11 |
|
| 12 |
int main(int argc, char **argv) |
| 13 |
{ |
| 14 |
QCoreApplication app(argc, argv); |
| 15 |
QTranslator *myappTranslator = new QTranslator; |
| 16 |
QString localeName = QLocale::system().name(); |
| 17 |
if (!myappTranslator->load("myobject_" + localeName + ".qm", qApp->applicationDirPath())) |
| 18 |
return 1; |
| 19 |
myappTranslator->setObjectName("myobject_" + localeName); |
| 20 |
app.installTranslator(myappTranslator); |
| 21 |
|
| 22 |
qDebug() << QObject::tr("Hello, world!"); |
| 23 |
return 0; |
| 24 |
} |