Translation of standard buttons text on Android in QT6

Found the following code in qt-everywhere-src-6.4.0\qtbase\src\plugins\platforms\android\qandroidplatformtheme.cpp:

QString QAndroidPlatformTheme::standardButtonText(int button) const
{
    switch (button) {
    case QPlatformDialogHelper::Yes:
        return QCoreApplication::translate("QAndroidPlatformTheme", "Yes");
    case QPlatformDialogHelper::YesToAll:
        return QCoreApplication::translate("QAndroidPlatformTheme", "Yes to All");
    case QPlatformDialogHelper::No:
        return QCoreApplication::translate("QAndroidPlatformTheme", "No");
    case QPlatformDialogHelper::NoToAll:
        return QCoreApplication::translate("QAndroidPlatformTheme", "No to All");
    }
    return QPlatformTheme::standardButtonText(button);
}

And in addition to QPlatformTheme added the following to my Russian translation file:

<context>
    <name>QAndroidPlatformTheme</name>
    <message>
        <source>Yes</source>
        <translation>Да</translation>
    </message>
    <message>
        <source>Yes to All</source>
        <translation>Да для всех</translation>
    </message>
    <message>
        <source>No</source>
        <translation>Нет</translation>
    </message>
    <message>
        <source>No to All</source>
        <translation>Нет для всех</translation>
    </message>
</context>

Leave a Reply

Your email address will not be published. Required fields are marked *