Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

About dialog in french.



  • I have an about dialog that contains the following license text in English:

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
    IN THE SOFTWARE.
    

    Using Google translation I got this txt for French:

    LE LOGICIEL EST FOURNI « EN L’ÉTAT », SANS GARANTIE D’AUCUNE SORTE, EXPRESSE OU
    IMPLICITE, Y COMPRIS, MAIS SANS S’Y LIMITER, LES GARANTIES DE QUALITÉ MARCHANDE,
    APTITUDE À UN USAGE PARTICULIER ET NON-CONTRE-PRODUIT. EN AUCUN CAS, LE
    LES AUTEURS OU LES DÉTENTEURS DE DROITS D’AUTEUR DOIVENT ÊTRE TENUS RESPONSABLES DE TOUTE RÉCLAMATION, DOMMAGE OU AUTRE
    RESPONSABILITÉ, QUE CE SOIT DANS LE CADRE D’UNE ACTION CONTRACTUELLE, DÉLICTUELLE OU AUTRE, DÉCOULANT
    DE, HORS OU EN RELATION AVEC LE LOGICIEL OU L’UTILISATION OU D’AUTRES TRANSACTIONS
    DANS LE LOGICIEL.
    

    The problem is when rendered in the dialog I get:
    e1dc1264-0b4a-497a-8fd5-26b666288792-image.png

    The font used for the QPlainTextEdit is Courier New, 10. Can anyone help me to fix this so it renders with the correct characters?


  • Lifetime Qt Champion

    @SPlatten said in About dialog in french.:

    fromLocal8Bit

    Why?!


  • Lifetime Qt Champion

    @SPlatten How do you add this text to the dialog?
    If this text is a string in your code: does your source code file use UTF-8 encoding?
    If you read the text from a file, then how exactly?



  • @jsulm , like this:

        QString strLanguage(Trainer::sstrLanguage()), strLicense(":/licenses");
        if ( strLanguage.compare(Trainer::mscstrDefaultLanguage) != 0 ) {
            strLicense = QString("%1_%2").arg(strLicense).arg(strLanguage);
        }
        QFile licences(strLicense);
        licences.open(QFile::ReadOnly);
        ui->licences->setPlainText(QString::fromLocal8Bit(licences.readAll()));
    

  • Lifetime Qt Champion

    @SPlatten said in About dialog in french.:

    fromLocal8Bit

    Why?!



  • @jsulm , sorry, no idea, however, having removed that, now its fine, thank you.


Log in to reply